]>
Commit | Line | Data |
---|---|---|
5c9ac4e2 JR |
1 | diff -r baec1efc87a4 gfx/thebes/gfxPlatform.cpp |
2 | --- a/mozilla/gfx/thebes/gfxPlatform.cpp Sun Mar 04 00:38:41 2012 +0000 | |
3 | +++ b/mozilla/gfx/thebes/gfxPlatform.cpp Wed May 16 17:37:10 2012 +0200 | |
4 | @@ -448,21 +448,19 @@ gfxPlatform::CreateDrawTargetForSurface( | |
5 | ||
6 | cairo_user_data_key_t kSourceSurface; | |
7 | ||
8 | void SourceBufferDestroy(void *srcBuffer) | |
9 | { | |
10 | static_cast<SourceSurface*>(srcBuffer)->Release(); | |
11 | } | |
12 | ||
13 | -void SourceSnapshotDetached(cairo_surface_t *nullSurf) | |
14 | +void SourceSnapshotDetached(void *nullSurf) | |
15 | { | |
16 | - gfxImageSurface* origSurf = | |
17 | - static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface)); | |
18 | - | |
19 | + gfxImageSurface *origSurf = static_cast<gfxImageSurface*>(nullSurf); | |
20 | origSurf->SetData(&kSourceSurface, NULL, NULL); | |
21 | } | |
22 | ||
23 | RefPtr<SourceSurface> | |
24 | gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface) | |
25 | { | |
26 | void *userData = aSurface->GetData(&kSourceSurface); | |
27 | ||
28 | @@ -524,24 +522,18 @@ gfxPlatform::GetSourceSurfaceForSurface( | |
29 | NS_RUNTIMEABORT("Invalid surface format!"); | |
30 | } | |
31 | ||
32 | srcBuffer = aTarget->CreateSourceSurfaceFromData(imgSurface->Data(), | |
33 | IntSize(imgSurface->GetSize().width, imgSurface->GetSize().height), | |
34 | imgSurface->Stride(), | |
35 | format); | |
36 | ||
37 | - cairo_surface_t *nullSurf = | |
38 | - cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA); | |
39 | - cairo_surface_set_user_data(nullSurf, | |
40 | - &kSourceSurface, | |
41 | - imgSurface, | |
42 | - NULL); | |
43 | - cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached); | |
44 | - cairo_surface_destroy(nullSurf); | |
45 | + cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic", | |
46 | + (const unsigned char *) "data", 4, SourceSnapshotDetached, imgSurface.get()); | |
47 | } | |
48 | ||
49 | srcBuffer->AddRef(); | |
50 | aSurface->SetData(&kSourceSurface, srcBuffer, SourceBufferDestroy); | |
51 | ||
52 | return srcBuffer; | |
53 | } | |
54 |