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) {
|
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.
|