]> Pileus Git - ~andy/gtk/commitdiff
Set bits within visual->depth that aren't used for color to 1s, in case
authorOwen Taylor <otaylor@redhat.com>
Thu, 27 May 2004 20:46:58 +0000 (20:46 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 27 May 2004 20:46:58 +0000 (20:46 +0000)
Thu May 27 16:36:22 2004  Owen Taylor  <otaylor@redhat.com>

        * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set
        bits within visual->depth that aren't used for color to
        1s, in case they are alpha.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gdk/x11/gdkcolor-x11.c

index 538554f41e96a43850b2784df5cfbed6ca06a2e6..8dc912f5322ad119b222cdc7f32c8c4ee652eb39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Thu May 27 16:36:22 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set
+       bits within visual->depth that aren't used for color to
+       1s, in case they are alpha.
+
 2004-05-27  Anders Carlsson  <andersca@gnome.org>
 
        * gtk/gtkfilechooserdefault.c (save_folder_combo_create): 
index 538554f41e96a43850b2784df5cfbed6ca06a2e6..8dc912f5322ad119b222cdc7f32c8c4ee652eb39 100644 (file)
@@ -1,3 +1,9 @@
+Thu May 27 16:36:22 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set
+       bits within visual->depth that aren't used for color to
+       1s, in case they are alpha.
+
 2004-05-27  Anders Carlsson  <andersca@gnome.org>
 
        * gtk/gtkfilechooserdefault.c (save_folder_combo_create): 
index 538554f41e96a43850b2784df5cfbed6ca06a2e6..8dc912f5322ad119b222cdc7f32c8c4ee652eb39 100644 (file)
@@ -1,3 +1,9 @@
+Thu May 27 16:36:22 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set
+       bits within visual->depth that aren't used for color to
+       1s, in case they are alpha.
+
 2004-05-27  Anders Carlsson  <andersca@gnome.org>
 
        * gtk/gtkfilechooserdefault.c (save_folder_combo_create): 
index 538554f41e96a43850b2784df5cfbed6ca06a2e6..8dc912f5322ad119b222cdc7f32c8c4ee652eb39 100644 (file)
@@ -1,3 +1,9 @@
+Thu May 27 16:36:22 2004  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk/x11/gdkcolor-x11.c (gdk_colormap_alloc_colors): Set
+       bits within visual->depth that aren't used for color to
+       1s, in case they are alpha.
+
 2004-05-27  Anders Carlsson  <andersca@gnome.org>
 
        * gtk/gtkfilechooserdefault.c (save_folder_combo_create): 
index 6265dcfc7a63c8e8dd0c299f396e5b4619d78837..4a0b9ebf8a79686f5532e70c8a89f38f10a87ad5 100644 (file)
@@ -1126,7 +1126,13 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
 
       for (i = 0; i < ncolors; i++)
        {
-         colors[i].pixel = (((colors[i].red >> (16 - visual->red_prec)) << visual->red_shift) +
+         /* If bits not used for color are used for something other than padding,
+          * it's likely alpha, so we set them to 1s.
+          */
+         guint32 unused = ~ (visual->red_mask | visual->green_mask | visual->blue_mask |
+                             (((~(guint32)0)) << visual->depth));
+         colors[i].pixel = (unused +
+                            ((colors[i].red >> (16 - visual->red_prec)) << visual->red_shift) +
                             ((colors[i].green >> (16 - visual->green_prec)) << visual->green_shift) +
                             ((colors[i].blue >> (16 - visual->blue_prec)) << visual->blue_shift));
          success[i] = TRUE;