提交 d4aed30b 编写于 作者: C ceisserer

6974985: Jave2Demo threw exceptions when xrender enabled in OEL5.5

Reviewed-by: prr
上级 81c723ed
...@@ -424,6 +424,7 @@ SUNWprivate_1.1 { ...@@ -424,6 +424,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_xr_XRSurfaceData_initXRPicture; Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
Java_sun_java2d_xr_XRSurfaceData_initIDs; Java_sun_java2d_xr_XRSurfaceData_initIDs;
Java_sun_java2d_xr_XRSurfaceData_XRInitSurface; Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
Java_sun_java2d_xr_XRBackendNative_initIDs; Java_sun_java2d_xr_XRBackendNative_initIDs;
Java_sun_java2d_xr_XIDGenerator_bufferXIDs; Java_sun_java2d_xr_XIDGenerator_bufferXIDs;
Java_sun_java2d_xr_XRBackendNative_freeGC; Java_sun_java2d_xr_XRBackendNative_freeGC;
......
...@@ -374,6 +374,7 @@ SUNWprivate_1.1 { ...@@ -374,6 +374,7 @@ SUNWprivate_1.1 {
Java_sun_java2d_xr_XRSurfaceData_initXRPicture; Java_sun_java2d_xr_XRSurfaceData_initXRPicture;
Java_sun_java2d_xr_XRSurfaceData_initIDs; Java_sun_java2d_xr_XRSurfaceData_initIDs;
Java_sun_java2d_xr_XRSurfaceData_XRInitSurface; Java_sun_java2d_xr_XRSurfaceData_XRInitSurface;
Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture;
Java_sun_java2d_xr_XRBackendNative_initIDs; Java_sun_java2d_xr_XRBackendNative_initIDs;
Java_sun_java2d_xr_XRBackendNative_freeGC; Java_sun_java2d_xr_XRBackendNative_freeGC;
Java_sun_java2d_xr_XRBackendNative_createGC; Java_sun_java2d_xr_XRBackendNative_createGC;
......
...@@ -55,6 +55,8 @@ public abstract class XRSurfaceData extends XSurfaceData { ...@@ -55,6 +55,8 @@ public abstract class XRSurfaceData extends XSurfaceData {
native void initXRPicture(long xsdo, int pictForm); native void initXRPicture(long xsdo, int pictForm);
native void freeXSDOPicture(long xsdo);
public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap"; public static final String DESC_BYTE_A8_X11 = "Byte A8 Pixmap";
public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap"; public static final String DESC_INT_RGB_X11 = "Integer RGB Pixmap";
public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap"; public static final String DESC_INT_ARGB_X11 = "Integer ARGB-Pre Pixmap";
...@@ -531,6 +533,17 @@ public abstract class XRSurfaceData extends XSurfaceData { ...@@ -531,6 +533,17 @@ public abstract class XRSurfaceData extends XSurfaceData {
public Object getDestination() { public Object getDestination() {
return peer.getTarget(); return peer.getTarget();
} }
public void invalidate() {
try {
SunToolkit.awtLock();
freeXSDOPicture(getNativeOps());
}finally {
SunToolkit.awtUnlock();
}
super.invalidate();
}
} }
public static class XRInternalSurfaceData extends XRSurfaceData { public static class XRInternalSurfaceData extends XRSurfaceData {
......
...@@ -375,6 +375,12 @@ X11SD_Dispose(JNIEnv *env, SurfaceDataOps *ops) ...@@ -375,6 +375,12 @@ X11SD_Dispose(JNIEnv *env, SurfaceDataOps *ops)
AWT_LOCK(); AWT_LOCK();
xsdo->invalid = JNI_TRUE; xsdo->invalid = JNI_TRUE;
if (xsdo->xrPic != None) {
XRenderFreePicture(awt_display, xsdo->xrPic);
xsdo->xrPic = None;
}
if (xsdo->isPixmap == JNI_TRUE && xsdo->drawable != 0) { if (xsdo->isPixmap == JNI_TRUE && xsdo->drawable != 0) {
#ifdef MITSHM #ifdef MITSHM
if (xsdo->shmPMData.shmSegInfo != NULL) { if (xsdo->shmPMData.shmSegInfo != NULL) {
......
...@@ -114,3 +114,26 @@ Java_sun_java2d_xr_XRSurfaceData_XRInitSurface(JNIEnv *env, jclass xsd, ...@@ -114,3 +114,26 @@ Java_sun_java2d_xr_XRSurfaceData_XRInitSurface(JNIEnv *env, jclass xsd,
XShared_initSurface(env, xsdo, depth, width, height, drawable); XShared_initSurface(env, xsdo, depth, width, height, drawable);
#endif /* !HEADLESS */ #endif /* !HEADLESS */
} }
JNIEXPORT void JNICALL
Java_sun_java2d_xr_XRSurfaceData_freeXSDOPicture(JNIEnv *env, jobject xsd,
jlong pXSData)
{
#ifndef HEADLESS
X11SDOps *xsdo;
J2dTraceLn(J2D_TRACE_INFO, "in XRSurfaceData_freeXSDOPicture");
xsdo = X11SurfaceData_GetOps(env, xsd);
if (xsdo == NULL) {
return;
}
if(xsdo->xrPic != None) {
XRenderFreePicture(awt_display, xsdo->xrPic);
xsdo->xrPic = None;
}
#endif /* !HEADLESS */
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册