Bug 675837 - Only flush Quartz surfaces on the success paths during cairo_quartz_get_image. r=roc

This commit is contained in:
Matt Woodrow 2011-08-27 12:02:03 +12:00
Родитель 2f2de41c51
Коммит 72dd10803c
3 изменённых файлов: 48 добавлений и 2 удалений

Просмотреть файл

@ -169,6 +169,9 @@ pixman-image-transform.patch: Reset the transform on pixman images when using th
fix-cairo-surface-wrapper-flush-build-warning.patch: Ensures that _cairo_surface_wrapper_flush always returns a status, to silence the build warning
fixup-unbounded.patch: Hack to work around bad assumption.
quartz-get-image-performance: Make cairo_quartz_get_image faster in the failure case by not flushing unless we are going to succeed.
==== pixman patches ====
pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv.

Просмотреть файл

@ -1914,9 +1914,8 @@ _cairo_quartz_get_image (cairo_quartz_surface_t *surface,
return CAIRO_STATUS_SUCCESS;
}
CGContextFlush(surface->cgContext);
if (surface->imageSurfaceEquiv) {
CGContextFlush(surface->cgContext);
*image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv);
return CAIRO_STATUS_SUCCESS;
}
@ -1928,6 +1927,7 @@ _cairo_quartz_get_image (cairo_quartz_surface_t *surface,
CGColorSpaceRef colorspace;
unsigned int color_comps;
CGContextFlush(surface->cgContext);
imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext);
#ifdef USE_10_3_WORKAROUNDS

Просмотреть файл

@ -0,0 +1,43 @@
# HG changeset patch
# User Matt Woodrow <mwoodrow@mozilla.com>
# Date 1314162877 -43200
# Node ID 87458c4670dcd16be5a5715d741ee2ca4cf18d0f
# Parent 95eb700a64591cda694c284a9f8ad08c11e3dd97
Bug 675837 - Only flush Quartz surfaces on the success paths during cairo_quartz_get_image. r=roc
diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
@@ -1909,30 +1909,30 @@ _cairo_quartz_get_image (cairo_quartz_su
unsigned char *imageData;
cairo_image_surface_t *isurf;
if (IS_EMPTY(surface)) {
*image_out = (cairo_image_surface_t*) cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 0, 0);
return CAIRO_STATUS_SUCCESS;
}
- CGContextFlush(surface->cgContext);
-
if (surface->imageSurfaceEquiv) {
+ CGContextFlush(surface->cgContext);
*image_out = (cairo_image_surface_t*) cairo_surface_reference(surface->imageSurfaceEquiv);
return CAIRO_STATUS_SUCCESS;
}
if (_cairo_quartz_is_cgcontext_bitmap_context(surface->cgContext)) {
unsigned int stride;
unsigned int bitinfo;
unsigned int bpc, bpp;
CGColorSpaceRef colorspace;
unsigned int color_comps;
+ CGContextFlush(surface->cgContext);
imageData = (unsigned char *) CGBitmapContextGetData(surface->cgContext);
#ifdef USE_10_3_WORKAROUNDS
bitinfo = CGBitmapContextGetAlphaInfo (surface->cgContext);
#else
bitinfo = CGBitmapContextGetBitmapInfo (surface->cgContext);
#endif
stride = CGBitmapContextGetBytesPerRow (surface->cgContext);