public

  • Download Gist
cairo-1.12.8-expose_snapshot-1.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370
Submitted By: Armin K. <krejzi at email dot com>
Initial Package Version: 1.12.0
Upstream Status: Unknown
Origin: Mozilla. From the Firefox-12 source.
Description: this is gfx/cairo/expose-snapshot.patch applied to the system
Cairo to expose some private functions. It allows Firefox to
be compiled with --enable-system-cairo
More details https://bugzilla.mozilla.org/show_bug.cgi?id=722975
Based on Andy's patch, but rediffed for Cairo 1.12.4.
 
--- cairo.orig/src/cairo-analysis-surface.c 2012-04-29 11:04:27.000000000 +0200
+++ cairo/src/cairo-analysis-surface.c 2012-10-07 20:22:22.407783487 +0200
@@ -125,7 +125,7 @@
_cairo_surface_init (&proxy->base, &proxy_backend, NULL, target->content);
proxy->target = target;
- _cairo_surface_attach_snapshot (source, &proxy->base, NULL);
+ cairo_surface_attach_snapshot (source, &proxy->base, NULL);
return &proxy->base;
}
@@ -916,7 +916,7 @@
};
cairo_surface_t *
-_cairo_null_surface_create (cairo_content_t content)
+cairo_null_surface_create (cairo_content_t content)
{
cairo_surface_t *surface;
--- cairo.orig/src/cairo-analysis-surface-private.h 2010-06-13 21:58:21.000000000 +0200
+++ cairo/src/cairo-analysis-surface-private.h 2012-10-07 20:22:22.407783487 +0200
@@ -68,7 +68,4 @@
_cairo_analysis_surface_merge_status (cairo_int_status_t status_a,
cairo_int_status_t status_b);
-cairo_private cairo_surface_t *
-_cairo_null_surface_create (cairo_content_t content);
-
#endif /* CAIRO_ANALYSIS_SURFACE_H */
--- cairo.orig/src/cairo-cogl-surface.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/cairo-cogl-surface.c 2012-10-07 20:22:22.407783487 +0200
@@ -1403,7 +1403,7 @@
reference_surface->ignore_alpha,
NULL, COGL_TEXTURE (texture));
- _cairo_surface_attach_snapshot (abstract_surface, clone, NULL);
+ cairo_surface_attach_snapshot (abstract_surface, clone, NULL);
/* Attaching the snapshot will take a reference on the clone surface... */
cairo_surface_destroy (clone);
--- cairo.orig/src/cairo.h 2012-03-29 12:05:32.000000000 +0200
+++ cairo/src/cairo.h 2012-10-07 20:22:22.408783503 +0200
@@ -232,6 +232,15 @@
typedef void (*cairo_destroy_func_t) (void *data);
/**
+ * cairo_surface_func_t:
+ * @surface: The surface being referred to.
+ *
+ * #cairo_surface_func_t the type of function which is used for callback
+ * when a surface needs to be passed as a parameter.
+ */
+typedef void (*cairo_surface_func_t) (cairo_surface_t *surface);
+
+/**
* cairo_user_data_key_t:
* @unused: not used; ignore.
*
@@ -2414,6 +2423,14 @@
void *user_data,
cairo_destroy_func_t destroy);
+cairo_public void
+cairo_surface_attach_snapshot (cairo_surface_t *surface,
+ cairo_surface_t *snapshot,
+ cairo_surface_func_t detach_func);
+
+cairo_public void
+cairo_surface_detach_snapshot (cairo_surface_t *snapshot);
+
#define CAIRO_MIME_TYPE_JPEG "image/jpeg"
#define CAIRO_MIME_TYPE_PNG "image/png"
#define CAIRO_MIME_TYPE_JP2 "image/jp2"
@@ -2690,6 +2707,11 @@
cairo_public cairo_raster_source_finish_func_t
cairo_raster_source_pattern_get_finish (cairo_pattern_t *pattern);
+/* Null-surface functions */
+
+cairo_public cairo_surface_t *
+cairo_null_surface_create (cairo_content_t content);
+
/* Pattern creation functions */
cairo_public cairo_pattern_t *
--- cairo.orig/src/cairo-image-source.c 2012-04-29 11:04:27.000000000 +0200
+++ cairo/src/cairo-image-source.c 2012-10-07 20:22:22.408783503 +0200
@@ -670,7 +670,7 @@
_cairo_surface_init (&proxy->base, &proxy_backend, NULL, image->content);
proxy->image = image;
- _cairo_surface_attach_snapshot (source, &proxy->base, NULL);
+ cairo_surface_attach_snapshot (source, &proxy->base, NULL);
return &proxy->base;
}
--- cairo.orig/src/cairoint.h 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/cairoint.h 2012-10-07 20:22:22.409783519 +0200
@@ -1382,17 +1382,9 @@
cairo_private cairo_surface_t *
_cairo_surface_snapshot (cairo_surface_t *surface);
-cairo_private void
-_cairo_surface_attach_snapshot (cairo_surface_t *surface,
- cairo_surface_t *snapshot,
- cairo_surface_func_t detach_func);
-
cairo_private cairo_surface_t *
_cairo_surface_has_snapshot (cairo_surface_t *surface,
- const cairo_surface_backend_t *backend);
-
-cairo_private void
-_cairo_surface_detach_snapshot (cairo_surface_t *snapshot);
+ const cairo_surface_backend_t *backend);
cairo_private cairo_status_t
_cairo_surface_begin_modification (cairo_surface_t *surface);
--- cairo.orig/src/cairo-recording-surface.c 2012-10-05 15:06:00.000000000 +0200
+++ cairo/src/cairo-recording-surface.c 2012-10-07 20:22:22.410783534 +0200
@@ -553,7 +553,7 @@
_cairo_surface_init (&proxy->base, &proxy_backend, NULL, image->content);
proxy->image = image;
- _cairo_surface_attach_snapshot (source, &proxy->base, NULL);
+ cairo_surface_attach_snapshot (source, &proxy->base, NULL);
return &proxy->base;
}
@@ -1944,7 +1944,7 @@
cairo_surface_t *analysis_surface;
cairo_status_t status;
- null_surface = _cairo_null_surface_create (surface->base.content);
+ null_surface = cairo_null_surface_create (surface->base.content);
analysis_surface = _cairo_analysis_surface_create (null_surface);
cairo_surface_destroy (null_surface);
--- cairo.orig/src/cairo-script-surface.c 2012-04-29 11:04:27.000000000 +0200
+++ cairo/src/cairo-script-surface.c 2012-10-07 20:22:22.410783534 +0200
@@ -1117,7 +1117,7 @@
"dup /s%d exch def ",
surface->base.unique_id);
- _cairo_surface_attach_snapshot (source, &surface->base, detach_snapshot);
+ cairo_surface_attach_snapshot (source, &surface->base, detach_snapshot);
cairo_surface_destroy (&surface->base);
}
--- cairo.orig/src/cairo-surface.c 2012-09-27 22:38:56.000000000 +0200
+++ cairo/src/cairo-surface.c 2012-10-07 20:25:31.030695973 +0200
@@ -330,14 +330,14 @@
_cairo_surface_detach_snapshots (cairo_surface_t *surface)
{
while (_cairo_surface_has_snapshots (surface)) {
- _cairo_surface_detach_snapshot (cairo_list_first_entry (&surface->snapshots,
+ cairo_surface_detach_snapshot (cairo_list_first_entry (&surface->snapshots,
cairo_surface_t,
snapshot));
}
}
void
-_cairo_surface_detach_snapshot (cairo_surface_t *snapshot)
+cairo_surface_detach_snapshot (cairo_surface_t *snapshot)
{
assert (snapshot->snapshot_of != NULL);
@@ -351,7 +351,7 @@
}
void
-_cairo_surface_attach_snapshot (cairo_surface_t *surface,
+cairo_surface_attach_snapshot (cairo_surface_t *surface,
cairo_surface_t *snapshot,
cairo_surface_func_t detach_func)
{
@@ -361,7 +361,7 @@
cairo_surface_reference (snapshot);
if (snapshot->snapshot_of != NULL)
- _cairo_surface_detach_snapshot (snapshot);
+ cairo_surface_detach_snapshot (snapshot);
snapshot->snapshot_of = surface;
snapshot->snapshot_detach = detach_func;
@@ -1461,7 +1461,7 @@
/* update the current snapshots *before* the user updates the surface */
_cairo_surface_detach_snapshots (surface);
if (surface->snapshot_of != NULL)
- _cairo_surface_detach_snapshot (surface);
+ cairo_surface_detach_snapshot (surface);
_cairo_surface_detach_mime_data (surface);
return __cairo_surface_flush (surface, flags);
--- cairo.orig/src/cairo-surface-private.h 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/cairo-surface-private.h 2012-10-07 20:22:22.412783564 +0200
@@ -46,8 +46,6 @@
#include "cairo-clip-private.h"
#include "cairo-surface-backend-private.h"
-typedef void (*cairo_surface_func_t) (cairo_surface_t *);
-
struct _cairo_surface {
const cairo_surface_backend_t *backend;
cairo_device_t *device;
--- cairo.orig/src/cairo-surface-snapshot.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/cairo-surface-snapshot.c 2012-10-07 20:22:22.412783564 +0200
@@ -281,7 +281,7 @@
snapshot->base.device_transform = surface->device_transform;
snapshot->base.device_transform_inverse = surface->device_transform_inverse;
- _cairo_surface_attach_snapshot (surface,
+ cairo_surface_attach_snapshot (surface,
&snapshot->base,
_cairo_surface_snapshot_copy_on_write);
--- cairo.orig/src/cairo-surface-subsurface.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/cairo-surface-subsurface.c 2012-10-07 20:22:22.412783564 +0200
@@ -562,10 +562,10 @@
return;
if (ss->snapshot)
- _cairo_surface_detach_snapshot (ss->snapshot);
+ cairo_surface_detach_snapshot (ss->snapshot);
ss->snapshot = cairo_surface_reference (snapshot);
- _cairo_surface_attach_snapshot (ss->target, &ss->base,
+ cairo_surface_attach_snapshot (ss->target, &ss->base,
_cairo_surface_subsurface_detach_snapshot);
}
--- cairo.orig/src/cairo-vg-surface.c 2012-04-19 14:17:58.000000000 +0200
+++ cairo/src/cairo-vg-surface.c 2012-10-07 20:22:22.413783579 +0200
@@ -986,7 +986,7 @@
return status;
}
- _cairo_surface_attach_snapshot (spat->surface, &clone->base,
+ cairo_surface_attach_snapshot (spat->surface, &clone->base,
_vg_surface_remove_from_cache);
DONE:
--- cairo.orig/src/cairo-xcb-surface.c 2012-09-27 22:38:56.000000000 +0200
+++ cairo/src/cairo-xcb-surface.c 2012-10-07 20:22:58.916347305 +0200
@@ -500,7 +500,7 @@
if (unlikely (image->status))
return image->status;
- _cairo_surface_attach_snapshot (&surface->base, image, NULL);
+ cairo_surface_attach_snapshot (&surface->base, image, NULL);
DONE:
*image_out = (cairo_image_surface_t *) image;
@@ -748,7 +748,7 @@
&surface->fallback_damage);
if (status == CAIRO_STATUS_SUCCESS && ! surface->base._finishing) {
- _cairo_surface_attach_snapshot (&surface->base,
+ cairo_surface_attach_snapshot (&surface->base,
&surface->fallback->base,
cairo_surface_finish);
}
--- cairo.orig/src/cairo-xcb-surface-core.c 2012-02-02 01:48:14.000000000 +0100
+++ cairo/src/cairo-xcb-surface-core.c 2012-10-07 20:22:22.414783595 +0200
@@ -440,7 +440,7 @@
if (unlikely (pixmap->base.status))
return pixmap;
- _cairo_surface_attach_snapshot (source, &pixmap->base, NULL);
+ cairo_surface_attach_snapshot (source, &pixmap->base, NULL);
if (pattern->base.extend != CAIRO_EXTEND_NONE) {
if (extents->x < 0 || extents->y < 0 ||
--- cairo.orig/src/cairo-xcb-surface-render.c 2012-09-27 22:38:56.000000000 +0200
+++ cairo/src/cairo-xcb-surface-render.c 2012-10-07 20:22:22.414783595 +0200
@@ -1295,7 +1295,7 @@
return picture;
}
- _cairo_surface_attach_snapshot (source,
+ cairo_surface_attach_snapshot (source,
&picture->base,
NULL);
--- cairo.orig/src/drm/cairo-drm-i915-shader.c 2012-02-02 01:48:14.000000000 +0100
+++ cairo/src/drm/cairo-drm-i915-shader.c 2012-10-07 20:22:22.416783627 +0200
@@ -1656,7 +1656,7 @@
image, &s);
if (likely (status == CAIRO_STATUS_SUCCESS)) {
- _cairo_surface_attach_snapshot (surface,
+ cairo_surface_attach_snapshot (surface,
&s->intel.drm.base,
intel_surface_detach_snapshot);
--- cairo.orig/src/drm/cairo-drm-i965-shader.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/drm/cairo-drm-i965-shader.c 2012-10-07 20:22:22.416783627 +0200
@@ -281,7 +281,7 @@
return status;
}
- _cairo_surface_attach_snapshot (&image->base,
+ cairo_surface_attach_snapshot (&image->base,
&clone->intel.drm.base,
intel_surface_detach_snapshot);
@@ -567,7 +567,7 @@
if (bo->purgeable &&
! intel_bo_madvise (&device->intel, bo, I915_MADV_WILLNEED))
{
- _cairo_surface_detach_snapshot (&s->intel.drm.base);
+ cairo_surface_detach_snapshot (&s->intel.drm.base);
s = NULL;
}
--- cairo.orig/src/drm/cairo-drm-intel-surface.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/drm/cairo-drm-intel-surface.c 2012-10-07 20:22:22.417783642 +0200
@@ -105,7 +105,7 @@
if (unlikely (image->status))
return image->status;
- _cairo_surface_attach_snapshot (&surface->drm.base, image, surface_finish_and_destroy);
+ cairo_surface_attach_snapshot (&surface->drm.base, image, surface_finish_and_destroy);
DONE:
*image_out = (cairo_image_surface_t *) cairo_surface_reference (image);
--- cairo.orig/src/drm/cairo-drm-radeon-surface.c 2012-09-13 13:38:21.000000000 +0200
+++ cairo/src/drm/cairo-drm-radeon-surface.c 2012-10-07 20:22:22.417783642 +0200
@@ -107,7 +107,7 @@
if (unlikely (status))
return status;
- _cairo_surface_attach_snapshot (&surface->base.base, image, cairo_surface_destroy);
+ cairo_surface_attach_snapshot (&surface->base.base, image, cairo_surface_destroy);
DONE:
*image_out = (cairo_image_surface_t *) cairo_surface_reference (image);
--- cairo.orig/test/xcb-snapshot-assert.c 2012-05-24 11:15:54.000000000 +0200
+++ cairo/test/xcb-snapshot-assert.c 2012-10-07 20:22:22.417783642 +0200
@@ -68,7 +68,7 @@
}
CAIRO_TEST (xcb_snapshot_assert,
- "Test a wrong _cairo_surface_attach_snapshot call",
+ "Test a wrong cairo_surface_attach_snapshot call",
"xcb", /* keywords */
NULL, /* requirements */
2, 2,
--- cairo.orig/test/xcb-stress-cache.c 2012-02-02 01:48:15.000000000 +0100
+++ cairo/test/xcb-stress-cache.c 2012-10-07 20:22:22.417783642 +0200
@@ -48,7 +48,7 @@
* already full, so a random cache entry is picked and removed.
* - The surface that was added before is picked and gets fed to
* _surface_cache_entry_destroy.
- * - This calls _cairo_surface_detach_snapshot which causes the
+ * - This calls cairo_surface_detach_snapshot which causes the
* detach_func from above to be called, so the surface is finished and the
* associated picture is FreePicture'd.
* - _composite_mask now uses a Picture that was already freed.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.