changeset 7692:2978c0a543ed

7196866: CTW fails on all Solaris platforms Reviewed-by: prr, jrose, twisti, kvn
author prr
date Mon, 22 Jul 2013 12:52:15 -0700
parents dead66347eca
children 784589c7bc55
files src/solaris/native/sun/awt/awt_GraphicsEnv.c src/solaris/native/sun/java2d/x11/XRBackendNative.c
diffstat 2 files changed, 15 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Jul 10 11:49:04 2013 -0700
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Mon Jul 22 12:52:15 2013 -0700
@@ -926,6 +926,11 @@
     *shmExt = canUseShmExt = CANT_USE_MITSHM;
     *shmPixmaps = canUseShmExtPixmaps = CANT_USE_MITSHM;
 
+    if (awt_display == (Display *)NULL) {
+        AWT_NOFLUSH_UNLOCK();
+        return;
+    }
+
     /**
      * XShmQueryExtension returns False in remote server case.
      * Unfortunately it also returns True in ssh case, so
--- a/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Wed Jul 10 11:49:04 2013 -0700
+++ b/src/solaris/native/sun/java2d/x11/XRBackendNative.c	Mon Jul 22 12:52:15 2013 -0700
@@ -267,13 +267,19 @@
     char *maskData;
     XImage* defaultImg;
     jfieldID maskImgID;
-    jlong fmt8 =
-        ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardA8));
-    jlong fmt32 =
-       ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardARGB32));
+    jlong fmt8;
+    jlong fmt32;
+
     jfieldID a8ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_A8", "J");
     jfieldID argb32ID = (*env)->GetStaticFieldID(env, cls, "FMTPTR_ARGB32", "J");
 
+    if (awt_display == (Display *)NULL) {
+        return;
+    }
+
+    fmt8 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardA8));
+    fmt32 = ptr_to_jlong(XRenderFindStandardFormat(awt_display, PictStandardARGB32));
+
     (*env)->SetStaticLongField(env, cls, a8ID, fmt8);
     (*env)->SetStaticLongField(env, cls, argb32ID, fmt32);