United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6538863 GUI apps throw sun.java2d.InvalidPipeException on Windows with 30-bit desktop depth
JDK-6538863 : GUI apps throw sun.java2d.InvalidPipeException on Windows with 30-bit desktop depth

Details
Type:
Bug
Submit Date:
2007-03-26
Status:
Resolved
Updated Date:
2010-10-15
Project Name:
JDK
Resolved Date:
2007-03-28
Component:
client-libs
OS:
windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P2
Resolution:
Fixed
Affected Versions:
6u2
Fixed Versions:
6u2 (b01)

Related Reports
Backport:

Sub Tasks

Description
GUI applications written in Java is DOA on Windows with 30-bit desktop depth. 
All gui applications throw the following exception and exit:
sun.java2d.InvalidPipeException: Unsupported bit depth: 30
            at sun.awt.windows.win32SurfaceData.getSurfaceType(Unknown Source)
            at sun.awt.windows.win32SurfaceData.createData(Unknown Source)
            at sun.awt.win32GraphicsConfig.createSurfaeData(Unknown Source)
            at sun.awt.windows.WComponentPeer.<init>(Unknown Source)
            at sun.awt.windows.WCanvasPeer.<init>(Unknown Source)
            at sun.awt.windows.WPanelPeer.<init>(Unknown Source)
            at sun.awt.windows.WWindowPeer.<init> (Unknown Source)
            at sun.awt.windows.WFramePeer.<init>(Unknown Source)
            at sun.awt.windows.Wtoolkit.createFrame.<init>(Unknown Source)

The 30-bit desktop depth is important in medical imaging.

                                    

Comments
SUGGESTED FIX

------- awt_Win32GraphicsDevice.cpp -------
*** /tmp/sccs.002480	Thu Mar 22 19:22:14 2007
--- awt_Win32GraphicsDevice.cpp	Thu Mar 22 18:54:14 2007
***************
*** 34,39 ****
--- 34,40 ----
  #include "img_util_md.h"
  #include "awt_dlls.h"
  #include "Devices.h"
+ #include "WindowsFlags.h"
  
  uns_ordered_dither_array img_oda_alpha;
  
***************
*** 180,186 ****
  		    ((int *)gpBitmapInfo->bmiColors)[2] = 0x0000ff;
  		    break;
  		}
! 	    }
  	    ri = ((unsigned int *)gpBitmapInfo->bmiColors)[0];
  	    colorData->rOff = 0;
  	    while ((ri & 1) == 0) {
--- 181,200 ----
  		    ((int *)gpBitmapInfo->bmiColors)[2] = 0x0000ff;
  		    break;
  		}
!             } else if (((int *)gpBitmapInfo->bmiColors)[0] == 0x3fc00000 &&
!                        ((int *)gpBitmapInfo->bmiColors)[1] == 0x000ff000 &&
!                        ((int *)gpBitmapInfo->bmiColors)[2] == 0x000003fc)
!             {
!                 // Workaround for 30-bit mode which is not yet supported
!                 J2dRlsTraceLn(J2D_TRACE_WARNING, 
!                     "Win32GraphicsDevice::Initialize(): unsupported "\
!                     "30-bit mode detected. Switching to 24-bit, disabling DD");
!                 ((int *)gpBitmapInfo->bmiColors)[0] = 0x00ff0000;
!                 ((int *)gpBitmapInfo->bmiColors)[1] = 0x0000ff00;
!                 ((int *)gpBitmapInfo->bmiColors)[2] = 0x000000ff;
!                 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
!                 SetDDEnabledFlag(env, FALSE);
!   	    }
  	    ri = ((unsigned int *)gpBitmapInfo->bmiColors)[0];
  	    colorData->rOff = 0;
  	    while ((ri & 1) == 0) {
                                     
2007-03-26
WORK AROUND

Works only if there is a single screen (which is unfortunately not
the case for most configurations in the target audience) - 
use the OpenGL pipeline (-Dsun.java2d.opengl=true)
                                     
2007-03-26
EVALUATION

To prevent the crash we need to pretend that we're running in 24-bit mode
(IntRgb) and work through GDI (which doesn't support 30-bit anyway), and 
disable the DirectDraw pipeline so that we don't have a mismatch between
DirectDraw surface depth and what we think the depth is.

The second step (will be covered by a separate bug) will be adding
full support for 30-bit. This will include adding and 
recognizing 30-bit surface type, software loops, and making sure
we do not loose the color precision when passing colors around.
                                     
2007-03-26
SUGGESTED FIX

http://javaweb.sfbay/jcg/6u2/2D/6538863/
                                     
2007-03-27



Hardware and Software, Engineered to Work Together