XftFontDescription.st
branchjv
changeset 7077 8827f34a4667
parent 7072 2757f8f81f72
parent 7075 87f313919ab2
child 7097 2ecb576ab013
--- a/XftFontDescription.st	Sat Nov 21 06:50:43 2015 +0100
+++ b/XftFontDescription.st	Fri Nov 27 23:21:37 2015 +0000
@@ -616,7 +616,7 @@
      clipOrg clipCorn clipRect clipX clipY clipW clipH clipPnt
      fg fgR fgG fgB fgA fgPixel bg bgR bgG bgB bgA bgPixel
      drawX drawY drawPnt displayId screen drawableId error stringLen drawId drawIdIsShared
-     newXftDrawId newDrawableAssociation isPixmap|
+     newXftDrawId newDrawableAssociation pixmapDepth|
                                              
     "limit the string len, otherwise bad output is generated"
     stringLen := index2Arg - index1 + 1.
@@ -690,7 +690,9 @@
     ].
     screen := device screen.
     drawableId := aGC drawableId.
-    isPixmap := aGC isForm.
+    aGC isForm ifTrue:[
+        pixmapDepth := aGC depth.
+    ].
     aGC addDependent:self.      "I need to be informed, when the GC is destroyed"
 
     aGC class == XGraphicsContext ifTrue:[
@@ -699,9 +701,15 @@
         drawIdIsShared := false.
         drawId isNil ifTrue:[
 %{
-            if (isPixmap == true) {
-                drawId = XFT_DRAW_HANDLE_NEW ( XftDrawCreateBitmap ( DISPLAY( displayId ) ,
-                                               DRAWABLE( drawableId ) ) );            
+            if (pixmapDepth != nil) {
+                int __pixmapDepth = __intVal(pixmapDepth);
+                if (__pixmapDepth == 1) {      
+                    drawId = XFT_DRAW_HANDLE_NEW ( XftDrawCreateBitmap ( DISPLAY( displayId ) ,
+                                                   DRAWABLE( drawableId ) ) );           
+                } else {
+                    drawId = XFT_DRAW_HANDLE_NEW ( XftDrawCreateAlpha ( DISPLAY( displayId ) ,
+                                                   DRAWABLE( drawableId ), __pixmapDepth) );                      
+                }
             } else {
                 drawId = XFT_DRAW_HANDLE_NEW ( XftDrawCreate ( DISPLAY( displayId ) ,
                                                DRAWABLE( drawableId ) ,
@@ -742,9 +750,15 @@
 
     if (drawIdIsShared == true) {
     if (__INST(sharedDrawId) == nil) {
-        if (isPixmap == true) {
-            __sharedDrawId = XFT_DRAW_HANDLE_NEW ( XftDrawCreateBitmap ( DISPLAY( displayId ) ,
-                                                   DRAWABLE( drawableId ) ) );            
+       if (pixmapDepth != nil) {
+            int __pixmapDepth = __intVal(pixmapDepth);
+            if (__pixmapDepth == 1) {      
+                __sharedDrawId =  XftDrawCreateBitmap ( DISPLAY( displayId ) ,
+                                               DRAWABLE( drawableId ) );           
+            } else {
+                __sharedDrawId =  XftDrawCreateAlpha ( DISPLAY( displayId ) ,
+                                               DRAWABLE( drawableId ), __pixmapDepth);                      
+            }          
         } else {
             __sharedDrawId = XftDrawCreate(DISPLAY(displayId),
                                            DRAWABLE(drawableId),
@@ -832,7 +846,7 @@
         goto err;
     }
 
-    if (isPixmap == true) {
+    if (pixmapDepth != nil) {
         XftDrawDestroy(__sharedDrawId);
     }