8144735: [hidpi] javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java fails
authorpkbalakr
Thu, 01 Sep 2016 16:18:14 +0530
changeset 40991 24c96f117cf5
parent 40990 6d08b34e7f84
child 40992 788c9cca556f
8144735: [hidpi] javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java fails Reviewed-by: psadhukhan, vadim
jdk/src/java.desktop/windows/classes/sun/awt/windows/TranslucentWindowPainter.java
jdk/test/javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java
--- a/jdk/src/java.desktop/windows/classes/sun/awt/windows/TranslucentWindowPainter.java	Thu Sep 01 12:02:22 2016 +0300
+++ b/jdk/src/java.desktop/windows/classes/sun/awt/windows/TranslucentWindowPainter.java	Thu Sep 01 16:18:14 2016 +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
@@ -303,10 +303,10 @@
             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;
+                    final int w = as.getBounds().width;
+                    final int h = as.getBounds().height;
                     RenderQueue rq = as.getContext().getRenderQueue();
                     rq.lock();
                     try {
--- a/jdk/test/javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java	Thu Sep 01 12:02:22 2016 +0300
+++ b/jdk/test/javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentPerPixelTranslucentGradient.java	Thu Sep 01 16:18:14 2016 +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