Be sure to call ContentClient::BorrowDrawTargetForRecording in BorrowDrawTargetForPainting (bug 1409871 part 23, r?nical) draft
authorRyan Hunt <rhunt@eqrion.net>
Tue, 24 Oct 2017 09:36:51 -0500
changeset 685410 5bcd869fd8595caa4900e60467c935e68c547b7b
parent 684144 8431c6a7c40bea403850825461b252df92fe0378
child 737137 0cdb4d334143e9dfd5148a7c49db01058a66ee8a
push id85918
push userbmo:rhunt@eqrion.net
push dateTue, 24 Oct 2017 14:50:55 +0000
reviewersnical
bugs1409871
milestone58.0a1
Be sure to call ContentClient::BorrowDrawTargetForRecording in BorrowDrawTargetForPainting (bug 1409871 part 23, r?nical) This commit also amends BorrowDrawTargetForRecording to not check if the rotated buffer is locked as some implementations don't perform locking and therefore don't track it. There aren't any cases where PaintState.mMode is set and there is a buffer, but we're not locked so this shouldn't regress anything. MozReview-Commit-ID: KduOwjZOtbK
gfx/layers/client/ContentClient.cpp
--- a/gfx/layers/client/ContentClient.cpp
+++ b/gfx/layers/client/ContentClient.cpp
@@ -251,17 +251,17 @@ ContentClient::BeginPaint(PaintedLayer* 
   return result;
 }
 
 DrawTarget*
 ContentClient::BorrowDrawTargetForPainting(ContentClient::PaintState& aPaintState,
                                            RotatedBuffer::DrawIterator* aIter /* = nullptr */)
 {
   RefPtr<CapturedPaintState> capturedState =
-    BorrowDrawTargetForRecording(aPaintState, aIter, true);
+    ContentClient::BorrowDrawTargetForRecording(aPaintState, aIter, true);
 
   if (!capturedState) {
     return nullptr;
   }
 
   if (!ContentClient::PrepareDrawTargetForPainting(capturedState)) {
     return nullptr;
   }
@@ -290,18 +290,17 @@ ExpandDrawRegion(ContentClient::PaintSta
   return *drawPtr;
 }
 
 RefPtr<CapturedPaintState>
 ContentClient::BorrowDrawTargetForRecording(ContentClient::PaintState& aPaintState,
                                             RotatedBuffer::DrawIterator* aIter,
                                             bool aSetTransform)
 {
-  if (aPaintState.mMode == SurfaceMode::SURFACE_NONE ||
-      !mBuffer || !mBuffer->IsLocked()) {
+  if (aPaintState.mMode == SurfaceMode::SURFACE_NONE || !mBuffer) {
     return nullptr;
   }
 
   Matrix transform;
   DrawTarget* result = mBuffer->BorrowDrawTargetForQuadrantUpdate(
                                   aPaintState.mRegionToDraw.GetBounds(),
                                   RotatedBuffer::BUFFER_BOTH, aIter,
                                   aSetTransform,