Bug 1451458. Make sure we always clear items on size change. r=mstange

This changes the code around mFollowing group size changes to match
the code in DoGroupingForDisplayList. Specifically, it makes sure
we always ClearItems() on size changes even if we don't have a key.

--HG--
extra : rebase_source : 2063974082862906a2831bdd76ac86871ee3dbc3
This commit is contained in:
Jeff Muizelaar 2018-04-11 13:06:04 -04:00
Родитель f6f7d62d44
Коммит 0d0e71fde6
1 изменённых файлов: 12 добавлений и 13 удалений

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

@ -920,21 +920,20 @@ Grouper::ConstructGroups(WebRenderCommandBuilder* aCommandBuilder,
// tighter for just the sublist that made it into this group.
// We want to ensure the tight bounds are still clipped by area
// that we're building the display list for.
if (groupData->mFollowingGroup.mKey) {
if (!groupData->mFollowingGroup.mGroupBounds.IsEqualEdges(currentGroup->mGroupBounds) ||
groupData->mFollowingGroup.mScale != currentGroup->mScale ||
groupData->mFollowingGroup.mAppUnitsPerDevPixel != currentGroup->mAppUnitsPerDevPixel) {
if (groupData->mFollowingGroup.mAppUnitsPerDevPixel != currentGroup->mAppUnitsPerDevPixel) {
printf("app unit change following: %d %d\n", groupData->mFollowingGroup.mAppUnitsPerDevPixel, currentGroup->mAppUnitsPerDevPixel);
}
// The group changed size
GP("Inner group size change\n");
aCommandBuilder->mManager->AddImageKeyForDiscard(groupData->mFollowingGroup.mKey.value());
groupData->mFollowingGroup.mKey = Nothing();
groupData->mFollowingGroup.ClearItems();
if (!groupData->mFollowingGroup.mGroupBounds.IsEqualEdges(currentGroup->mGroupBounds) ||
groupData->mFollowingGroup.mScale != currentGroup->mScale ||
groupData->mFollowingGroup.mAppUnitsPerDevPixel != currentGroup->mAppUnitsPerDevPixel) {
if (groupData->mFollowingGroup.mAppUnitsPerDevPixel != currentGroup->mAppUnitsPerDevPixel) {
GP("app unit change following: %d %d\n", groupData->mFollowingGroup.mAppUnitsPerDevPixel, currentGroup->mAppUnitsPerDevPixel);
}
// The group changed size
GP("Inner group size change\n");
groupData->mFollowingGroup.ClearItems();
if (groupData->mFollowingGroup.mKey) {
IntSize size = currentGroup->mGroupBounds.Size().ScaleToNearestPixels(currentGroup->mScale.width, currentGroup->mScale.height, mAppUnitsPerDevPixel);
groupData->mFollowingGroup.mInvalidRect = IntRect(IntPoint(0, 0), size);
aCommandBuilder->mManager->AddImageKeyForDiscard(groupData->mFollowingGroup.mKey.value());
groupData->mFollowingGroup.mKey = Nothing();
}
}
groupData->mFollowingGroup.mGroupBounds = currentGroup->mGroupBounds;