--- old/src/macosx/classes/sun/java2d/opengl/CGLLayer.java 2013-05-13 18:47:01.539399800 +0400 +++ new/src/macosx/classes/sun/java2d/opengl/CGLLayer.java 2013-05-13 18:47:01.354389200 +0400 @@ -40,11 +40,12 @@ public class CGLLayer extends CFRetainedResource { private native long nativeCreateLayer(); - + private static native void nativeSetScale(long layerPtr, double scale); private static native void validate(long layerPtr, CGLSurfaceData cglsd); private static native void blitTexture(long layerPtr); private LWWindowPeer peer; + private int scale = 1; private SurfaceData surfaceData; // represents intermediate buffer (texture) @@ -90,7 +91,7 @@ // and blits the buffer to the layer surface (in drawInCGLContext callback) CGraphicsConfig gc = (CGraphicsConfig)peer.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) { @@ -121,6 +122,13 @@ super.dispose(); } + private void setScale(final int _scale) { + if (scale != _scale) { + scale = _scale; + nativeSetScale(getPointer(), scale); + } + } + // ---------------------------------------------------------------------- // NATIVE CALLBACKS // ----------------------------------------------------------------------