public SurfaceData replaceSurfaceData() { if (getBounds().isEmpty()) { surfaceData = NullSurfaceData.theInstance; return surfaceData; } // the layer redirects all painting to the buffer's graphics // and blits the buffer to the layer surface (in drawInCGLContext callback) CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = gc.createSurfaceData(this); setScale(gc.getDevice().getScaleFactor()); // the layer holds a reference to the buffer, which in // turn has a reference back to this layer if (surfaceData instanceof CGLSurfaceData) { validate((CGLSurfaceData)surfaceData); } return surfaceData; }
public SurfaceData replaceSurfaceData() { if (!LWCToolkit.getSunAwtDisableCALayers()) { surfaceData = windowLayer.replaceSurfaceData(); } else { if (surfaceData == null) { CGraphicsConfig graphicsConfig = (CGraphicsConfig)getGraphicsConfiguration(); surfaceData = graphicsConfig.createSurfaceData(this); } else { validateSurface(); } } return surfaceData; }
@Override public void createBuffers(final int numBuffers, final BufferCapabilities caps) { //TODO parameters should be used. final CGraphicsConfig gc = (CGraphicsConfig) getGraphicsConfiguration(); final VolatileImage buffer = gc.createBackBufferImage(getTarget(), 0); synchronized (getStateLock()) { backBuffer = buffer; } }