jdk/src/solaris/native/sun/awt/awt_GraphicsEnv.c
changeset 2758 d2fbe9b5857a
parent 2451 597df8e1d786
child 2760 f038acdbdf9c
equal deleted inserted replaced
2686:b44f05654c26 2758:d2fbe9b5857a
   352     XCloseDisplay(awt_display);
   352     XCloseDisplay(awt_display);
   353     awt_display = NULL;
   353     awt_display = NULL;
   354     return NULL;
   354     return NULL;
   355 }
   355 }
   356 
   356 
   357 /* Note: until we include the <X11/extensions/Xrender.h> explicitly
       
   358  * we have to define a couple of things ourselves.
       
   359  */
       
   360 typedef unsigned long   PictFormat;
       
   361 #define PictTypeIndexed             0
       
   362 #define PictTypeDirect              1
       
   363 
       
   364 typedef struct {
       
   365     short   red;
       
   366     short   redMask;
       
   367     short   green;
       
   368     short   greenMask;
       
   369     short   blue;
       
   370     short   blueMask;
       
   371     short   alpha;
       
   372     short   alphaMask;
       
   373 } XRenderDirectFormat;
       
   374 
       
   375 typedef struct {
       
   376     PictFormat      id;
       
   377     int         type;
       
   378     int         depth;
       
   379     XRenderDirectFormat direct;
       
   380     Colormap        colormap;
       
   381 } XRenderPictFormat;
       
   382 
       
   383 #define PictFormatID        (1 << 0)
       
   384 #define PictFormatType      (1 << 1)
       
   385 #define PictFormatDepth     (1 << 2)
       
   386 #define PictFormatRed       (1 << 3)
       
   387 #define PictFormatRedMask   (1 << 4)
       
   388 #define PictFormatGreen     (1 << 5)
       
   389 #define PictFormatGreenMask (1 << 6)
       
   390 #define PictFormatBlue      (1 << 7)
       
   391 #define PictFormatBlueMask  (1 << 8)
       
   392 #define PictFormatAlpha     (1 << 9)
       
   393 #define PictFormatAlphaMask (1 << 10)
       
   394 #define PictFormatColormap  (1 << 11)
       
   395 
       
   396 typedef XRenderPictFormat *
       
   397 XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
       
   398 
       
   399 static void
   357 static void
   400 getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
   358 getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
   401 
   359 
   402     int i;
   360     int i;
   403     int n8p=0, n12p=0, n8s=0, n8gs=0, n8sg=0, n1sg=0, nTrue=0;
   361     int n8p=0, n12p=0, n8s=0, n8gs=0, n8sg=0, n1sg=0, nTrue=0;
   533             if (format &&
   491             if (format &&
   534                 format->type == PictTypeDirect &&
   492                 format->type == PictTypeDirect &&
   535                 format->direct.alphaMask)
   493                 format->direct.alphaMask)
   536             {
   494             {
   537                 graphicsConfigs [ind]->isTranslucencySupported = 1;
   495                 graphicsConfigs [ind]->isTranslucencySupported = 1;
       
   496                 memcpy(&graphicsConfigs [ind]->renderPictFormat, format,
       
   497                         sizeof(*format));
   538             }
   498             }
   539         }
   499         }
   540     }
   500     }
   541 
   501 
   542     if (xrenderLibHandle != NULL) {
   502     if (xrenderLibHandle != NULL) {