gfx/cairo/expose-snapshot.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.

michael@0 1 diff --git a/gfx/cairo/cairo/src/cairo-analysis-surface-private.h b/gfx/cairo/cairo/src/cairo-analysis-surface-private.h
michael@0 2 --- a/gfx/cairo/cairo/src/cairo-analysis-surface-private.h
michael@0 3 +++ b/gfx/cairo/cairo/src/cairo-analysis-surface-private.h
michael@0 4 @@ -65,14 +65,11 @@ _cairo_analysis_surface_has_unsupported
michael@0 5 cairo_private void
michael@0 6 _cairo_analysis_surface_get_bounding_box (cairo_surface_t *surface,
michael@0 7 cairo_box_t *bbox);
michael@0 8
michael@0 9 cairo_private cairo_int_status_t
michael@0 10 _cairo_analysis_surface_merge_status (cairo_int_status_t status_a,
michael@0 11 cairo_int_status_t status_b);
michael@0 12
michael@0 13 -cairo_private cairo_surface_t *
michael@0 14 -_cairo_null_surface_create (cairo_content_t content);
michael@0 15 -
michael@0 16 CAIRO_END_DECLS
michael@0 17
michael@0 18 #endif /* CAIRO_ANALYSIS_SURFACE_H */
michael@0 19 diff --git a/gfx/cairo/cairo/src/cairo-analysis-surface.c b/gfx/cairo/cairo/src/cairo-analysis-surface.c
michael@0 20 --- a/gfx/cairo/cairo/src/cairo-analysis-surface.c
michael@0 21 +++ b/gfx/cairo/cairo/src/cairo-analysis-surface.c
michael@0 22 @@ -902,17 +902,17 @@ static const cairo_surface_backend_t cai
michael@0 23 NULL, /* fill_stroke */
michael@0 24 NULL, /* create_solid_pattern_surface */
michael@0 25 NULL, /* can_repaint_solid_pattern_surface */
michael@0 26 NULL, /* has_show_text_glyphs */
michael@0 27 NULL /* show_text_glyphs */
michael@0 28 };
michael@0 29
michael@0 30 cairo_surface_t *
michael@0 31 -_cairo_null_surface_create (cairo_content_t content)
michael@0 32 +cairo_null_surface_create (cairo_content_t content)
michael@0 33 {
michael@0 34 cairo_surface_t *surface;
michael@0 35
michael@0 36 surface = malloc (sizeof (cairo_surface_t));
michael@0 37 if (unlikely (surface == NULL)) {
michael@0 38 return _cairo_surface_create_in_error (_cairo_error (CAIRO_STATUS_NO_MEMORY));
michael@0 39 }
michael@0 40
michael@0 41 diff --git a/gfx/cairo/cairo/src/cairo-d2d-surface.cpp b/gfx/cairo/cairo/src/cairo-d2d-surface.cpp
michael@0 42 --- a/gfx/cairo/cairo/src/cairo-d2d-surface.cpp
michael@0 43 +++ b/gfx/cairo/cairo/src/cairo-d2d-surface.cpp
michael@0 44 @@ -1951,24 +1951,24 @@ _cairo_d2d_create_brush_for_pattern(cair
michael@0 45 rect = D2D1::RectU(1, 1, srcSurf->width + 1, srcSurf->height + 1);
michael@0 46 } else {
michael@0 47 rect = D2D1::RectU(0, 0, srcSurf->width, srcSurf->height);
michael@0 48 }
michael@0 49 sourceBitmap->CopyFromMemory(&rect,
michael@0 50 srcSurf->data,
michael@0 51 srcSurf->stride);
michael@0 52 cairo_surface_t *nullSurf =
michael@0 53 - _cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
michael@0 54 + cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
michael@0 55 cachebitmap->refs++;
michael@0 56 cachebitmap->dirty = false;
michael@0 57 cairo_surface_set_user_data(nullSurf,
michael@0 58 &bitmap_key_snapshot,
michael@0 59 cachebitmap,
michael@0 60 NULL);
michael@0 61 - _cairo_surface_attach_snapshot(surfacePattern->surface,
michael@0 62 + cairo_surface_attach_snapshot(surfacePattern->surface,
michael@0 63 nullSurf,
michael@0 64 _d2d_snapshot_detached);
michael@0 65 }
michael@0 66 } else {
michael@0 67 if (pattern->extend != CAIRO_EXTEND_NONE) {
michael@0 68 d2dsurf->rt->CreateBitmap(D2D1::SizeU(width, height),
michael@0 69 data + yoffset * stride + xoffset * Bpp,
michael@0 70 stride,
michael@0 71 @@ -2015,22 +2015,22 @@ _cairo_d2d_create_brush_for_pattern(cair
michael@0 72 * and one more in the user data structure.
michael@0 73 */
michael@0 74 cachebitmap->refs = 2;
michael@0 75 cairo_surface_set_user_data(surfacePattern->surface,
michael@0 76 key,
michael@0 77 cachebitmap,
michael@0 78 _d2d_release_bitmap);
michael@0 79 cairo_surface_t *nullSurf =
michael@0 80 - _cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
michael@0 81 + cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
michael@0 82 cairo_surface_set_user_data(nullSurf,
michael@0 83 &bitmap_key_snapshot,
michael@0 84 cachebitmap,
michael@0 85 NULL);
michael@0 86 - _cairo_surface_attach_snapshot(surfacePattern->surface,
michael@0 87 + cairo_surface_attach_snapshot(surfacePattern->surface,
michael@0 88 nullSurf,
michael@0 89 _d2d_snapshot_detached);
michael@0 90 cache_usage += _d2d_compute_bitmap_mem_size(sourceBitmap);
michael@0 91 }
michael@0 92 if (pix_image) {
michael@0 93 pixman_image_unref(pix_image);
michael@0 94 }
michael@0 95 }
michael@0 96 diff --git a/gfx/cairo/cairo/src/cairo-recording-surface.c b/gfx/cairo/cairo/src/cairo-recording-surface.c
michael@0 97 --- a/gfx/cairo/cairo/src/cairo-recording-surface.c
michael@0 98 +++ b/gfx/cairo/cairo/src/cairo-recording-surface.c
michael@0 99 @@ -276,17 +276,17 @@ _cairo_recording_surface_acquire_source_
michael@0 100 -surface->extents.y);
michael@0 101
michael@0 102 status = _cairo_recording_surface_replay (&surface->base, image);
michael@0 103 if (unlikely (status)) {
michael@0 104 cairo_surface_destroy (image);
michael@0 105 return status;
michael@0 106 }
michael@0 107
michael@0 108 - _cairo_surface_attach_snapshot (&surface->base, image, NULL);
michael@0 109 + cairo_surface_attach_snapshot (&surface->base, image, NULL);
michael@0 110
michael@0 111 *image_out = (cairo_image_surface_t *) image;
michael@0 112 *image_extra = NULL;
michael@0 113 return CAIRO_STATUS_SUCCESS;
michael@0 114 }
michael@0 115
michael@0 116 static void
michael@0 117 _cairo_recording_surface_release_source_image (void *abstract_surface,
michael@0 118 @@ -1046,17 +1046,17 @@ static cairo_status_t
michael@0 119 _recording_surface_get_ink_bbox (cairo_recording_surface_t *surface,
michael@0 120 cairo_box_t *bbox,
michael@0 121 const cairo_matrix_t *transform)
michael@0 122 {
michael@0 123 cairo_surface_t *null_surface;
michael@0 124 cairo_surface_t *analysis_surface;
michael@0 125 cairo_status_t status;
michael@0 126
michael@0 127 - null_surface = _cairo_null_surface_create (surface->content);
michael@0 128 + null_surface = cairo_null_surface_create (surface->content);
michael@0 129 analysis_surface = _cairo_analysis_surface_create (null_surface);
michael@0 130 cairo_surface_destroy (null_surface);
michael@0 131
michael@0 132 status = analysis_surface->status;
michael@0 133 if (unlikely (status))
michael@0 134 return status;
michael@0 135
michael@0 136 if (transform != NULL)
michael@0 137 diff --git a/gfx/cairo/cairo/src/cairo-surface-private.h b/gfx/cairo/cairo/src/cairo-surface-private.h
michael@0 138 --- a/gfx/cairo/cairo/src/cairo-surface-private.h
michael@0 139 +++ b/gfx/cairo/cairo/src/cairo-surface-private.h
michael@0 140 @@ -40,18 +40,16 @@
michael@0 141
michael@0 142 #include "cairo.h"
michael@0 143
michael@0 144 #include "cairo-types-private.h"
michael@0 145 #include "cairo-list-private.h"
michael@0 146 #include "cairo-reference-count-private.h"
michael@0 147 #include "cairo-clip-private.h"
michael@0 148
michael@0 149 -typedef void (*cairo_surface_func_t) (cairo_surface_t *);
michael@0 150 -
michael@0 151 struct _cairo_surface {
michael@0 152 const cairo_surface_backend_t *backend;
michael@0 153 cairo_device_t *device;
michael@0 154
michael@0 155 /* We allow surfaces to override the backend->type by shoving something
michael@0 156 * else into surface->type. This is for "wrapper" surfaces that want to
michael@0 157 * hide their internal type from the user-level API. */
michael@0 158 cairo_surface_type_t type;
michael@0 159 diff --git a/gfx/cairo/cairo/src/cairo-surface-snapshot.c b/gfx/cairo/cairo/src/cairo-surface-snapshot.c
michael@0 160 --- a/gfx/cairo/cairo/src/cairo-surface-snapshot.c
michael@0 161 +++ b/gfx/cairo/cairo/src/cairo-surface-snapshot.c
michael@0 162 @@ -209,17 +209,17 @@ _cairo_surface_snapshot (cairo_surface_t
michael@0 163 if (unlikely (status)) {
michael@0 164 cairo_surface_destroy (snap);
michael@0 165 return _cairo_surface_create_in_error (status);
michael@0 166 }
michael@0 167
michael@0 168 snap->device_transform = surface->device_transform;
michael@0 169 snap->device_transform_inverse = surface->device_transform_inverse;
michael@0 170
michael@0 171 - _cairo_surface_attach_snapshot (surface, snap, NULL);
michael@0 172 + cairo_surface_attach_snapshot (surface, snap, NULL);
michael@0 173
michael@0 174 return snap;
michael@0 175 }
michael@0 176 }
michael@0 177
michael@0 178 snapshot = (cairo_surface_snapshot_t *)
michael@0 179 _cairo_surface_has_snapshot (surface, &_cairo_surface_snapshot_backend);
michael@0 180 if (snapshot != NULL)
michael@0 181 @@ -242,14 +242,14 @@ _cairo_surface_snapshot (cairo_surface_t
michael@0 182 if (unlikely (status)) {
michael@0 183 cairo_surface_destroy (&snapshot->base);
michael@0 184 return _cairo_surface_create_in_error (status);
michael@0 185 }
michael@0 186
michael@0 187 snapshot->base.device_transform = surface->device_transform;
michael@0 188 snapshot->base.device_transform_inverse = surface->device_transform_inverse;
michael@0 189
michael@0 190 - _cairo_surface_attach_snapshot (surface,
michael@0 191 + cairo_surface_attach_snapshot (surface,
michael@0 192 &snapshot->base,
michael@0 193 _cairo_surface_snapshot_copy_on_write);
michael@0 194
michael@0 195 return &snapshot->base;
michael@0 196 }
michael@0 197 diff --git a/gfx/cairo/cairo/src/cairo-surface-subsurface.c b/gfx/cairo/cairo/src/cairo-surface-subsurface.c
michael@0 198 --- a/gfx/cairo/cairo/src/cairo-surface-subsurface.c
michael@0 199 +++ b/gfx/cairo/cairo/src/cairo-surface-subsurface.c
michael@0 200 @@ -326,17 +326,17 @@ _cairo_surface_subsurface_acquire_source
michael@0 201 _cairo_image_surface_create_with_content (meta->content,
michael@0 202 surface->extents.width,
michael@0 203 surface->extents.height);
michael@0 204 if (unlikely (image->base.status))
michael@0 205 return image->base.status;
michael@0 206
michael@0 207 cairo_surface_paint_to_target (&image->base, surface);
michael@0 208
michael@0 209 - _cairo_surface_attach_snapshot (&surface->base, &image->base, NULL);
michael@0 210 + cairo_surface_attach_snapshot (&surface->base, &image->base, NULL);
michael@0 211
michael@0 212 *image_out = image;
michael@0 213 *extra_out = NULL;
michael@0 214 return CAIRO_STATUS_SUCCESS;
michael@0 215 }
michael@0 216 }
michael@0 217
michael@0 218 extra = malloc (sizeof (struct extra));
michael@0 219 diff --git a/gfx/cairo/cairo/src/cairo-surface.c b/gfx/cairo/cairo/src/cairo-surface.c
michael@0 220 --- a/gfx/cairo/cairo/src/cairo-surface.c
michael@0 221 +++ b/gfx/cairo/cairo/src/cairo-surface.c
michael@0 222 @@ -305,51 +305,51 @@ _cairo_surface_detach_mime_data (cairo_s
michael@0 223 if (! _cairo_surface_has_mime_data (surface))
michael@0 224 return;
michael@0 225
michael@0 226 _cairo_user_data_array_fini (&surface->mime_data);
michael@0 227 _cairo_user_data_array_init (&surface->mime_data);
michael@0 228 }
michael@0 229
michael@0 230 static void
michael@0 231 -_cairo_surface_detach_snapshots (cairo_surface_t *surface)
michael@0 232 +cairo_surface_detach_snapshots (cairo_surface_t *surface)
michael@0 233 {
michael@0 234 while (_cairo_surface_has_snapshots (surface)) {
michael@0 235 - _cairo_surface_detach_snapshot (cairo_list_first_entry (&surface->snapshots,
michael@0 236 + cairo_surface_detach_snapshot (cairo_list_first_entry (&surface->snapshots,
michael@0 237 cairo_surface_t,
michael@0 238 snapshot));
michael@0 239 }
michael@0 240 }
michael@0 241
michael@0 242 void
michael@0 243 -_cairo_surface_detach_snapshot (cairo_surface_t *snapshot)
michael@0 244 +cairo_surface_detach_snapshot (cairo_surface_t *snapshot)
michael@0 245 {
michael@0 246 assert (snapshot->snapshot_of != NULL);
michael@0 247
michael@0 248 snapshot->snapshot_of = NULL;
michael@0 249 cairo_list_del (&snapshot->snapshot);
michael@0 250
michael@0 251 if (snapshot->snapshot_detach != NULL)
michael@0 252 snapshot->snapshot_detach (snapshot);
michael@0 253
michael@0 254 cairo_surface_destroy (snapshot);
michael@0 255 }
michael@0 256
michael@0 257 void
michael@0 258 -_cairo_surface_attach_snapshot (cairo_surface_t *surface,
michael@0 259 +cairo_surface_attach_snapshot (cairo_surface_t *surface,
michael@0 260 cairo_surface_t *snapshot,
michael@0 261 cairo_surface_func_t detach_func)
michael@0 262 {
michael@0 263 assert (surface != snapshot);
michael@0 264 assert (snapshot->snapshot_of != surface);
michael@0 265
michael@0 266 cairo_surface_reference (snapshot);
michael@0 267
michael@0 268 if (snapshot->snapshot_of != NULL)
michael@0 269 - _cairo_surface_detach_snapshot (snapshot);
michael@0 270 + cairo_surface_detach_snapshot (snapshot);
michael@0 271
michael@0 272 snapshot->snapshot_of = surface;
michael@0 273 snapshot->snapshot_detach = detach_func;
michael@0 274
michael@0 275 cairo_list_add (&snapshot->snapshot, &surface->snapshots);
michael@0 276
michael@0 277 assert (_cairo_surface_has_snapshot (surface, snapshot->backend) == snapshot);
michael@0 278 }
michael@0 279 @@ -382,17 +382,17 @@ _cairo_surface_is_writable (cairo_surfac
michael@0 280
michael@0 281 static void
michael@0 282 _cairo_surface_begin_modification (cairo_surface_t *surface)
michael@0 283 {
michael@0 284 assert (surface->status == CAIRO_STATUS_SUCCESS);
michael@0 285 assert (! surface->finished);
michael@0 286 assert (surface->snapshot_of == NULL);
michael@0 287
michael@0 288 - _cairo_surface_detach_snapshots (surface);
michael@0 289 + cairo_surface_detach_snapshots (surface);
michael@0 290 _cairo_surface_detach_mime_data (surface);
michael@0 291 }
michael@0 292
michael@0 293 void
michael@0 294 _cairo_surface_init (cairo_surface_t *surface,
michael@0 295 const cairo_surface_backend_t *backend,
michael@0 296 cairo_device_t *device,
michael@0 297 cairo_content_t content)
michael@0 298 @@ -711,19 +711,19 @@ cairo_surface_finish (cairo_surface_t *s
michael@0 299
michael@0 300 if (CAIRO_REFERENCE_COUNT_IS_INVALID (&surface->ref_count))
michael@0 301 return;
michael@0 302
michael@0 303 if (surface->finished)
michael@0 304 return;
michael@0 305
michael@0 306 /* update the snapshots *before* we declare the surface as finished */
michael@0 307 - _cairo_surface_detach_snapshots (surface);
michael@0 308 + cairo_surface_detach_snapshots (surface);
michael@0 309 if (surface->snapshot_of != NULL)
michael@0 310 - _cairo_surface_detach_snapshot (surface);
michael@0 311 + cairo_surface_detach_snapshot (surface);
michael@0 312
michael@0 313 cairo_surface_flush (surface);
michael@0 314 surface->finished = TRUE;
michael@0 315
michael@0 316 /* call finish even if in error mode */
michael@0 317 if (surface->backend->finish) {
michael@0 318 status = surface->backend->finish (surface);
michael@0 319 if (unlikely (status))
michael@0 320 @@ -1106,17 +1106,17 @@ cairo_surface_flush (cairo_surface_t *su
michael@0 321
michael@0 322 if (surface->status)
michael@0 323 return;
michael@0 324
michael@0 325 if (surface->finished)
michael@0 326 return;
michael@0 327
michael@0 328 /* update the current snapshots *before* the user updates the surface */
michael@0 329 - _cairo_surface_detach_snapshots (surface);
michael@0 330 + cairo_surface_detach_snapshots (surface);
michael@0 331
michael@0 332 if (surface->backend->flush) {
michael@0 333 status = surface->backend->flush (surface);
michael@0 334 if (unlikely (status))
michael@0 335 status = _cairo_surface_set_error (surface, status);
michael@0 336 }
michael@0 337 }
michael@0 338 slim_hidden_def (cairo_surface_flush);
michael@0 339 @@ -1628,17 +1628,17 @@ _cairo_recording_surface_clone_similar (
michael@0 340 return similar->status;
michael@0 341
michael@0 342 status = _cairo_recording_surface_replay (src, similar);
michael@0 343 if (unlikely (status)) {
michael@0 344 cairo_surface_destroy (similar);
michael@0 345 return status;
michael@0 346 }
michael@0 347
michael@0 348 - _cairo_surface_attach_snapshot (src, similar, NULL);
michael@0 349 + cairo_surface_attach_snapshot (src, similar, NULL);
michael@0 350
michael@0 351 src_x = src_y = 0;
michael@0 352 }
michael@0 353
michael@0 354 *clone_out = similar;
michael@0 355 *clone_offset_x = src_x;
michael@0 356 *clone_offset_y = src_y;
michael@0 357 return CAIRO_STATUS_SUCCESS;
michael@0 358 diff --git a/gfx/cairo/cairo/src/cairo-vg-surface.c b/gfx/cairo/cairo/src/cairo-vg-surface.c
michael@0 359 --- a/gfx/cairo/cairo/src/cairo-vg-surface.c
michael@0 360 +++ b/gfx/cairo/cairo/src/cairo-vg-surface.c
michael@0 361 @@ -977,17 +977,17 @@ _vg_setup_surface_source (cairo_vg_conte
michael@0 362 status = _cairo_cache_insert (&context->snapshot_cache,
michael@0 363 &clone->snapshot_cache_entry);
michael@0 364 if (unlikely (status)) {
michael@0 365 clone->snapshot_cache_entry.hash = 0;
michael@0 366 cairo_surface_destroy (&clone->base);
michael@0 367 return status;
michael@0 368 }
michael@0 369
michael@0 370 - _cairo_surface_attach_snapshot (spat->surface, &clone->base,
michael@0 371 + cairo_surface_attach_snapshot (spat->surface, &clone->base,
michael@0 372 _vg_surface_remove_from_cache);
michael@0 373
michael@0 374 DONE:
michael@0 375 cairo_surface_destroy (&context->source->base);
michael@0 376 context->source = clone;
michael@0 377
michael@0 378 vgSetParameteri (context->paint, VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
michael@0 379
michael@0 380 diff --git a/gfx/cairo/cairo/src/cairo-xcb-surface.c b/gfx/cairo/cairo/src/cairo-xcb-surface.c
michael@0 381 --- a/gfx/cairo/cairo/src/cairo-xcb-surface.c
michael@0 382 +++ b/gfx/cairo/cairo/src/cairo-xcb-surface.c
michael@0 383 @@ -560,17 +560,17 @@ _cairo_xcb_surface_acquire_source_image
michael@0 384 image = (cairo_image_surface_t *) cairo_surface_reference (&image->base);
michael@0 385 goto DONE;
michael@0 386 }
michael@0 387
michael@0 388 status = _get_image (surface, FALSE, &image);
michael@0 389 if (unlikely (status))
michael@0 390 return status;
michael@0 391
michael@0 392 - _cairo_surface_attach_snapshot (&surface->base, &image->base, NULL);
michael@0 393 + cairo_surface_attach_snapshot (&surface->base, &image->base, NULL);
michael@0 394
michael@0 395 DONE:
michael@0 396 *image_out = image;
michael@0 397 *image_extra = NULL;
michael@0 398 return CAIRO_STATUS_SUCCESS;
michael@0 399 }
michael@0 400
michael@0 401 static void
michael@0 402 @@ -713,17 +713,17 @@ _cairo_xcb_surface_flush (void *abstract
michael@0 403 status = cairo_surface_status (surface->fallback);
michael@0 404
michael@0 405 if (status == CAIRO_STATUS_SUCCESS) {
michael@0 406 status = _put_image (surface,
michael@0 407 (cairo_image_surface_t *) surface->fallback);
michael@0 408 }
michael@0 409
michael@0 410 if (status == CAIRO_STATUS_SUCCESS) {
michael@0 411 - _cairo_surface_attach_snapshot (&surface->base,
michael@0 412 + cairo_surface_attach_snapshot (&surface->base,
michael@0 413 surface->fallback,
michael@0 414 cairo_surface_finish);
michael@0 415 }
michael@0 416 }
michael@0 417
michael@0 418 cairo_surface_destroy (surface->fallback);
michael@0 419 surface->fallback = NULL;
michael@0 420
michael@0 421 diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h
michael@0 422 --- a/gfx/cairo/cairo/src/cairo.h
michael@0 423 +++ b/gfx/cairo/cairo/src/cairo.h
michael@0 424 @@ -214,16 +214,25 @@ typedef struct _cairo_pattern cairo_patt
michael@0 425 *
michael@0 426 * #cairo_destroy_func_t the type of function which is called when a
michael@0 427 * data element is destroyed. It is passed the pointer to the data
michael@0 428 * element and should free any memory and resources allocated for it.
michael@0 429 **/
michael@0 430 typedef void (*cairo_destroy_func_t) (void *data);
michael@0 431
michael@0 432 /**
michael@0 433 + * cairo_surface_func_t:
michael@0 434 + * @surface: The surface being referred to.
michael@0 435 + *
michael@0 436 + * #cairo_surface_func_t the type of function which is used for callback
michael@0 437 + * when a surface needs to be apssed as a parameter.
michael@0 438 + */
michael@0 439 +typedef void (*cairo_surface_func_t) (cairo_surface_t *surface);
michael@0 440 +
michael@0 441 +/**
michael@0 442 * cairo_user_data_key_t:
michael@0 443 * @unused: not used; ignore.
michael@0 444 *
michael@0 445 * #cairo_user_data_key_t is used for attaching user data to cairo
michael@0 446 * data structures. The actual contents of the struct is never used,
michael@0 447 * and there is no need to initialize the object; only the unique
michael@0 448 * address of a #cairo_data_key_t object is used. Typically, you
michael@0 449 * would just use the address of a static #cairo_data_key_t object.
michael@0 450 @@ -2150,16 +2159,24 @@ cairo_surface_get_user_data (cairo_surfa
michael@0 451 const cairo_user_data_key_t *key);
michael@0 452
michael@0 453 cairo_public cairo_status_t
michael@0 454 cairo_surface_set_user_data (cairo_surface_t *surface,
michael@0 455 const cairo_user_data_key_t *key,
michael@0 456 void *user_data,
michael@0 457 cairo_destroy_func_t destroy);
michael@0 458
michael@0 459 +cairo_public void
michael@0 460 +cairo_surface_attach_snapshot (cairo_surface_t *surface,
michael@0 461 + cairo_surface_t *snapshot,
michael@0 462 + cairo_surface_func_t detach_func);
michael@0 463 +
michael@0 464 +cairo_public void
michael@0 465 +cairo_surface_detach_snapshot (cairo_surface_t *snapshot);
michael@0 466 +
michael@0 467 #define CAIRO_MIME_TYPE_JPEG "image/jpeg"
michael@0 468 #define CAIRO_MIME_TYPE_PNG "image/png"
michael@0 469 #define CAIRO_MIME_TYPE_JP2 "image/jp2"
michael@0 470 #define CAIRO_MIME_TYPE_URI "text/x-uri"
michael@0 471
michael@0 472 cairo_public void
michael@0 473 cairo_surface_get_mime_data (cairo_surface_t *surface,
michael@0 474 const char *mime_type,
michael@0 475 @@ -2328,16 +2345,21 @@ cairo_recording_surface_create (cairo_co
michael@0 476
michael@0 477 cairo_public void
michael@0 478 cairo_recording_surface_ink_extents (cairo_surface_t *surface,
michael@0 479 double *x0,
michael@0 480 double *y0,
michael@0 481 double *width,
michael@0 482 double *height);
michael@0 483
michael@0 484 +/* Null-surface functions */
michael@0 485 +
michael@0 486 +cairo_public cairo_surface_t *
michael@0 487 +cairo_null_surface_create (cairo_content_t content);
michael@0 488 +
michael@0 489 /* Pattern creation functions */
michael@0 490
michael@0 491 cairo_public cairo_pattern_t *
michael@0 492 cairo_pattern_create_rgb (double red, double green, double blue);
michael@0 493
michael@0 494 cairo_public cairo_pattern_t *
michael@0 495 cairo_pattern_create_rgba (double red, double green, double blue,
michael@0 496 double alpha);
michael@0 497 diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h
michael@0 498 --- a/gfx/cairo/cairo/src/cairoint.h
michael@0 499 +++ b/gfx/cairo/cairo/src/cairoint.h
michael@0 500 @@ -1770,27 +1770,19 @@ _cairo_surface_clone_similar (cairo_surf
michael@0 501 int height,
michael@0 502 int *clone_offset_x,
michael@0 503 int *clone_offset_y,
michael@0 504 cairo_surface_t **clone_out);
michael@0 505
michael@0 506 cairo_private cairo_surface_t *
michael@0 507 _cairo_surface_snapshot (cairo_surface_t *surface);
michael@0 508
michael@0 509 -cairo_private void
michael@0 510 -_cairo_surface_attach_snapshot (cairo_surface_t *surface,
michael@0 511 - cairo_surface_t *snapshot,
michael@0 512 - cairo_surface_func_t detach_func);
michael@0 513 -
michael@0 514 cairo_private cairo_surface_t *
michael@0 515 _cairo_surface_has_snapshot (cairo_surface_t *surface,
michael@0 516 - const cairo_surface_backend_t *backend);
michael@0 517 -
michael@0 518 -cairo_private void
michael@0 519 -_cairo_surface_detach_snapshot (cairo_surface_t *snapshot);
michael@0 520 + const cairo_surface_backend_t *backend);
michael@0 521
michael@0 522 cairo_private cairo_bool_t
michael@0 523 _cairo_surface_is_similar (cairo_surface_t *surface_a,
michael@0 524 cairo_surface_t *surface_b);
michael@0 525
michael@0 526 cairo_private cairo_bool_t
michael@0 527 _cairo_surface_get_extents (cairo_surface_t *surface,
michael@0 528 cairo_rectangle_int_t *extents);

mercurial