Commit af1f5609 authored by Matthias Clasen's avatar Matthias Clasen

Changes to support depth 8 StaticColor visuals. (#81631)

	* gdk/gdkrgb.c (gdk_rgb_try_colormap):
	(gdk_rgb_create_info):
	(gdk_rgb_select_conv):
	(gdk_draw_gray_image):
	(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
	visuals.  (#81631)
	(gdk_rgb_cmap_free): Don't loop forever.
parent f10cd573
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
2002-08-10 Matthias Clasen <maclas@gmx.de>
* gdk/gdkrgb.c (gdk_rgb_try_colormap):
(gdk_rgb_create_info):
(gdk_rgb_select_conv):
(gdk_draw_gray_image):
(gdk_rgb_cmap_get_info): Changes to support depth 8 StaticColor
visuals. (#81631)
(gdk_rgb_cmap_free): Don't loop forever.
Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com> Fri Aug 9 08:04:47 2002 Owen Taylor <otaylor@redhat.com>
* gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix * gdk/gdkdisplay.h (struct _GdkDisplayClass): Fix
......
...@@ -272,7 +272,8 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force, ...@@ -272,7 +272,8 @@ gdk_rgb_try_colormap (GdkRgbInfo *image_info, gboolean force,
} }
#endif #endif
if (colors_needed) if (colors_needed &&
image_info->visual->type != GDK_VISUAL_STATIC_COLOR)
{ {
if (!gdk_colors_alloc (cmap, 0, NULL, 0, junk, colors_needed)) if (!gdk_colors_alloc (cmap, 0, NULL, 0, junk, colors_needed))
{ {
...@@ -642,7 +643,8 @@ gdk_rgb_create_info (GdkVisual *visual, GdkColormap *colormap) ...@@ -642,7 +643,8 @@ gdk_rgb_create_info (GdkVisual *visual, GdkColormap *colormap)
gdk_rgb_colorcube_222 (image_info); gdk_rgb_colorcube_222 (image_info);
} }
else if (image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR) else if (image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR
|| image_info->visual->type == GDK_VISUAL_STATIC_COLOR)
{ {
if (!image_info->cmap && if (!image_info->cmap &&
(gdk_rgb_install_cmap || image_info->visual != gdk_screen_get_system_visual (screen))) (gdk_rgb_install_cmap || image_info->visual != gdk_screen_get_system_visual (screen)))
...@@ -2999,6 +3001,7 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info) ...@@ -2999,6 +3001,7 @@ gdk_rgb_select_conv (GdkRgbInfo *image_info)
depth <= 8 && depth <= 8 &&
depth > 4 && depth > 4 &&
(vtype == GDK_VISUAL_PSEUDO_COLOR (vtype == GDK_VISUAL_PSEUDO_COLOR
|| vtype == GDK_VISUAL_STATIC_COLOR
#ifdef ENABLE_GRAYSCALE #ifdef ENABLE_GRAYSCALE
|| vtype == GDK_VISUAL_GRAYSCALE || vtype == GDK_VISUAL_GRAYSCALE
#endif #endif
...@@ -3324,6 +3327,7 @@ gdk_draw_gray_image (GdkDrawable *drawable, ...@@ -3324,6 +3327,7 @@ gdk_draw_gray_image (GdkDrawable *drawable,
if (image_info->bpp == 1 && if (image_info->bpp == 1 &&
image_info->gray_cmap == NULL && image_info->gray_cmap == NULL &&
(image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR || (image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR ||
image_info->visual->type == GDK_VISUAL_STATIC_COLOR ||
image_info->visual->type == GDK_VISUAL_GRAYSCALE)) image_info->visual->type == GDK_VISUAL_GRAYSCALE))
gdk_rgb_make_gray_cmap (image_info); gdk_rgb_make_gray_cmap (image_info);
...@@ -3347,9 +3351,10 @@ gdk_rgb_cmap_get_info (GdkRgbCmap *cmap, ...@@ -3347,9 +3351,10 @@ gdk_rgb_cmap_get_info (GdkRgbCmap *cmap,
int i, j; int i, j;
guint32 rgb; guint32 rgb;
/* We only need a LUT for pseudo-color and grayscale cmaps */ /* We don't need a LUT for TrueColor or DirectColor visuals */
if (image_info->bpp != 1 || if (image_info->bpp != 1 ||
!(image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR || !(image_info->visual->type == GDK_VISUAL_PSEUDO_COLOR ||
image_info->visual->type == GDK_VISUAL_STATIC_COLOR ||
image_info->visual->type == GDK_VISUAL_GRAYSCALE)) image_info->visual->type == GDK_VISUAL_GRAYSCALE))
return NULL; return NULL;
...@@ -3413,6 +3418,7 @@ gdk_rgb_cmap_free (GdkRgbCmap *cmap) ...@@ -3413,6 +3418,7 @@ gdk_rgb_cmap_free (GdkRgbCmap *cmap)
GdkRgbCmapInfo *cmap_info = tmp_list->data; GdkRgbCmapInfo *cmap_info = tmp_list->data;
cmap_info->image_info->cmap_info_list = g_slist_remove (cmap_info->image_info->cmap_info_list, cmap_info); cmap_info->image_info->cmap_info_list = g_slist_remove (cmap_info->image_info->cmap_info_list, cmap_info);
g_free (cmap_info); g_free (cmap_info);
tmp_list = tmp_list->next;
} }
g_slist_free (cmap->info_list); g_slist_free (cmap->info_list);
......
Markdown is supported
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