Bug 666312. Check surface status instead of surface existance. r=mwoodrow
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 19 Nov 2011 01:39:14 +1300
changeset 80467 6606fa72c88176dd95547110de729f6242c69cc0
parent 80466 5549f4202af8ca34280d805ac92e7f691d6e8905
child 80468 e52370a94c8ded67c933c6aae5216bf479b68003
push id21500
push userbmo@edmorley.co.uk
push dateSat, 19 Nov 2011 13:04:35 +0000
treeherdermozilla-central@46c2bd7dbdd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwoodrow
bugs666312
milestone11.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 666312. Check surface status instead of surface existance. r=mwoodrow We always have cairo surfaces now instead of having NULL ones. We should check the status instead. This fixes crashes with the quartz and skia azure backends.
content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
@@ -3645,18 +3645,18 @@ nsCanvasRenderingContext2DAzure::DrawIma
     nsLayoutUtils::SurfaceFromElementResult res =
       nsLayoutUtils::SurfaceFromElement(imgElt, sfeFlags);
 
     if (!res.mSurface) {
       // Spec says to silently do nothing if the element is still loading.
       return res.mIsStillLoading ? NS_OK : NS_ERROR_NOT_AVAILABLE;
     }
 
-    // Ignore nsnull cairo surfaces! See bug 666312.
-    if (!res.mSurface->CairoSurface()) {
+    // Ignore cairo surfaces that are bad! See bug 666312.
+    if (res.mSurface->CairoStatus()) {
       return NS_OK;
     }
 
     imgsurf = res.mSurface.forget();
     imgSize = res.mSize;
 
     if (mCanvasElement) {
       CanvasUtils::DoDrawImageSecurityCheck(HTMLCanvasElement(),