mirror of
https://abf.rosa.ru/djam/firefox-esr91.git
synced 2025-02-25 10:02:59 +00:00
56 lines
1.9 KiB
Diff
56 lines
1.9 KiB
Diff
![]() |
diff -r baec1efc87a4 gfx/thebes/gfxPlatform.cpp
|
||
|
--- a/gfx/thebes/gfxPlatform.cpp Sun Mar 04 00:38:41 2012 +0000
|
||
|
+++ b/gfx/thebes/gfxPlatform.cpp Wed May 16 17:37:10 2012 +0200
|
||
|
@@ -448,21 +448,19 @@ gfxPlatform::CreateDrawTargetForSurface(
|
||
|
|
||
|
cairo_user_data_key_t kSourceSurface;
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
RefPtr<SourceSurface>
|
||
|
gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface)
|
||
|
{
|
||
|
void *userData = aSurface->GetData(&kSourceSurface);
|
||
|
|
||
|
@@ -524,24 +522,18 @@ gfxPlatform::GetSourceSurfaceForSurface(
|
||
|
NS_RUNTIMEABORT("Invalid surface format!");
|
||
|
}
|
||
|
|
||
|
srcBuffer = aTarget->CreateSourceSurfaceFromData(imgSurface->Data(),
|
||
|
IntSize(imgSurface->GetSize().width, imgSurface->GetSize().height),
|
||
|
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();
|
||
|
aSurface->SetData(&kSourceSurface, srcBuffer, SourceBufferDestroy);
|
||
|
|
||
|
return srcBuffer;
|
||
|
}
|
||
|
|
||
|
|