< prev index next >

src/java.desktop/windows/classes/sun/java2d/d3d/D3DSurfaceData.java

Print this page

        

@@ -56,10 +56,11 @@
 import sun.java2d.loops.CompositeType;
 import sun.java2d.pipe.ParallelogramPipe;
 import sun.java2d.pipe.PixelToParallelogramConverter;
 import sun.java2d.pipe.RenderBuffer;
 import sun.java2d.pipe.TextPipe;
+import sun.java2d.pipe.Region;
 import static sun.java2d.pipe.BufferedOpCodes.*;
 import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
 import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*;
 import sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType;
 import java.awt.BufferCapabilities.FlipContents;

@@ -234,12 +235,12 @@
         } else if (peer instanceof WWindowPeer) {
             Dimension scaledSize = ((WWindowPeer) peer).getScaledWindowSize();
             this.width = scaledSize.width;
             this.height = scaledSize.height;
         } else {
-            this.width = (int) Math.ceil(width * scaleX);
-            this.height = (int) Math.ceil(height * scaleY);
+            this.width = Region.clipRound(width * scaleX);
+            this.height = Region.clipRound(height * scaleY);
         }
 
         this.offscreenImage = image;
         this.backBuffersNum = numBackBuffers;
         this.swapEffect = swapEffect;

@@ -810,12 +811,12 @@
         if (type == FLIP_BACKBUFFER || type == WINDOW) {
             double scaleX = getDefaultScaleX();
             double scaleY = getDefaultScaleY();
             Rectangle r = peer.getBounds();
             r.x = r.y = 0;
-            r.width = (int) Math.ceil(r.width * scaleX);
-            r.height = (int) Math.ceil(r.height * scaleY);
+            r.width = Region.clipRound(r.width * scaleX);
+            r.height = Region.clipRound(r.height * scaleY);
             return r;
         } else {
             return new Rectangle(width, height);
         }
     }
< prev index next >