summaryrefslogtreecommitdiff
path: root/libre/icecat/cairo.patch
blob: 981eff8835d62e913a63799b17bb42d765f8543b (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
From: Uli Schlachter <psychon@znc.in>
Date: Thu, 17 May 2012 10:51:11 +0200
Subject: Bug 722975 - Make system cairo work again

---
 gfx/thebes/gfxPlatform.cpp |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index fb06fba..a0edefc 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -436,11 +436,9 @@ void SourceBufferDestroy(void *srcBuffer)
   static_cast<SourceSurface*>(srcBuffer)->Release();
 }
 
-void SourceSnapshotDetached(cairo_surface_t *nullSurf)
+void SourceSnapshotDetached(void *nullSurf)
 {
-  gfxImageSurface* origSurf =
-    static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface));
-
+  gfxImageSurface *origSurf = static_cast<gfxImageSurface*>(nullSurf);
   origSurf->SetData(&kSourceSurface, NULL, NULL);
 }
 
@@ -512,14 +510,8 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa
                                                      imgSurface->Stride(),
                                                      format);
 
-    cairo_surface_t *nullSurf =
-	cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
-    cairo_surface_set_user_data(nullSurf,
-				&kSourceSurface,
-				imgSurface,
-				NULL);
-    cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached);
-    cairo_surface_destroy(nullSurf);
+    cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic",
+		(const unsigned char *) "data", 4, SourceSnapshotDetached, imgSurface.get());
   }
 
   srcBuffer->AddRef();