Include visible region changes in the cached invalid region for ContainerLayers. (bug 1381666 part 4, r=mattwoodrow)

This commit is contained in:
David Anderson 2017-07-31 12:29:18 -07:00
Родитель 264a0b8e7e
Коммит 427fc1d03c
1 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -421,10 +421,22 @@ public:
}
if (container->UseIntermediateSurface()) {
IntRect bounds = invalidateWholeLayer
? mLayer->GetLocalVisibleRegion().ToUnknownRegion().GetBounds()
: result.GetBounds();
container->SetInvalidCompositeRect(bounds);
Maybe<IntRect> bounds;
if (!invalidateWholeLayer) {
bounds = Some(result.GetBounds());
// Process changes in the visible region.
IntRegion newVisible = mLayer->GetLocalVisibleRegion().ToUnknownRegion();
if (!newVisible.IsEqual(mVisibleRegion)) {
newVisible.XorWith(mVisibleRegion);
bounds = bounds->SafeUnion(newVisible.GetBounds());
}
}
if (!bounds) {
bounds = Some(mLayer->GetLocalVisibleRegion().GetBounds().ToUnknownRect());
}
container->SetInvalidCompositeRect(bounds.value());
}
if (!mLayer->Extend3DContext()) {