Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Fri, 02 May 2014 14:28:52 +1200
changeset 192207 0a9afc76690cad796e2da505513903be26d567f0
parent 192206 f15b4b99adc4298a6ddaacb1a2e8e55f040d588e
child 192208 c0f1a5d2645b480b42d2f759dee15f6f054678b0
push id3524
push userryanvm@gmail.com
push dateTue, 06 May 2014 13:39:24 +0000
treeherdermozilla-beta@02e1dd202d67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBas, sledru
bugs952721
milestone30.0
Bug 952721 - Don't crash if our surface allocation fails in TiledContentClient. r=Bas, a=sledru
gfx/layers/client/TiledContentClient.cpp
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -659,16 +659,20 @@ ClientTiledLayerBuffer::PaintThebes(cons
           GetContentType());
 
       mSinglePaintDrawTarget =
         gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(
           gfx::IntSize(ceilf(bounds.width * mResolution),
                        ceilf(bounds.height * mResolution)),
           gfx::ImageFormatToSurfaceFormat(format));
 
+      if (!mSinglePaintDrawTarget) {
+        return;
+      }
+
       ctxt = new gfxContext(mSinglePaintDrawTarget);
 
       mSinglePaintBufferOffset = nsIntPoint(bounds.x, bounds.y);
     }
     ctxt->NewPath();
     ctxt->Scale(mResolution, mResolution);
     ctxt->Translate(gfxPoint(-bounds.x, -bounds.y));
 #ifdef GFX_TILEDLAYER_PREF_WARNINGS