6857592: Getting warning while moving or resizing the frame when component.printAll() is called on local JNI

Reviewed-by: bae, flar
This commit is contained in:
Phil Race 2011-02-18 09:14:07 -08:00
parent f1c2d419cb
commit e640a52207

@ -107,8 +107,16 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
// could retain their own DIB info and we would not need to
// recreate it every time.
// GetRasInfo implicitly calls GetPrimitiveArrayCritical
// and since GetDC uses JNI it needs to be called first.
HDC hDC = dstOps->GetDC(env, dstOps, 0, NULL, clip, NULL, 0);
if (hDC == NULL) {
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
return;
}
srcOps->GetRasInfo(env, srcOps, &srcInfo);
if (srcInfo.rasBase == NULL) {
dstOps->ReleaseDC(env, dstOps, hDC);
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
return;
}
@ -174,13 +182,6 @@ Java_sun_java2d_windows_GDIBlitLoops_nativeBlit
bmi.colors.dwMasks[2] = bmask;
}
HDC hDC = dstOps->GetDC(env, dstOps, 0, NULL, clip, NULL, 0);
if (hDC == NULL) {
SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
return;
}
if (fastBlt) {
// Window could go away at any time, leaving bits on the screen
// from this GDI call, so make sure window still exists