JDK-6538863 : GUI apps throw sun.java2d.InvalidPipeException on Windows with 30-bit desktop depth
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u2
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-03-26
  • Updated: 2010-10-15
  • Resolved: 2007-03-28
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u2 b01Fixed 7Resolved
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 http://javaweb.sfbay/jcg/6u2/2D/6538863/
27-03-2007

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) {
26-03-2007

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.
26-03-2007

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)
26-03-2007