Bug 996745: Do not try to FinalizeFrame when there is no buffer. r=mattwoodrow
authorBas Schouten <bschouten@mozilla.com>
Tue, 29 Apr 2014 22:33:11 +0200
changeset 181213 a0825a0c4bf9db30594bdf779e5d7ffec19b84fa
parent 181212 522dc31908beeb5484cbd720cbbf612bbec14773
child 181214 58879e37779b71aeaf17352cb8407eb179eed858
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersmattwoodrow
bugs996745
milestone32.0a1
Bug 996745: Do not try to FinalizeFrame when there is no buffer. r=mattwoodrow
gfx/layers/RotatedBuffer.cpp
--- a/gfx/layers/RotatedBuffer.cpp
+++ b/gfx/layers/RotatedBuffer.cpp
@@ -511,20 +511,22 @@ RotatedContentBuffer::BeginPaint(ThebesL
   NS_ASSERTION(destBufferRect.Contains(neededRegion.GetBounds()),
                "Destination rect doesn't contain what we need to paint");
 
   result.mRegionToDraw.Sub(neededRegion, validRegion);
 
   if (result.mRegionToDraw.IsEmpty())
     return result;
 
-  // Do not modify result.mRegionToDraw or result.mContentType after this call.
-  // Do not modify mBufferRect, mBufferRotation, or mDidSelfCopy,
-  // or call CreateBuffer before this call.
-  FinalizeFrame(result.mRegionToDraw);
+  if (HaveBuffer()) {
+    // Do not modify result.mRegionToDraw or result.mContentType after this call.
+    // Do not modify mBufferRect, mBufferRotation, or mDidSelfCopy,
+    // or call CreateBuffer before this call.
+    FinalizeFrame(result.mRegionToDraw);
+  }
 
   nsIntRect drawBounds = result.mRegionToDraw.GetBounds();
   RefPtr<DrawTarget> destDTBuffer;
   RefPtr<DrawTarget> destDTBufferOnWhite;
   uint32_t bufferFlags = canHaveRotation ? ALLOW_REPEAT : 0;
   if (mode == SurfaceMode::SURFACE_COMPONENT_ALPHA) {
     bufferFlags |= BUFFER_COMPONENT_ALPHA;
   }