< prev index next >

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

Print this page

        

@@ -28,10 +28,11 @@
 import java.awt.Color;
 import java.awt.Graphics2D;
 import java.awt.GraphicsConfiguration;
 import java.awt.Image;
 import java.awt.Window;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferInt;
 import java.awt.image.VolatileImage;
 import java.security.AccessController;
 import sun.awt.image.BufImgSurfaceData;

@@ -43,10 +44,11 @@
 import sun.java2d.pipe.hw.AccelGraphicsConfig;
 import sun.java2d.pipe.hw.AccelSurface;
 import sun.security.action.GetPropertyAction;
 
 import static java.awt.image.VolatileImage.*;
+import sun.java2d.pipe.Region;
 import static sun.java2d.pipe.hw.AccelSurface.*;
 import static sun.java2d.pipe.hw.ContextCapabilities.*;
 
 /**
  * This class handles the updates of the non-opaque windows.

@@ -250,14 +252,17 @@
             super(peer);
         }
 
         @Override
         protected Image getBackBuffer(boolean clear) {
-            int w = window.getWidth();
-            int h = window.getHeight();
+            
             GraphicsConfiguration gc = peer.getGraphicsConfiguration();
 
+            AffineTransform tx = gc.getDefaultTransform();
+            int w = Region.clipScale(window.getWidth(), tx.getScaleX());
+            int h = Region.clipScale(window.getHeight(), tx.getScaleY());
+            
             if (viBB == null || viBB.getWidth() != w || viBB.getHeight() != h ||
                 viBB.validate(gc) == IMAGE_INCOMPATIBLE)
             {
                 flush();
 
< prev index next >