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
--- 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,