diff --git a/gfx/cairo/cairo/src/cairo-deprecated.h b/gfx/cairo/cairo/src/cairo-deprecated.h index 438e1d89858f..b59ea643a9c7 100644 --- a/gfx/cairo/cairo/src/cairo-deprecated.h +++ b/gfx/cairo/cairo/src/cairo-deprecated.h @@ -48,7 +48,7 @@ * completely implemented. So while this format value is currently * deprecated, it may eventually acquire complete support in the future. */ -/* #define CAIRO_FORMAT_RGB16_565 4 */ +#define CAIRO_FORMAT_RGB16_565 4 #define CAIRO_FONT_TYPE_ATSUI CAIRO_FONT_TYPE_QUARTZ diff --git a/gfx/cairo/cairo/src/cairo-image-surface.c b/gfx/cairo/cairo/src/cairo-image-surface.c index 181203d573af..d52979dbd999 100644 --- a/gfx/cairo/cairo/src/cairo-image-surface.c +++ b/gfx/cairo/cairo/src/cairo-image-surface.c @@ -64,10 +64,8 @@ _cairo_format_from_pixman_format (pixman_format_code_t pixman_format) return CAIRO_FORMAT_A8; case PIXMAN_a1: return CAIRO_FORMAT_A1; - case PIXMAN_r5g6b5: - return CAIRO_FORMAT_RGB16_565; case PIXMAN_a8b8g8r8: case PIXMAN_x8b8g8r8: case PIXMAN_r8g8b8: - case PIXMAN_b8g8r8: case PIXMAN_b5g6r5: + case PIXMAN_b8g8r8: case PIXMAN_r5g6b5: case PIXMAN_b5g6r5: case PIXMAN_a1r5g5b5: case PIXMAN_x1r5g5b5: case PIXMAN_a1b5g5r5: case PIXMAN_x1b5g5r5: case PIXMAN_a4r4g4b4: case PIXMAN_x4r4g4b4: case PIXMAN_a4b4g4r4: case PIXMAN_x4b4g4r4: case PIXMAN_r3g3b2: @@ -357,9 +355,6 @@ _cairo_format_to_pixman_format_code (cairo_format_t format) case CAIRO_FORMAT_RGB24: ret = PIXMAN_x8r8g8b8; break; - case CAIRO_FORMAT_RGB16_565: - ret = PIXMAN_r5g6b5; - break; case CAIRO_FORMAT_ARGB32: default: ret = PIXMAN_a8r8g8b8; @@ -736,8 +731,6 @@ _cairo_content_from_format (cairo_format_t format) return CAIRO_CONTENT_COLOR_ALPHA; case CAIRO_FORMAT_RGB24: return CAIRO_CONTENT_COLOR; - case CAIRO_FORMAT_RGB16_565: - return CAIRO_CONTENT_COLOR; case CAIRO_FORMAT_A8: case CAIRO_FORMAT_A1: return CAIRO_CONTENT_ALPHA; @@ -755,8 +748,6 @@ _cairo_format_bits_per_pixel (cairo_format_t format) return 32; case CAIRO_FORMAT_RGB24: return 32; - case CAIRO_FORMAT_RGB16_565: - return 16; case CAIRO_FORMAT_A8: return 8; case CAIRO_FORMAT_A1: @@ -1731,11 +1722,6 @@ _cairo_image_analyze_transparency (cairo_image_surface_t *image) return image->transparency = CAIRO_IMAGE_HAS_ALPHA; } - if (image->format == CAIRO_FORMAT_RGB16_565) { - image->transparency = CAIRO_IMAGE_IS_OPAQUE; - return CAIRO_IMAGE_IS_OPAQUE; - } - if (image->format != CAIRO_FORMAT_ARGB32) return image->transparency = CAIRO_IMAGE_HAS_ALPHA; diff --git a/gfx/cairo/cairo/src/cairo-xlib-display.c b/gfx/cairo/cairo/src/cairo-xlib-display.c index e98560dbaa20..566d9fb8bf03 100644 --- a/gfx/cairo/cairo/src/cairo-xlib-display.c +++ b/gfx/cairo/cairo/src/cairo-xlib-display.c @@ -52,7 +52,7 @@ struct _cairo_xlib_display { int render_major; int render_minor; - XRenderPictFormat *cached_xrender_formats[CAIRO_FORMAT_RGB16_565 + 1]; + XRenderPictFormat *cached_xrender_formats[CAIRO_FORMAT_A1 + 1]; cairo_xlib_job_t *workqueue; cairo_freelist_t wq_freelist; @@ -616,35 +616,13 @@ _cairo_xlib_display_get_xrender_format (cairo_xlib_display_t *display, pict_format = PictStandardA8; break; case CAIRO_FORMAT_RGB24: pict_format = PictStandardRGB24; break; - case CAIRO_FORMAT_RGB16_565: { - Visual *visual = NULL; - Screen *screen = DefaultScreenOfDisplay(display->display); - int j; - for (j = 0; j < screen->ndepths; j++) { - Depth *d = &screen->depths[j]; - if (d->depth == 16 && d->nvisuals && &d->visuals[0]) { - if (d->visuals[0].red_mask == 0xf800 && - d->visuals[0].green_mask == 0x7e0 && - d->visuals[0].blue_mask == 0x1f) - visual = &d->visuals[0]; - break; - } - } - if (!visual) { - CAIRO_MUTEX_UNLOCK (display->mutex); - return NULL; - } - xrender_format = XRenderFindVisualFormat(display->display, visual); - break; - } default: ASSERT_NOT_REACHED; case CAIRO_FORMAT_ARGB32: pict_format = PictStandardARGB32; break; } - if (!xrender_format) - xrender_format = XRenderFindStandardFormat (display->display, - pict_format); + xrender_format = XRenderFindStandardFormat (display->display, + pict_format); display->cached_xrender_formats[format] = xrender_format; } CAIRO_MUTEX_UNLOCK (display->mutex); diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h index f1b3024df38a..16b52b6b496a 100644 --- a/gfx/cairo/cairo/src/cairo.h +++ b/gfx/cairo/cairo/src/cairo.h @@ -2141,8 +2141,11 @@ typedef enum _cairo_format { CAIRO_FORMAT_ARGB32, CAIRO_FORMAT_RGB24, CAIRO_FORMAT_A8, - CAIRO_FORMAT_A1, - CAIRO_FORMAT_RGB16_565 + CAIRO_FORMAT_A1 + /* The value of 4 is reserved by a deprecated enum value. + * The next format added must have an explicit value of 5. + CAIRO_FORMAT_RGB16_565 = 4, + */ } cairo_format_t; cairo_public cairo_surface_t * diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h index 28861d73ef4b..1cdf6ff9a952 100644 --- a/gfx/cairo/cairo/src/cairoint.h +++ b/gfx/cairo/cairo/src/cairoint.h @@ -2187,7 +2187,7 @@ _cairo_surface_has_device_transform (cairo_surface_t *surface) cairo_pure; * in cairo-xlib-surface.c--again see -Wswitch-enum). */ #define CAIRO_FORMAT_INVALID ((unsigned int) -1) -#define CAIRO_FORMAT_VALID(format) ((format) <= CAIRO_FORMAT_RGB16_565) +#define CAIRO_FORMAT_VALID(format) ((format) <= CAIRO_FORMAT_A1) /* pixman-required stride alignment in bytes. */ #define CAIRO_STRIDE_ALIGNMENT (sizeof (uint32_t))