summaryrefslogtreecommitdiffstats
path: root/cairo/expose-snapshot-1.patch
blob: 402df42ae10499c331082d30d83d77bb28d97252 (plain)
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
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
Submitted By: Andrew Benton <andy@benton.eu.com>
Date: 2012-04-22
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


diff -Naur cairo-1.12.0.orig/src/cairo-analysis-surface.c cairo-1.12.0/src/cairo-analysis-surface.c
--- cairo-1.12.0.orig/src/cairo-analysis-surface.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/cairo-analysis-surface.c	2012-03-31 18:23:49.418555251 +0100
@@ -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;
 }
@@ -914,7 +914,7 @@
 };
 
 cairo_surface_t *
-_cairo_null_surface_create (cairo_content_t content)
+cairo_null_surface_create (cairo_content_t content)
 {
     cairo_surface_t *surface;
 
diff -Naur cairo-1.12.0.orig/src/cairo-analysis-surface-private.h cairo-1.12.0/src/cairo-analysis-surface-private.h
--- cairo-1.12.0.orig/src/cairo-analysis-surface-private.h	2010-06-13 20:57:57.000000000 +0100
+++ cairo-1.12.0/src/cairo-analysis-surface-private.h	2012-03-31 18:20:23.918442633 +0100
@@ -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 */
diff -Naur cairo-1.12.0.orig/src/cairo-cogl-surface.c cairo-1.12.0/src/cairo-cogl-surface.c
--- cairo-1.12.0.orig/src/cairo-cogl-surface.c	2012-03-12 08:25:12.000000000 +0000
+++ cairo-1.12.0/src/cairo-cogl-surface.c	2012-03-31 18:23:49.351889619 +0100
@@ -1399,7 +1399,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);
diff -Naur cairo-1.12.0.orig/src/cairo.h cairo-1.12.0/src/cairo.h
--- cairo-1.12.0.orig/src/cairo.h	2012-03-23 18:08:55.000000000 +0000
+++ cairo-1.12.0/src/cairo.h	2012-03-31 18:20:23.918442633 +0100
@@ -220,6 +220,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.
  *
@@ -2351,6 +2360,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"
@@ -2627,6 +2644,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 *
diff -Naur cairo-1.12.0.orig/src/cairo-image-source.c cairo-1.12.0/src/cairo-image-source.c
--- cairo-1.12.0.orig/src/cairo-image-source.c	2012-03-12 08:25:12.000000000 +0000
+++ cairo-1.12.0/src/cairo-image-source.c	2012-03-31 18:23:49.368556027 +0100
@@ -663,7 +663,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;
 }
diff -Naur cairo-1.12.0.orig/src/cairoint.h cairo-1.12.0/src/cairoint.h
--- cairo-1.12.0.orig/src/cairoint.h	2012-03-22 23:04:07.000000000 +0000
+++ cairo-1.12.0/src/cairoint.h	2012-03-31 18:20:23.918442633 +0100
@@ -1372,17 +1372,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 void
 _cairo_surface_begin_modification (cairo_surface_t *surface);
diff -Naur cairo-1.12.0.orig/src/cairo-recording-surface.c cairo-1.12.0/src/cairo-recording-surface.c
--- cairo-1.12.0.orig/src/cairo-recording-surface.c	2012-03-12 08:25:12.000000000 +0000
+++ cairo-1.12.0/src/cairo-recording-surface.c	2012-03-31 18:23:49.421888532 +0100
@@ -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;
 }
@@ -1634,7 +1634,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);
 
diff -Naur cairo-1.12.0.orig/src/cairo-script-surface.c cairo-1.12.0/src/cairo-script-surface.c
--- cairo-1.12.0.orig/src/cairo-script-surface.c	2012-02-29 12:10:06.000000000 +0000
+++ cairo-1.12.0/src/cairo-script-surface.c	2012-03-31 18:23:49.401888843 +0100
@@ -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);
 }
 
diff -Naur cairo-1.12.0.orig/src/cairo-surface.c cairo-1.12.0/src/cairo-surface.c
--- cairo-1.12.0.orig/src/cairo-surface.c	2012-03-12 08:25:12.000000000 +0000
+++ cairo-1.12.0/src/cairo-surface.c	2012-03-31 18:23:49.488554164 +0100
@@ -325,14 +325,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);
 
@@ -346,7 +346,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)
 {
@@ -356,7 +356,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;
@@ -390,7 +390,7 @@
 
     _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);
 }
@@ -897,7 +897,7 @@
     /* update the snapshots *before* we declare the surface as finished */
     _cairo_surface_detach_snapshots (surface);
     if (surface->snapshot_of != NULL)
-	_cairo_surface_detach_snapshot (surface);
+	cairo_surface_detach_snapshot (surface);
 
     surface->finished = TRUE;
 
diff -Naur cairo-1.12.0.orig/src/cairo-surface-private.h cairo-1.12.0/src/cairo-surface-private.h
--- cairo-1.12.0.orig/src/cairo-surface-private.h	2012-02-15 14:20:37.000000000 +0000
+++ cairo-1.12.0/src/cairo-surface-private.h	2012-03-31 18:20:23.918442633 +0100
@@ -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;
diff -Naur cairo-1.12.0.orig/src/cairo-surface-snapshot.c cairo-1.12.0/src/cairo-surface-snapshot.c
--- cairo-1.12.0.orig/src/cairo-surface-snapshot.c	2012-02-29 12:10:06.000000000 +0000
+++ cairo-1.12.0/src/cairo-surface-snapshot.c	2012-03-31 18:23:49.368556027 +0100
@@ -242,7 +242,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);
 
diff -Naur cairo-1.12.0.orig/src/cairo-surface-subsurface.c cairo-1.12.0/src/cairo-surface-subsurface.c
--- cairo-1.12.0.orig/src/cairo-surface-subsurface.c	2012-03-13 20:54:35.000000000 +0000
+++ cairo-1.12.0/src/cairo-surface-subsurface.c	2012-03-31 18:23:49.488554164 +0100
@@ -564,10 +564,10 @@
 	    ss->target->unique_id, snapshot->unique_id));
 
     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);
 }
diff -Naur cairo-1.12.0.orig/src/cairo-vg-surface.c cairo-1.12.0/src/cairo-vg-surface.c
--- cairo-1.12.0.orig/src/cairo-vg-surface.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/cairo-vg-surface.c	2012-03-31 18:23:49.381889154 +0100
@@ -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:
diff -Naur cairo-1.12.0.orig/src/cairo-xcb-surface.c cairo-1.12.0/src/cairo-xcb-surface.c
--- cairo-1.12.0.orig/src/cairo-xcb-surface.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/cairo-xcb-surface.c	2012-03-31 18:23:49.365222745 +0100
@@ -494,7 +494,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;
@@ -737,7 +737,7 @@
 				       &surface->fallback_damage);
 
 	if (status == CAIRO_STATUS_SUCCESS) {
-	    _cairo_surface_attach_snapshot (&surface->base,
+	    cairo_surface_attach_snapshot (&surface->base,
 					    &surface->fallback->base,
 					    cairo_surface_finish);
 	}
diff -Naur cairo-1.12.0.orig/src/cairo-xcb-surface-core.c cairo-1.12.0/src/cairo-xcb-surface-core.c
--- cairo-1.12.0.orig/src/cairo-xcb-surface-core.c	2012-02-02 00:47:50.000000000 +0000
+++ cairo-1.12.0/src/cairo-xcb-surface-core.c	2012-03-31 18:23:49.365222745 +0100
@@ -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 ||
diff -Naur cairo-1.12.0.orig/src/cairo-xcb-surface-render.c cairo-1.12.0/src/cairo-xcb-surface-render.c
--- cairo-1.12.0.orig/src/cairo-xcb-surface-render.c	2012-02-02 00:47:50.000000000 +0000
+++ cairo-1.12.0/src/cairo-xcb-surface-render.c	2012-03-31 18:23:49.391888998 +0100
@@ -1284,7 +1284,7 @@
 	    return picture;
     }
 
-    _cairo_surface_attach_snapshot (source,
+    cairo_surface_attach_snapshot (source,
 				    &picture->base,
 				    NULL);
 
diff -Naur cairo-1.12.0.orig/src/cairo-xlib-source.c cairo-1.12.0/src/cairo-xlib-source.c
--- cairo-1.12.0.orig/src/cairo-xlib-source.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/cairo-xlib-source.c	2012-03-31 18:23:49.491887446 +0100
@@ -790,7 +790,7 @@
 	_cairo_surface_has_snapshot (&src->base, dst->base.backend);
     if (snapshot == NULL || snapshot->screen != dst->screen) {
 	if (snapshot)
-	    _cairo_surface_detach_snapshot (&snapshot->base);
+	    cairo_surface_detach_snapshot (&snapshot->base);
 
 	snapshot = (cairo_xlib_surface_t *)
 	    _cairo_surface_create_similar_scratch (&dst->base,
@@ -811,7 +811,7 @@
 	    return _cairo_surface_create_in_error (status);
 	}
 
-	_cairo_surface_attach_snapshot (&src->base,
+	cairo_surface_attach_snapshot (&src->base,
 					&snapshot->base,
 					cairo_surface_finish);
 
diff -Naur cairo-1.12.0.orig/src/drm/cairo-drm-i915-shader.c cairo-1.12.0/src/drm/cairo-drm-i915-shader.c
--- cairo-1.12.0.orig/src/drm/cairo-drm-i915-shader.c	2012-02-02 00:47:50.000000000 +0000
+++ cairo-1.12.0/src/drm/cairo-drm-i915-shader.c	2012-03-31 18:23:49.331889930 +0100
@@ -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);
 
diff -Naur cairo-1.12.0.orig/src/drm/cairo-drm-i965-shader.c cairo-1.12.0/src/drm/cairo-drm-i965-shader.c
--- cairo-1.12.0.orig/src/drm/cairo-drm-i965-shader.c	2012-03-12 08:25:12.000000000 +0000
+++ cairo-1.12.0/src/drm/cairo-drm-i965-shader.c	2012-03-31 18:23:49.481887600 +0100
@@ -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;
 	    }
 
diff -Naur cairo-1.12.0.orig/src/drm/cairo-drm-intel-surface.c cairo-1.12.0/src/drm/cairo-drm-intel-surface.c
--- cairo-1.12.0.orig/src/drm/cairo-drm-intel-surface.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/drm/cairo-drm-intel-surface.c	2012-03-31 18:23:49.318556804 +0100
@@ -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);
diff -Naur cairo-1.12.0.orig/src/drm/cairo-drm-radeon-surface.c cairo-1.12.0/src/drm/cairo-drm-radeon-surface.c
--- cairo-1.12.0.orig/src/drm/cairo-drm-radeon-surface.c	2012-02-12 09:46:01.000000000 +0000
+++ cairo-1.12.0/src/drm/cairo-drm-radeon-surface.c	2012-03-31 18:23:49.331889930 +0100
@@ -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);
diff -Naur cairo-1.12.0.orig/test/xcb-snapshot-assert.c cairo-1.12.0/test/xcb-snapshot-assert.c
--- cairo-1.12.0.orig/test/xcb-snapshot-assert.c	2012-02-02 00:47:51.000000000 +0000
+++ cairo-1.12.0/test/xcb-snapshot-assert.c	2012-03-31 18:23:49.421888532 +0100
@@ -60,7 +60,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,
diff -Naur cairo-1.12.0.orig/test/xcb-stress-cache.c cairo-1.12.0/test/xcb-stress-cache.c
--- cairo-1.12.0.orig/test/xcb-stress-cache.c	2012-02-02 00:47:51.000000000 +0000
+++ cairo-1.12.0/test/xcb-stress-cache.c	2012-03-31 18:23:49.498554008 +0100
@@ -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.