changeset 1281:2a526ccd12e8

6851515: awt_p.h incorporates a chunk of the XRender header Summary: Use XRender header directly rather than copying chunks locally Reviewed-by: anthony, ohair
author andrew
date Wed, 17 Jun 2009 21:13:04 +0100
parents 0e441c781cdc
children 45316d7cc9dc 49e7d22262a9
files src/solaris/native/sun/awt/awt_GraphicsEnv.c src/solaris/native/sun/awt/awt_p.h
diffstat 2 files changed, 5 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Tue Jun 16 00:37:39 2009 -0700
+++ b/src/solaris/native/sun/awt/awt_GraphicsEnv.c	Wed Jun 17 21:13:04 2009 +0100
@@ -337,7 +337,7 @@
     char errmsg[128];
     int xinawareScreen;
     void* xrenderLibHandle = NULL;
-    XRenderFindVisualFormatFunc *XRenderFindVisualFormat = NULL;
+    XRenderFindVisualFormatFunc* xrenderFindVisualFormat = NULL;
     int major_opcode, first_event, first_error;
 
     if (usingXinerama) {
@@ -435,7 +435,7 @@
 #endif
 
         if (xrenderLibHandle != NULL) {
-            XRenderFindVisualFormat =
+            xrenderFindVisualFormat =
                 (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle,
                                                     "XRenderFindVisualFormat");
         }
@@ -454,8 +454,8 @@
         graphicsConfigs [ind]->awt_depth = pVITrue [i].depth;
         memcpy (&graphicsConfigs [ind]->awt_visInfo, &pVITrue [i],
                 sizeof (XVisualInfo));
-       if (XRenderFindVisualFormat != NULL) {
-            XRenderPictFormat *format = XRenderFindVisualFormat (awt_display,
+       if (xrenderFindVisualFormat != NULL) {
+            XRenderPictFormat *format = xrenderFindVisualFormat (awt_display,
                     pVITrue [i].visual);
             if (format &&
                 format->type == PictTypeDirect &&
--- a/src/solaris/native/sun/awt/awt_p.h	Tue Jun 16 00:37:39 2009 -0700
+++ b/src/solaris/native/sun/awt/awt_p.h	Wed Jun 17 21:13:04 2009 +0100
@@ -48,6 +48,7 @@
 #include <X11/Xatom.h>
 #include <X11/keysym.h>
 #include <X11/keysymdef.h>
+#include <X11/extensions/Xrender.h>
 #ifndef XAWT
 #include <Xm/CascadeB.h>
 #include <Xm/DrawingA.h>
@@ -120,48 +121,8 @@
 
 #ifndef HEADLESS
 
-/* Note: until we include the <X11/extensions/Xrender.h> explicitly
- * we have to define a couple of things ourselves.
- */
-typedef unsigned long   PictFormat;
-#define PictTypeIndexed             0
-#define PictTypeDirect              1
-
-typedef struct {
-    short   red;
-    short   redMask;
-    short   green;
-    short   greenMask;
-    short   blue;
-    short   blueMask;
-    short   alpha;
-    short   alphaMask;
-} XRenderDirectFormat;
-
-typedef struct {
-    PictFormat      id;
-    int         type;
-    int         depth;
-    XRenderDirectFormat direct;
-    Colormap        colormap;
-} XRenderPictFormat;
-
-#define PictFormatID        (1 << 0)
-#define PictFormatType      (1 << 1)
-#define PictFormatDepth     (1 << 2)
-#define PictFormatRed       (1 << 3)
-#define PictFormatRedMask   (1 << 4)
-#define PictFormatGreen     (1 << 5)
-#define PictFormatGreenMask (1 << 6)
-#define PictFormatBlue      (1 << 7)
-#define PictFormatBlueMask  (1 << 8)
-#define PictFormatAlpha     (1 << 9)
-#define PictFormatAlphaMask (1 << 10)
-#define PictFormatColormap  (1 << 11)
-
 typedef XRenderPictFormat *
 XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
-/* END OF Xrender.h chunk */
 
 typedef struct _AwtGraphicsConfigData  {
     int         awt_depth;