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:
Ryan Hunt
2017-11-04 14:52:31 -04:00
parent e21527085d
commit e17be41704

View File

@@ -253,12 +253,16 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
// If we have an existing front buffer, copy it into the new back buffer
if (RefPtr<RotatedBuffer> frontBuffer = GetFrontBuffer()) {
nsIntRegion updateRegion = newBuffer->BufferRect();
updateRegion.Sub(updateRegion, result.mRegionToDraw);
if (!updateRegion.IsEmpty()) {
RefPtr<CapturedBufferState> bufferState = new CapturedBufferState();
bufferState->mBufferCopy = Some(CapturedBufferState::Copy {
frontBuffer->ShallowCopy(),
newBuffer->ShallowCopy(),
newBuffer->BufferRect(),
updateRegion.GetBounds(),
});
// If we're async painting then return the buffer state to
@@ -272,6 +276,7 @@ ContentClient::BeginPaint(PaintedLayer* aLayer,
return result;
}
}
}
if (dest.mMustRemoveFrontBuffer) {
Clear();