ports/www/libxul/files/patch-bug722975
Florian Smeets 96b39667d3 Update to 17.0.6 (this should also fix the build on head after the
clang 3.3 merge)

PR:             ports/179034 [1]
Submitted by:   Jan Beich <jbeich@tormail.org>,
                Nikolai Lifanov <lifanov@mail.lifanov.com> [1]
2013-06-04 15:47:49 +00:00

61 lines
2.1 KiB
Text

# HG changeset patch
# Parent 9d3c9b863c697634e434b687d456bb82fa794ecf
# User Uli Schlachter <psychon@znc.in>
Bug 722975 - --enable-system-cairo build is broken after Bug 715658 fixed
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
--- gfx/thebes/gfxPlatform.cpp
+++ gfx/thebes/gfxPlatform.cpp
@@ -484,21 +484,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);
@@ -588,24 +586,19 @@ gfxPlatform::GetSourceSurfaceForSurface(
}
srcBuffer = Factory::CreateWrappingDataSourceSurface(imgSurface->Data(),
imgSurface->Stride(),
size, 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;
}