Bug 798990. No need to call EnsureTarget just to paint nothing. Anyway it's not safe to call it during a paint. r=kft
☠☠ backed out by 824316b5a366 ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 09 Oct 2012 00:47:54 +1300
changeset 113267 d22512e72e429ece699b986fc3f418b4cde393b3
parent 113266 e1fb91e37cb8c1d0848d58c3f442bb13b98bb8fb
child 113268 824316b5a366e5aa7fa4ab3fcf58737b433ebe20
push id2248
push userakeybl@mozilla.com
push dateMon, 08 Oct 2012 19:23:44 +0000
treeherdermozilla-aurora@118a3b748323 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskft
bugs798990
milestone18.0a1
Bug 798990. No need to call EnsureTarget just to paint nothing. Anyway it's not safe to call it during a paint. r=kft
content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2DAzure.cpp
@@ -4625,18 +4625,21 @@ nsCanvasRenderingContext2DAzure::SetMozI
 
 static uint8_t g2DContextLayerUserData;
 
 already_AddRefed<CanvasLayer>
 nsCanvasRenderingContext2DAzure::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                                 CanvasLayer *aOldLayer,
                                                 LayerManager *aManager)
 {
-  EnsureTarget();
-  if (!IsTargetValid()) {
+  // Don't call EnsureTarget() ... if there isn't already a surface, then
+  // we have nothing to paint and there is no need to create a surface just
+  // to paint nothing. Also, EnsureTarget() can cause creation of a persistent
+  // layer manager which must NOT happen during a paint.
+  if (!mTarget || !IsTargetValid()) {
     // No DidTransactionCallback will be received, so mark the context clean
     // now so future invalidations will be dispatched.
     MarkContextClean();
     return nullptr;
   }
 
   mTarget->Flush();