gfx/cairo/quartz-mark-dirty.patch

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 Date:   Thu Jan 5 18:40:01 2012 -0500
     3 Bug 715704. Add a quartz implementation of mark_dirty_rectangle. r=roc
     5 We need to drop our CGImage cache when the surface has been changed by outside users.
     7 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     8 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
     9 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
    10 @@ -3116,16 +3116,27 @@ _cairo_quartz_surface_clipper_intersect_
    11  	    CGContextEOClip (surface->cgContext);
    12      }
    14      ND((stderr, "-- intersect_clip_path\n"));
    16      return CAIRO_STATUS_SUCCESS;
    17  }
    19 +static cairo_status_t
    20 +_cairo_quartz_surface_mark_dirty_rectangle (void *abstract_surface,
    21 +					    int x, int y,
    22 +					    int width, int height)
    23 +{
    24 +    cairo_quartz_surface_t *surface = (cairo_quartz_surface_t *) abstract_surface;
    25 +    _cairo_quartz_surface_will_change (surface);
    26 +    return CAIRO_STATUS_SUCCESS;
    27 +}
    28 +
    29 +
    30  // XXXtodo implement show_page; need to figure out how to handle begin/end
    32  static const struct _cairo_surface_backend cairo_quartz_surface_backend = {
    33      CAIRO_SURFACE_TYPE_QUARTZ,
    34      _cairo_quartz_surface_create_similar,
    35      _cairo_quartz_surface_finish,
    36      _cairo_quartz_surface_acquire_image,
    37      _cairo_quartz_surface_release_source_image,
    38 @@ -3138,17 +3149,17 @@ static const struct _cairo_surface_backe
    39      NULL, /* create_span_renderer */
    40      NULL, /* check_span_renderer */
    41      NULL, /* copy_page */
    42      NULL, /* show_page */
    43      _cairo_quartz_surface_get_extents,
    44      NULL, /* old_show_glyphs */
    45      NULL, /* get_font_options */
    46      NULL, /* flush */
    47 -    NULL, /* mark_dirty_rectangle */
    48 +    _cairo_quartz_surface_mark_dirty_rectangle,
    49      NULL, /* scaled_font_fini */
    50      NULL, /* scaled_glyph_fini */
    52      _cairo_quartz_surface_paint,
    53      _cairo_quartz_surface_mask,
    54      _cairo_quartz_surface_stroke,
    55      _cairo_quartz_surface_fill,
    56      _cairo_quartz_surface_show_glyphs,

mercurial