提交 9bddb80a 编写于 作者: P pchelko

8046884: JNI exception pending in jdk/src/solaris/native/sun/java2d/x11:...

8046884: JNI exception pending in jdk/src/solaris/native/sun/java2d/x11: X11PMPLitLoops.c, X11SurfaceData.c
Reviewed-by: prr, serb
上级 b9859a05
...@@ -241,9 +241,12 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask ...@@ -241,9 +241,12 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
width, height, 1); width, height, 1);
if (xsdo->bitmask == 0) { if (xsdo->bitmask == 0) {
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowOutOfMemoryError(env, if (!(*env)->ExceptionCheck(env))
"Cannot create bitmask for " {
"offscreen surface"); JNU_ThrowOutOfMemoryError(env,
"Cannot create bitmask for "
"offscreen surface");
}
return; return;
} }
} }
...@@ -253,7 +256,10 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask ...@@ -253,7 +256,10 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
1, XYBitmap, 0, NULL, width, height, 32, 0); 1, XYBitmap, 0, NULL, width, height, 32, 0);
if (image == NULL) { if (image == NULL) {
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); if (!(*env)->ExceptionCheck(env))
{
JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
}
return; return;
} }
dstScan = image->bytes_per_line; dstScan = image->bytes_per_line;
...@@ -261,7 +267,10 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask ...@@ -261,7 +267,10 @@ Java_sun_java2d_x11_X11PMBlitLoops_updateBitmask
if (image->data == NULL) { if (image->data == NULL) {
XFree(image); XFree(image);
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask"); if (!(*env)->ExceptionCheck(env))
{
JNU_ThrowOutOfMemoryError(env, "Cannot allocate bitmask for mask");
}
return; return;
} }
pDst = (unsigned char *)image->data; pDst = (unsigned char *)image->data;
......
...@@ -454,6 +454,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width ...@@ -454,6 +454,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
AWT_LOCK(); AWT_LOCK();
xsdo->drawable = X11SD_CreateSharedPixmap(xsdo); xsdo->drawable = X11SD_CreateSharedPixmap(xsdo);
AWT_UNLOCK(); AWT_UNLOCK();
JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
if (xsdo->drawable) { if (xsdo->drawable) {
xsdo->shmPMData.usingShmPixmap = JNI_TRUE; xsdo->shmPMData.usingShmPixmap = JNI_TRUE;
xsdo->shmPMData.shmPixmap = xsdo->drawable; xsdo->shmPMData.shmPixmap = xsdo->drawable;
...@@ -469,6 +470,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width ...@@ -469,6 +470,7 @@ jboolean XShared_initSurface(JNIEnv *env, X11SDOps *xsdo, jint depth, jint width
xsdo->configData->awt_visInfo.screen), xsdo->configData->awt_visInfo.screen),
width, height, depth); width, height, depth);
AWT_UNLOCK(); AWT_UNLOCK();
JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE);
#ifdef MITSHM #ifdef MITSHM
xsdo->shmPMData.usingShmPixmap = JNI_FALSE; xsdo->shmPMData.usingShmPixmap = JNI_FALSE;
xsdo->shmPMData.pixmap = xsdo->drawable; xsdo->shmPMData.pixmap = xsdo->drawable;
...@@ -504,6 +506,7 @@ Java_sun_java2d_x11_X11SurfaceData_initSurface(JNIEnv *env, jclass xsd, ...@@ -504,6 +506,7 @@ Java_sun_java2d_x11_X11SurfaceData_initSurface(JNIEnv *env, jclass xsd,
if (xsdo->configData->awt_cmap == (Colormap)NULL) { if (xsdo->configData->awt_cmap == (Colormap)NULL) {
awtJNI_CreateColorData(env, xsdo->configData, 1); awtJNI_CreateColorData(env, xsdo->configData, 1);
JNU_CHECK_EXCEPTION(env);
} }
/* color_data will be initialized in awtJNI_CreateColorData for /* color_data will be initialized in awtJNI_CreateColorData for
8-bit visuals */ 8-bit visuals */
...@@ -805,7 +808,10 @@ static jint X11SD_Lock(JNIEnv *env, ...@@ -805,7 +808,10 @@ static jint X11SD_Lock(JNIEnv *env,
xsdo->cData->awt_icmLUT == NULL)) xsdo->cData->awt_icmLUT == NULL))
{ {
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowNullPointerException(env, "colormap lookup table"); if (!(*env)->ExceptionCheck(env))
{
JNU_ThrowNullPointerException(env, "colormap lookup table");
}
return SD_FAILURE; return SD_FAILURE;
} }
if ((lockflags & SD_LOCK_INVCOLOR) != 0 && if ((lockflags & SD_LOCK_INVCOLOR) != 0 &&
...@@ -816,7 +822,10 @@ static jint X11SD_Lock(JNIEnv *env, ...@@ -816,7 +822,10 @@ static jint X11SD_Lock(JNIEnv *env,
xsdo->cData->img_oda_blue == NULL)) xsdo->cData->img_oda_blue == NULL))
{ {
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowNullPointerException(env, "inverse colormap lookup table"); if (!(*env)->ExceptionCheck(env))
{
JNU_ThrowNullPointerException(env, "inverse colormap lookup table");
}
return SD_FAILURE; return SD_FAILURE;
} }
if ((lockflags & SD_LOCK_INVGRAY) != 0 && if ((lockflags & SD_LOCK_INVGRAY) != 0 &&
...@@ -824,7 +833,10 @@ static jint X11SD_Lock(JNIEnv *env, ...@@ -824,7 +833,10 @@ static jint X11SD_Lock(JNIEnv *env,
xsdo->cData->pGrayInverseLutData == NULL)) xsdo->cData->pGrayInverseLutData == NULL))
{ {
AWT_UNLOCK(); AWT_UNLOCK();
JNU_ThrowNullPointerException(env, "inverse gray lookup table"); if (!(*env)->ExceptionCheck(env))
{
JNU_ThrowNullPointerException(env, "inverse gray lookup table");
}
return SD_FAILURE; return SD_FAILURE;
} }
if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) { if (xsdo->dgaAvailable && (lockflags & (SD_LOCK_RD_WR))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册