提交 0ce605c9 编写于 作者: J jchen

8025294: [parfait] JNI-related warnings from b107 for jdk.src.solaris.native.sun.java2d.x11

Reviewed-by: prr, jgodinez
上级 6a31b16a
......@@ -465,9 +465,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_x11_X11Renderer_XDrawPoly
points = transformPoints(env, xcoordsArray, ycoordsArray, transx, transy,
pTmp, (int *)&npoints, isclosed);
if (points == 0) {
JNU_ThrowOutOfMemoryError(env, "translated coordinate array");
} else {
if (points != 0) {
if (npoints == 2) {
/*
* Some X11 implementations fail to draw anything for
......@@ -588,6 +586,7 @@ Java_sun_java2d_x11_X11Renderer_XDoPath
NULL
};
PHStroke stroke;
jboolean ok = JNI_TRUE;
if (xsdo == NULL) {
return;
......@@ -625,8 +624,6 @@ Java_sun_java2d_x11_X11Renderer_XDoPath
types = (jbyte*)
(*env)->GetPrimitiveArrayCritical(env, typesArray, NULL);
if (types != NULL) {
jboolean ok;
if (isFill) {
drawHandler.pDrawScanline = &drawScanline;
ok = doFillPath(&drawHandler,
......@@ -643,14 +640,14 @@ Java_sun_java2d_x11_X11Renderer_XDoPath
types, numTypes,
stroke);
}
if (!ok) {
JNU_ThrowArrayIndexOutOfBoundsException(env, "coords array");
}
(*env)->ReleasePrimitiveArrayCritical(env, typesArray, types,
JNI_ABORT);
}
(*env)->ReleasePrimitiveArrayCritical(env, coordsArray, coords,
JNI_ABORT);
if (!ok) {
JNU_ThrowArrayIndexOutOfBoundsException(env, "coords array");
}
}
XDHD_FREE_POINTS(&dHData);
......@@ -893,9 +890,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_x11_X11Renderer_XFillPoly
points = transformPoints(env, xcoordsArray, ycoordsArray, transx, transy,
pTmp, (int *)&npoints, JNI_FALSE);
if (points == 0) {
JNU_ThrowOutOfMemoryError(env, "translated coordinate array");
} else {
if (points != 0) {
if (npoints > 2) {
XFillPolygon(awt_display, xsdo->drawable, (GC) xgc,
points, npoints, Complex, CoordModeOrigin);
......
......@@ -227,7 +227,7 @@ Java_sun_java2d_x11_X11SurfaceData_isShmPMAvailable(JNIEnv *env, jobject this)
#if defined(HEADLESS) || !defined(MITSHM)
return JNI_FALSE;
#else
return useMitShmPixmaps;
return (jboolean)useMitShmPixmaps;
#endif /* HEADLESS, MITSHM */
}
......@@ -258,6 +258,7 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
{
#ifndef HEADLESS
X11SDOps *xsdo = (X11SDOps*)SurfaceData_InitOps(env, xsd, sizeof(X11SDOps));
jboolean hasException;
if (xsdo == NULL) {
JNU_ThrowOutOfMemoryError(env, "Initialization of SurfaceData failed.");
return;
......@@ -270,7 +271,10 @@ Java_sun_java2d_x11_XSurfaceData_initOps(JNIEnv *env, jobject xsd,
xsdo->ReleasePixmapWithBg = X11SD_ReleasePixmapWithBg;
xsdo->widget = NULL;
if (peer != NULL) {
xsdo->drawable = JNU_CallMethodByName(env, NULL, peer, "getWindow", "()J").j;
xsdo->drawable = JNU_CallMethodByName(env, &hasException, peer, "getWindow", "()J").j;
if (hasException) {
return;
}
} else {
xsdo->drawable = 0;
}
......
......@@ -326,7 +326,13 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) {
jlong fmt32;
jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J");
if (a8ID == NULL) {
return;
}
jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J");
if (argb32ID == NULL) {
return;
}
if (awt_display == (Display *)NULL) {
return;
......@@ -346,6 +352,10 @@ Java_sun_java2d_xr_XRBackendNative_initIDs(JNIEnv *env, jclass cls) {
defaultImg = XCreateImage(awt_display, NULL, 8, ZPixmap, 0, maskData, 32, 32, 8, 0);
defaultImg->data = maskData; //required?
maskImgID = (*env)->GetStaticFieldID(env, cls, "MASK_XIMG", "J");
if (maskImgID == NULL) {
return;
}
(*env)->SetStaticLongField(env, cls, maskImgID, ptr_to_jlong(defaultImg));
}
......
......@@ -88,7 +88,13 @@ Java_sun_java2d_xr_XRSurfaceData_initIDs(JNIEnv *env, jclass xsd)
J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_initIDs");
pictID = (*env)->GetFieldID(env, xsd, "picture", "I");
if (pictID == NULL) {
return;
}
xidID = (*env)->GetFieldID(env, xsd, "xid", "I");
if (xidID == NULL) {
return;
}
XShared_initIDs(env, JNI_FALSE);
#endif /* !HEADLESS */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册