gfx/cairo/quartz-cg-layers-fix-fallback.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 Bug 572912. Fix surface type passed to cairo_quartz_surface_create during fallback for CGLayers. r=jrmuizel
     3 diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     4 --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c
     5 +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c
     6 @@ -2026,17 +2026,17 @@ _cairo_quartz_surface_acquire_image (voi
     8      /* ND((stderr, "%p _cairo_quartz_surface_acquire_image\n", surface)); */
    10      status = _cairo_quartz_get_image (surface, image_out);
    12      if (status == CAIRO_INT_STATUS_UNSUPPORTED && surface->cgLayer) {
    13          /* copy the layer into a Quartz bitmap context so we can get the data */
    14          cairo_surface_t *tmp =
    15 -            cairo_quartz_surface_create (CAIRO_CONTENT_COLOR_ALPHA,
    16 +            cairo_quartz_surface_create (CAIRO_FORMAT_ARGB32,
    17                                           surface->extents.width,
    18                                           surface->extents.height);
    19          cairo_quartz_surface_t *tmp_surface = (cairo_quartz_surface_t *) tmp;
    21          /* if surface creation failed, we won't have a Quartz surface here */
    22          if (cairo_surface_get_type (tmp) == CAIRO_SURFACE_TYPE_QUARTZ &&
    23              tmp_surface->imageSurfaceEquiv) {
    24              CGContextSaveGState (tmp_surface->cgContext);
    25 @@ -2049,16 +2049,17 @@ _cairo_quartz_surface_acquire_image (voi
    26              CGContextDrawLayerAtPoint (tmp_surface->cgContext,
    27                                         CGPointMake (0.0, 0.0),
    28                                         surface->cgLayer);
    29              CGContextRestoreGState (tmp_surface->cgContext);
    31              *image_out = (cairo_image_surface_t*)
    32                  cairo_surface_reference(tmp_surface->imageSurfaceEquiv);
    33              *image_extra = tmp;
    34 +            status = CAIRO_STATUS_SUCCESS;
    35          } else {
    36              cairo_surface_destroy (tmp);
    37          }
    38      }
    40      if (status)
    41  	return _cairo_error (CAIRO_STATUS_NO_MEMORY);

mercurial