From fdff41f71103f45a75fa6b8a51616b8bba7f16c2 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Wed, 17 Jun 2009 21:13:04 +0100 Subject: [PATCH] 6851515: awt_p.h incorporates a chunk of the XRender header Use XRender header directly rather than copying chunks locally Reviewed-by: anthony, ohair --- .../solaris/native/sun/awt/awt_GraphicsEnv.c | 8 ++-- jdk/src/solaris/native/sun/awt/awt_p.h | 41 +------------------ 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c index f9095c3822c..7afdf1681c6 100644 --- a/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c +++ b/jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c @@ -337,7 +337,7 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) { 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 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) { #endif if (xrenderLibHandle != NULL) { - XRenderFindVisualFormat = + xrenderFindVisualFormat = (XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle, "XRenderFindVisualFormat"); } @@ -454,8 +454,8 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) { 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 && diff --git a/jdk/src/solaris/native/sun/awt/awt_p.h b/jdk/src/solaris/native/sun/awt/awt_p.h index b0959357087..fc233fe1686 100644 --- a/jdk/src/solaris/native/sun/awt/awt_p.h +++ b/jdk/src/solaris/native/sun/awt/awt_p.h @@ -48,6 +48,7 @@ #include #include #include +#include #ifndef XAWT #include #include @@ -120,48 +121,8 @@ typedef struct _DamageRect { #ifndef HEADLESS -/* Note: until we include the 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;