Bug 945314 - Workaround crash with Cairo surfaces in Skia backend. r=mstange
authorKevin Simons <kevin@comoyo.com>
Tue, 03 Dec 2013 08:52:06 -0500
changeset 174205 efc30ce15377d80715992055b403ec1a3a29a5e6
parent 174204 539fb8b1b9e3d0a512bd2855e62bbdf516f62725
child 174206 2ae6663f558c4241302066e46b8cc57e8a2d6f69
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs945314, 924102
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 945314 - Workaround crash with Cairo surfaces in Skia backend. r=mstange A patch for bug 924102 introduced a MOZ_CRASH assertion for surfaces of type other than SURFACE_SKIA or SURFACE_DATA being passed to DrawSurface. Previously surfaces of other types were simply ignored. On Linux, there are still several hardcoded surfaces of type Cairo (found in gfxXlibNativeRenderer and friends) and as a result, the Skia backend crashes always on Linux currently. This workaround ignores Cairo surfaces passed to DrawSurface.
gfx/2d/DrawTargetSkia.cpp
--- a/gfx/2d/DrawTargetSkia.cpp
+++ b/gfx/2d/DrawTargetSkia.cpp
@@ -350,16 +350,20 @@ DrawTargetSkia::Flush()
 
 void
 DrawTargetSkia::DrawSurface(SourceSurface *aSurface,
                             const Rect &aDest,
                             const Rect &aSource,
                             const DrawSurfaceOptions &aSurfOptions,
                             const DrawOptions &aOptions)
 {
+  if (!(aSurface->GetType() == SURFACE_SKIA || aSurface->GetType() == SURFACE_DATA)) {
+    return;
+  }
+
   if (aSource.IsEmpty()) {
     return;
   }
 
   MarkChanged();
 
   IntRect sourceIntRect;
   bool integerAligned = aSource.ToIntRect(&sourceIntRect);