src/macosx/classes/sun/java2d/opengl/CGLGraphicsConfig.java

Print this page

        

@@ -439,31 +439,39 @@
     //          so we use this value to cap the total display bounds.
     native private static int getMaxTextureSize();
 
     @Override
     public int getMaxTextureWidth() {
+        //Temporary disable this logic and use some magic constrain.
+        /*
         int width;
 
         synchronized (totalDisplayBounds) {
             if (totalDisplayBounds.width == 0) {
                 updateTotalDisplayBounds();
             }
             width = totalDisplayBounds.width;
         }
 
         return Math.min(width, getMaxTextureSize());
+         */
+        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
     }
 
     @Override
     public int getMaxTextureHeight() {
+        //Temporary disable this logic and use some magic constrain.
+        /*
         int height;
 
         synchronized (totalDisplayBounds) {
             if (totalDisplayBounds.height == 0) {
                 updateTotalDisplayBounds();
             }
             height = totalDisplayBounds.height;
         }
 
         return Math.min(height, getMaxTextureSize());
+         */
+        return getMaxTextureSize() / (getDevice().getScaleFactor() * 2);
     }
 }