< prev index next >

src/java.desktop/macosx/classes/sun/java2d/opengl/CGLSurfaceData.java

Print this page
rev 54883 : JDK-8220154 Improve java2d rendering performance on macOS by using Metal framework


 232      * This surface serves as a buffer attached to a CGLLayer and
 233      * the layer redirects all painting to the buffer's graphics.
 234      */
 235     public static class CGLLayerSurfaceData extends CGLSurfaceData {
 236 
 237         private CGLLayer layer;
 238 
 239         public CGLLayerSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
 240                                    int width, int height) {
 241             super(layer, gc, gc.getColorModel(), FBOBJECT, width, height);
 242             this.layer = layer;
 243             initSurface(this.width, this.height);
 244         }
 245 
 246         @Override
 247         public SurfaceData getReplacement() {
 248             return layer.getSurfaceData();
 249         }
 250 
 251         @Override
 252         boolean isOnScreen() {
 253             return true;
 254         }
 255 
 256         @Override
 257         public Rectangle getBounds() {
 258             return new Rectangle(width, height);
 259         }
 260 
 261         @Override
 262         public Object getDestination() {
 263             return layer.getDestination();
 264         }
 265 
 266         @Override
 267         public int getTransparency() {
 268             return layer.getTransparency();
 269         }
 270 
 271         @Override
 272         public void invalidate() {




 232      * This surface serves as a buffer attached to a CGLLayer and
 233      * the layer redirects all painting to the buffer's graphics.
 234      */
 235     public static class CGLLayerSurfaceData extends CGLSurfaceData {
 236 
 237         private CGLLayer layer;
 238 
 239         public CGLLayerSurfaceData(CGLLayer layer, CGLGraphicsConfig gc,
 240                                    int width, int height) {
 241             super(layer, gc, gc.getColorModel(), FBOBJECT, width, height);
 242             this.layer = layer;
 243             initSurface(this.width, this.height);
 244         }
 245 
 246         @Override
 247         public SurfaceData getReplacement() {
 248             return layer.getSurfaceData();
 249         }
 250 
 251         @Override
 252         public boolean isOnScreen() {
 253             return true;
 254         }
 255 
 256         @Override
 257         public Rectangle getBounds() {
 258             return new Rectangle(width, height);
 259         }
 260 
 261         @Override
 262         public Object getDestination() {
 263             return layer.getDestination();
 264         }
 265 
 266         @Override
 267         public int getTransparency() {
 268             return layer.getTransparency();
 269         }
 270 
 271         @Override
 272         public void invalidate() {


< prev index next >