Commit ac8b3dc1 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Set bits within visual->depth that aren't used for color to 1s, in case

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.
parent 0edc5cc8
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):
......
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):
......
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):
......
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):
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment