Backed out changeset 85335f212ac3, attempt to fix oranges

This commit is contained in:
Oleg Romashin 2010-06-11 08:36:08 -04:00
parent de03fe6f2e
commit 6ffba3fcd6
5 changed files with 11 additions and 44 deletions

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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 *

View File

@ -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))