From a2d1299475cb8f34f99e420ef752bf9366275bf7 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 2 Feb 2001 22:19:31 +0000 Subject: Make gdk_colormap_sync private since it was never exported in a header Fri Feb 2 17:16:09 2001 Owen Taylor * gdk/x11/gdkcolor-x11.c (gdk_colormap_sync): Make gdk_colormap_sync private since it was never exported in a header file. * gdk/x11/gdkcolor-x11.c (gdk_colormap_new): Fill in colormap->colors[] for StaticGray, StaticColor colormaps. * gdk/gdkpixbuf-drawable.c: Fix problems where image->bpp was being used as if it was image->bits_per_pixel. * gdk/gdkimage.h, gdk/x11/gdkimage-x11.c: Save the bits-per-pixel for the image in the GdkImage structure since it isn't reconstructable, and we need it to handle packed types * gdk/win32/gdkimage-win32.c: Set image->bits_per_pixel. (I'm making the assumption that on Win32 image->bits_per_pixel == image->depth, always. * gdk/linux-fb/gdkimage-fb.c: Set image->bits_per_pixel. * gdk/gdkrgb.c (gdk_rgb_select_conv): Exit with an informative warning message if no converter can be found. --- gdk/gdkpixbuf-drawable.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gdk/gdkpixbuf-drawable.c') diff --git a/gdk/gdkpixbuf-drawable.c b/gdk/gdkpixbuf-drawable.c index 776ebe6067..97539a0e5f 100644 --- a/gdk/gdkpixbuf-drawable.c +++ b/gdk/gdkpixbuf-drawable.c @@ -1078,7 +1078,7 @@ rgbconvert (GdkImage *image, GdkVisual *v = gdk_colormap_get_visual(cmap); d(printf("masks = %x:%x:%x\n", v->red_mask, v->green_mask, v->blue_mask)); - d(printf("image depth = %d, bpp = %d\n", image->depth, image->bpp)); + d(printf("image depth = %d, bits per pixel = %d\n", image->depth, image->bits_per_pixel)); switch (v->type) { @@ -1087,13 +1087,14 @@ rgbconvert (GdkImage *image, case GDK_VISUAL_GRAYSCALE: case GDK_VISUAL_STATIC_COLOR: case GDK_VISUAL_PSEUDO_COLOR: - switch (image->bpp) + switch (image->bits_per_pixel) { case 1: bank = 0; break; case 8: - bank = 1; + if (image->depth == 8) + bank = 1; break; } break; @@ -1102,18 +1103,18 @@ rgbconvert (GdkImage *image, { case 15: if (v->red_mask == 0x7c00 && v->green_mask == 0x3e0 && v->blue_mask == 0x1f - && image->bpp == 16) + && image->bits_per_pixel == 16) bank = 2; break; case 16: if (v->red_mask == 0xf800 && v->green_mask == 0x7e0 && v->blue_mask == 0x1f - && image->bpp == 16) + && image->bits_per_pixel == 16) bank = 3; break; case 24: case 32: if (v->red_mask == 0xff0000 && v->green_mask == 0xff00 && v->blue_mask == 0xff - && image->bpp == 32) + && image->bits_per_pixel == 32) bank = 4; break; } -- cgit v1.2.1