Bug 715704. Add a quartz implementation of mark_dirty_rectangle. r=roc
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 05 Jan 2012 18:40:01 -0500
changeset 85177 9ba8b867f96655ee07a8e86d7302503639975872
parent 85176 24a58ac9dca221c194c0da899c84866639e5bcc6
child 85178 47cc12948f74963a2c28e8018b2253fd88a33611
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs715704
milestone12.0a1
Bug 715704. Add a quartz implementation of mark_dirty_rectangle. r=roc We need to drop our CGImage cache when the surface has been changed by outside users.
gfx/cairo/README
gfx/cairo/cairo/src/cairo-quartz-surface.c
gfx/cairo/quartz-mark-dirty.patch
--- a/gfx/cairo/README
+++ b/gfx/cairo/README
@@ -171,16 +171,18 @@ fix-cairo-surface-wrapper-flush-build-wa
 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.
 
 lround-c99-only.patch: Only use lround in C99 programs.
 
 unicode-printing.patch: Print as unicode (bug 454532)
 
+quartz-mark-dirty.patch: Add a quartz implementation of mark_dirty_rectangle (bug 715704)
+
 ==== pixman patches ====
 
 pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv.
 
 pixman-rename-and-endian.patch: include cairo-platform.h for renaming of external symbols and endian macros
 
 NOTE: we previously supported ARM assembler on MSVC, this has been removed because of the maintenance burden
 
--- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
+++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
@@ -3116,16 +3116,27 @@ static cairo_status_t
 	    CGContextEOClip (surface->cgContext);
     }
 
     ND((stderr, "-- intersect_clip_path\n"));
 
     return CAIRO_STATUS_SUCCESS;
 }
 
+static cairo_status_t
+_cairo_quartz_surface_mark_dirty_rectangle (void *abstract_surface,
+					    int x, int y,
+					    int width, int height)
+{
+    cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface;
+    _cairo_quartz_surface_will_change (surface);
+    return CAIRO_STATUS_SUCCESS;
+}
+
+
 // XXXtodo implement show_page; need to figure out how to handle begin/end
 
 static const struct _cairo_surface_backend cairo_quartz_surface_backend = {
     CAIRO_SURFACE_TYPE_QUARTZ,
     _cairo_quartz_surface_create_similar,
     _cairo_quartz_surface_finish,
     _cairo_quartz_surface_acquire_image,
     _cairo_quartz_surface_release_source_image,
@@ -3138,17 +3149,17 @@ static const struct _cairo_surface_backe
     NULL, /* create_span_renderer */
     NULL, /* check_span_renderer */
     NULL, /* copy_page */
     NULL, /* show_page */
     _cairo_quartz_surface_get_extents,
     NULL, /* old_show_glyphs */
     NULL, /* get_font_options */
     NULL, /* flush */
-    NULL, /* mark_dirty_rectangle */
+    _cairo_quartz_surface_mark_dirty_rectangle,
     NULL, /* scaled_font_fini */
     NULL, /* scaled_glyph_fini */
 
     _cairo_quartz_surface_paint,
     _cairo_quartz_surface_mask,
     _cairo_quartz_surface_stroke,
     _cairo_quartz_surface_fill,
     _cairo_quartz_surface_show_glyphs,
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/quartz-mark-dirty.patch
@@ -0,0 +1,56 @@
+Date:   Thu Jan 5 18:40:01 2012 -0500
+
+Bug 715704. Add a quartz implementation of mark_dirty_rectangle. r=roc
+
+We need to drop our CGImage cache when the surface has been changed by outside users.
+
+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
+@@ -3116,16 +3116,27 @@ _cairo_quartz_surface_clipper_intersect_
+ 	    CGContextEOClip (surface->cgContext);
+     }
+ 
+     ND((stderr, "-- intersect_clip_path\n"));
+ 
+     return CAIRO_STATUS_SUCCESS;
+ }
+ 
++static cairo_status_t
++_cairo_quartz_surface_mark_dirty_rectangle (void *abstract_surface,
++					    int x, int y,
++					    int width, int height)
++{
++    cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface;
++    _cairo_quartz_surface_will_change (surface);
++    return CAIRO_STATUS_SUCCESS;
++}
++
++
+ // XXXtodo implement show_page; need to figure out how to handle begin/end
+ 
+ static const struct _cairo_surface_backend cairo_quartz_surface_backend = {
+     CAIRO_SURFACE_TYPE_QUARTZ,
+     _cairo_quartz_surface_create_similar,
+     _cairo_quartz_surface_finish,
+     _cairo_quartz_surface_acquire_image,
+     _cairo_quartz_surface_release_source_image,
+@@ -3138,17 +3149,17 @@ static const struct _cairo_surface_backe
+     NULL, /* create_span_renderer */
+     NULL, /* check_span_renderer */
+     NULL, /* copy_page */
+     NULL, /* show_page */
+     _cairo_quartz_surface_get_extents,
+     NULL, /* old_show_glyphs */
+     NULL, /* get_font_options */
+     NULL, /* flush */
+-    NULL, /* mark_dirty_rectangle */
++    _cairo_quartz_surface_mark_dirty_rectangle,
+     NULL, /* scaled_font_fini */
+     NULL, /* scaled_glyph_fini */
+ 
+     _cairo_quartz_surface_paint,
+     _cairo_quartz_surface_mask,
+     _cairo_quartz_surface_stroke,
+     _cairo_quartz_surface_fill,
+     _cairo_quartz_surface_show_glyphs,