Tue, 06 Jan 2015 21:39:09 +0100
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.
michael@0 | 1 | diff --git a/gfx/cairo/README b/gfx/cairo/README |
michael@0 | 2 | --- a/gfx/cairo/README |
michael@0 | 3 | +++ b/gfx/cairo/README |
michael@0 | 4 | @@ -69,16 +69,18 @@ quartz-state.patch: bug 522859; refactor |
michael@0 | 5 | quartz-cache-CGImageRef.patch: cache CGImageRef for a CGBitmapContext; when we reuse it, Quartz will cache stuff, improving performance |
michael@0 | 6 | |
michael@0 | 7 | quartz-remove-snapshot.patch: remove broken implementation of backend snapshot |
michael@0 | 8 | |
michael@0 | 9 | quartz-cglayers.patch: add support for cairo surfaces backed by CGLayers |
michael@0 | 10 | |
michael@0 | 11 | quartz-cglayers-fix-fallback.patch: Bug 572912; fix bug in fallback code in previous patch |
michael@0 | 12 | |
michael@0 | 13 | +quartz-get-image.patch: Bug 575521; add a way to get the image surface associated with a surface |
michael@0 | 14 | + |
michael@0 | 15 | premultiply-alpha-solid-gradients.patch: bug 539165; multiply the solid color by the alpha component before using it for a solid surface |
michael@0 | 16 | |
michael@0 | 17 | xlib-initialize-members.path: bug 548793; initialize XRender version if the server doesn't have the extension |
michael@0 | 18 | |
michael@0 | 19 | remove-comma: remove a comma from enum |
michael@0 | 20 | |
michael@0 | 21 | d2d.patch: add d2d support |
michael@0 | 22 | |
michael@0 | 23 | diff --git a/gfx/cairo/cairo/src/cairo-quartz-surface.c b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 24 | --- a/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 25 | +++ b/gfx/cairo/cairo/src/cairo-quartz-surface.c |
michael@0 | 26 | @@ -1880,24 +1880,24 @@ _cairo_quartz_surface_finish (void *abst |
michael@0 | 27 | surface->cgContext = NULL; |
michael@0 | 28 | |
michael@0 | 29 | if (surface->bitmapContextImage) { |
michael@0 | 30 | CGImageRelease (surface->bitmapContextImage); |
michael@0 | 31 | surface->bitmapContextImage = NULL; |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | if (surface->imageSurfaceEquiv) { |
michael@0 | 35 | + _cairo_image_surface_assume_ownership_of_data (surface->imageSurfaceEquiv); |
michael@0 | 36 | cairo_surface_destroy (surface->imageSurfaceEquiv); |
michael@0 | 37 | surface->imageSurfaceEquiv = NULL; |
michael@0 | 38 | + } else if (surface->imageData) { |
michael@0 | 39 | + free (surface->imageData); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | - if (surface->imageData) { |
michael@0 | 43 | - free (surface->imageData); |
michael@0 | 44 | - surface->imageData = NULL; |
michael@0 | 45 | - } |
michael@0 | 46 | + surface->imageData = NULL; |
michael@0 | 47 | |
michael@0 | 48 | if (surface->cgLayer) { |
michael@0 | 49 | CGLayerRelease (surface->cgLayer); |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | return CAIRO_STATUS_SUCCESS; |
michael@0 | 53 | } |
michael@0 | 54 | |
michael@0 | 55 | @@ -3200,16 +3200,28 @@ cairo_quartz_finish_cg_context_with_clip |
michael@0 | 56 | cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t*)surface; |
michael@0 | 57 | |
michael@0 | 58 | if (cairo_surface_get_type(surface) != CAIRO_SURFACE_TYPE_QUARTZ) |
michael@0 | 59 | return; |
michael@0 | 60 | |
michael@0 | 61 | CGContextRestoreGState (quartz->cgContext); |
michael@0 | 62 | } |
michael@0 | 63 | |
michael@0 | 64 | +cairo_surface_t * |
michael@0 | 65 | +cairo_quartz_surface_get_image (cairo_surface_t *surface) |
michael@0 | 66 | +{ |
michael@0 | 67 | + cairo_quartz_surface_t *quartz = (cairo_quartz_surface_t *)surface; |
michael@0 | 68 | + cairo_image_surface_t *image; |
michael@0 | 69 | + |
michael@0 | 70 | + if (_cairo_quartz_get_image(quartz, &image)) |
michael@0 | 71 | + return NULL; |
michael@0 | 72 | + |
michael@0 | 73 | + return (cairo_surface_t *)image; |
michael@0 | 74 | +} |
michael@0 | 75 | + |
michael@0 | 76 | /* Debug stuff */ |
michael@0 | 77 | |
michael@0 | 78 | #ifdef QUARTZ_DEBUG |
michael@0 | 79 | |
michael@0 | 80 | #include <Movies.h> |
michael@0 | 81 | |
michael@0 | 82 | void ExportCGImageToPNGFile(CGImageRef inImageRef, char* dest) |
michael@0 | 83 | { |
michael@0 | 84 | diff --git a/gfx/cairo/cairo/src/cairo-quartz.h b/gfx/cairo/cairo/src/cairo-quartz.h |
michael@0 | 85 | --- a/gfx/cairo/cairo/src/cairo-quartz.h |
michael@0 | 86 | +++ b/gfx/cairo/cairo/src/cairo-quartz.h |
michael@0 | 87 | @@ -63,16 +63,19 @@ cairo_public CGContextRef |
michael@0 | 88 | cairo_quartz_surface_get_cg_context (cairo_surface_t *surface); |
michael@0 | 89 | |
michael@0 | 90 | cairo_public CGContextRef |
michael@0 | 91 | cairo_quartz_get_cg_context_with_clip (cairo_t *cr); |
michael@0 | 92 | |
michael@0 | 93 | cairo_public void |
michael@0 | 94 | cairo_quartz_finish_cg_context_with_clip (cairo_t *cr); |
michael@0 | 95 | |
michael@0 | 96 | +cairo_public cairo_surface_t * |
michael@0 | 97 | +cairo_quartz_surface_get_image (cairo_surface_t *surface); |
michael@0 | 98 | + |
michael@0 | 99 | #if CAIRO_HAS_QUARTZ_FONT |
michael@0 | 100 | |
michael@0 | 101 | /* |
michael@0 | 102 | * Quartz font support |
michael@0 | 103 | */ |
michael@0 | 104 | |
michael@0 | 105 | cairo_public cairo_font_face_t * |
michael@0 | 106 | cairo_quartz_font_face_create_for_cgfont (CGFontRef font); |
michael@0 | 107 | diff --git a/gfx/cairo/cairo/src/cairo-rename.h b/gfx/cairo/cairo/src/cairo-rename.h |
michael@0 | 108 | --- a/gfx/cairo/cairo/src/cairo-rename.h |
michael@0 | 109 | +++ b/gfx/cairo/cairo/src/cairo-rename.h |
michael@0 | 110 | @@ -178,16 +178,17 @@ |
michael@0 | 111 | #define cairo_qpainter_surface_get_qpainter _moz_cairo_qpainter_surface_get_qpainter |
michael@0 | 112 | #define cairo_quartz_font_face_create_for_atsu_font_id _moz_cairo_quartz_font_face_create_for_atsu_font_id |
michael@0 | 113 | #define cairo_quartz_font_face_create_for_cgfont _moz_cairo_quartz_font_face_create_for_cgfont |
michael@0 | 114 | #define cairo_quartz_image_surface_create _moz_cairo_quartz_image_surface_create |
michael@0 | 115 | #define cairo_quartz_image_surface_get_image _moz_cairo_quartz_image_surface_get_image |
michael@0 | 116 | #define cairo_quartz_surface_create _moz_cairo_quartz_surface_create |
michael@0 | 117 | #define cairo_quartz_surface_create_for_cg_context _moz_cairo_quartz_surface_create_for_cg_context |
michael@0 | 118 | #define cairo_quartz_surface_get_cg_context _moz_cairo_quartz_surface_get_cg_context |
michael@0 | 119 | +#define cairo_quartz_surface_get_image _moz_cairo_quartz_surface_get_image |
michael@0 | 120 | #define cairo_rectangle _moz_cairo_rectangle |
michael@0 | 121 | #define cairo_rectangle_list_destroy _moz_cairo_rectangle_list_destroy |
michael@0 | 122 | #define cairo_reference _moz_cairo_reference |
michael@0 | 123 | #define cairo_rel_curve_to _moz_cairo_rel_curve_to |
michael@0 | 124 | #define cairo_rel_line_to _moz_cairo_rel_line_to |
michael@0 | 125 | #define cairo_rel_move_to _moz_cairo_rel_move_to |
michael@0 | 126 | #define cairo_reset_clip _moz_cairo_reset_clip |
michael@0 | 127 | #define cairo_restore _moz_cairo_restore |