< prev index next >

src/java.desktop/windows/classes/sun/awt/Win32GraphicsEnvironment.java

Print this page

        

@@ -49,20 +49,38 @@
  * @see GraphicsConfiguration
  */
 
 public final class Win32GraphicsEnvironment extends SunGraphicsEnvironment {
 
+    static final float debugScaleX;
+    static final float debugScaleY;
+
     static {
         // Ensure awt is loaded already.  Also, this forces static init
         // of WToolkit and Toolkit, which we depend upon
         WToolkit.loadLibraries();
         // setup flags before initializing native layer
         WindowsFlags.initFlags();
         initDisplayWrapper();
 
         // Install correct surface manager factory.
         SurfaceManagerFactory.setInstance(new WindowsSurfaceManagerFactory());
+
+        double sx = -1;
+        double sy = -1;
+        if (isUIScaleEnabled()) {
+            sx = getScaleFactor("sun.java2d.win.uiScaleX");
+            sy = getScaleFactor("sun.java2d.win.uiScaleY");
+            if (sx <= 0 || sy <= 0) {
+                double s = getDebugScale();
+                sx = s;
+                sy = s;
+            }
+        }
+
+        debugScaleX = (float) sx;
+        debugScaleY = (float) sy;
     }
 
     /**
      * Initializes native components of the graphics environment.  This
      * includes everything from the native GraphicsDevice elements to
< prev index next >