--- old/src/java.desktop/windows/classes/sun/java2d/opengl/WGLSurfaceData.java 2017-10-30 15:50:39.251449766 +0530 +++ new/src/java.desktop/windows/classes/sun/java2d/opengl/WGLSurfaceData.java 2017-10-30 15:50:39.071359766 +0530 @@ -37,6 +37,7 @@ import sun.awt.Win32GraphicsDevice; import sun.awt.windows.WComponentPeer; import sun.java2d.SurfaceData; +import sun.java2d.pipe.Region; public abstract class WGLSurfaceData extends OGLSurfaceData { @@ -165,8 +166,8 @@ public Rectangle getBounds() { 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; } @@ -227,8 +228,8 @@ { super(peer, gc, cm, type); - 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); offscreenImage = image; initSurface(this.width, this.height); @@ -241,8 +242,8 @@ public Rectangle getBounds() { if (type == FLIP_BACKBUFFER) { Rectangle r = peer.getBounds(); - 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); r.x = r.y = 0; return r; } else { --- old/test/jdk/sun/java2d/SunGraphics2D/DrawImageBilinear.java 2017-10-30 15:50:39.767707766 +0530 +++ new/test/jdk/sun/java2d/SunGraphics2D/DrawImageBilinear.java 2017-10-30 15:50:39.587617766 +0530 @@ -23,11 +23,11 @@ /* * @test * @key headful - * @bug 5009033 6603000 6666362 + * @bug 5009033 6603000 6666362 8159142 * @summary Verifies that images transformed with bilinear filtering do not * leave artifacts at the edges. - * @run main/othervm DrawImageBilinear - * @run main/othervm -Dsun.java2d.opengl=True DrawImageBilinear + * @run main/othervm -Dsun.java2d.uiScale=2.5 DrawImageBilinear + * @run main/othervm -Dsun.java2d.opengl=True -Dsun.java2d.uiScale=2.5 DrawImageBilinear * @author campbelc */