Don't copy over regions that will be painted in this frame (bug 1399692 part 8, r=bas)
We do the same in FinalizeFrame, so we should do it here. MozReview-Commit-ID: JTKDj8yrtI2
This commit is contained in:
@@ -253,23 +253,28 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
|
|||||||
|
|
||||||
// If we have an existing front buffer, copy it into the new back buffer
|
// If we have an existing front buffer, copy it into the new back buffer
|
||||||
if (RefPtr<RotatedBuffer> frontBuffer = GetFrontBuffer()) {
|
if (RefPtr<RotatedBuffer> frontBuffer = GetFrontBuffer()) {
|
||||||
RefPtr<CapturedBufferState> bufferState = new CapturedBufferState();
|
nsIntRegion updateRegion = newBuffer->BufferRect();
|
||||||
|
updateRegion.Sub(updateRegion, result.mRegionToDraw);
|
||||||
|
|
||||||
bufferState->mBufferCopy = Some(CapturedBufferState::Copy {
|
if (!updateRegion.IsEmpty()) {
|
||||||
frontBuffer->ShallowCopy(),
|
RefPtr<CapturedBufferState> bufferState = new CapturedBufferState();
|
||||||
newBuffer->ShallowCopy(),
|
|
||||||
newBuffer->BufferRect(),
|
|
||||||
});
|
|
||||||
|
|
||||||
// If we're async painting then return the buffer state to
|
bufferState->mBufferCopy = Some(CapturedBufferState::Copy {
|
||||||
// be dispatched to the paint thread, otherwise do it now
|
frontBuffer->ShallowCopy(),
|
||||||
if (asyncPaint) {
|
newBuffer->ShallowCopy(),
|
||||||
MOZ_ASSERT(!result.mBufferState);
|
updateRegion.GetBounds(),
|
||||||
result.mBufferState = bufferState;
|
});
|
||||||
} else {
|
|
||||||
if (!bufferState->PrepareBuffer()) {
|
// If we're async painting then return the buffer state to
|
||||||
gfxCriticalNote << "Failed to copy front buffer to back buffer.";
|
// be dispatched to the paint thread, otherwise do it now
|
||||||
return result;
|
if (asyncPaint) {
|
||||||
|
MOZ_ASSERT(!result.mBufferState);
|
||||||
|
result.mBufferState = bufferState;
|
||||||
|
} else {
|
||||||
|
if (!bufferState->PrepareBuffer()) {
|
||||||
|
gfxCriticalNote << "Failed to copy front buffer to back buffer.";
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user