Bug 1393706 - Compute display item's visibility when creating fallback data in layers-free mode. r=jrmuizel

MozReview-Commit-ID: 6eUnABLce2Z

--HG--
extra : rebase_source : 1a1b462897ef838c70eb8613501b940c06dd0f99
This commit is contained in:
Ethan Lin 2017-08-25 16:36:15 +08:00
Родитель 3fb42e9edd
Коммит 7675f794c1
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -516,6 +516,13 @@ WebRenderLayerManager::GenerateFallbackData(nsDisplayItem* aItem,
clippedBounds = itemBounds.Intersect(clip.GetClipRect());
}
// nsDisplayItem::Paint() may refer the variables that come from ComputeVisibility().
// So we should call ComputeVisibility() before painting. e.g.: nsDisplayBoxShadowInner
// uses mVisibleRegion in Paint() and mVisibleRegion is computed in
// nsDisplayBoxShadowInner::ComputeVisibility().
nsRegion visibleRegion(clippedBounds);
aItem->ComputeVisibility(aDisplayListBuilder, &visibleRegion);
const int32_t appUnitsPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayerRect bounds = ViewAs<LayerPixel>(
LayoutDeviceRect::FromAppUnits(clippedBounds, appUnitsPerDevPixel),