--- old/src/java.desktop/windows/classes/sun/awt/windows/TranslucentWindowPainter.java 2016-08-17 13:53:15.479572000 +0530 +++ new/src/java.desktop/windows/classes/sun/awt/windows/TranslucentWindowPainter.java 2016-08-17 13:53:15.279572000 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,6 +45,7 @@ import sun.security.action.GetPropertyAction; import static java.awt.image.VolatileImage.*; +import sun.java2d.SurfaceData; import static sun.java2d.pipe.hw.AccelSurface.*; import static sun.java2d.pipe.hw.ContextCapabilities.*; @@ -303,10 +304,12 @@ if (bb instanceof DestSurfaceProvider) { Surface s = ((DestSurfaceProvider)bb).getDestSurface(); if (s instanceof AccelSurface) { - final int w = bb.getWidth(null); - final int h = bb.getHeight(null); final boolean arr[] = { false }; final AccelSurface as = (AccelSurface)s; + double scaleX = ((SurfaceData)as).getDefaultScaleX(); + double scaleY = ((SurfaceData)as).getDefaultScaleY(); + final int w = (int) Math.ceil(bb.getWidth(null) * scaleX); + final int h = (int) Math.ceil(bb.getHeight(null) * scaleY); RenderQueue rq = as.getContext().getRenderQueue(); rq.lock(); try { --- old/test/javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java 2016-08-17 13:53:15.999572000 +0530 +++ new/test/javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java 2016-08-17 13:53:15.791572000 +0530 @@ -25,6 +25,7 @@ /* * @test + * @bug 8144735 * @key headful * @summary Check if a per-pixel translucent and translucent window is dragged * and resized by mouse correctly