changeset 8816:e5eb65043d31

8027541: ully transparent jframe becomes black. Reviewed-by: bae, ceisserer
author prr
date Tue, 19 Nov 2013 10:36:02 -0800
parents f2ae86dba4bc
children 4592f0985e78
files src/solaris/classes/sun/java2d/xr/XRSurfaceData.java
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Wed Nov 13 11:59:49 2013 -0800
+++ b/src/solaris/classes/sun/java2d/xr/XRSurfaceData.java	Tue Nov 19 10:36:02 2013 -0800
@@ -245,7 +245,17 @@
                                                  ColorModel cm, Image image,
                                                  long drawable,
                                                  int transparency) {
-        int depth = transparency > Transparency.OPAQUE ? 32 : 24;
+        int depth;
+        // If we have a 32 bit color model for the window it needs
+        // alpha to support translucency of the window so we need
+        //  to upgrade what was requested for the surface.
+        if (gc.getColorModel().getPixelSize() == 32) {
+           depth = 32;
+           transparency = Transparency.TRANSLUCENT;
+        } else {
+            depth = transparency > Transparency.OPAQUE ? 32 : 24;
+        }
+
         if (depth == 24) {
             cm = new DirectColorModel(depth,
                                       0x00FF0000, 0x0000FF00, 0x000000FF);