Bug 1723200 - Give a deferred transform its own WebRenderLayerScrollData node when processing a scroll info layer item. r=tnikkel

Depends on D123036

Differential Revision: https://phabricator.services.mozilla.com/D123037
This commit is contained in:
Botond Ballo 2021-08-19 18:31:08 +00:00
Родитель 748e509a86
Коммит 967edc9a03
1 изменённых файлов: 14 добавлений и 2 удалений

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

@ -1835,13 +1835,25 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
nsDisplayTransform* deferred = aSc.GetDeferredTransformItem();
ScrollableLayerGuid::ViewID deferredId =
ScrollableLayerGuid::NULL_SCROLL_ID;
bool transformShouldGetOwnLayer = false;
if (deferred) {
if (const auto* asr = deferred->GetActiveScrolledRoot()) {
deferredId = asr->GetViewId();
}
if (deferred->GetActiveScrolledRoot() !=
item->GetActiveScrolledRoot()) {
transformShouldGetOwnLayer = true;
} else if (item->GetType() ==
DisplayItemType::TYPE_SCROLL_INFO_LAYER) {
// A scroll info layer has its own scroll id that's not reflected
// in item->GetActiveScrolledRoot(), but will be added to the
// WebRenderLayerScrollData node, so it needs to be treated as
// having a distinct ASR from the deferred transform item.
transformShouldGetOwnLayer = true;
}
}
if (deferred && deferred->GetActiveScrolledRoot() !=
item->GetActiveScrolledRoot()) {
if (transformShouldGetOwnLayer) {
// This creates the child WebRenderLayerScrollData for |item|, but
// omits the transform (hence the Nothing() as the last argument to
// Initialize(...)). We also need to make sure that the ASR from