зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1501382 - Cull items within an opacity:0 container when using WebRender. r=kats
Depends on D14230 Differential Revision: https://phabricator.services.mozilla.com/D14231 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
010a2c6c02
Коммит
2482792e98
|
@ -1541,6 +1541,13 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
|||
MOZ_ASSERT(item && itemType == item->GetType());
|
||||
}
|
||||
|
||||
if (mForEventsAndPluginsOnly &&
|
||||
(itemType != DisplayItemType::TYPE_COMPOSITOR_HITTEST_INFO &&
|
||||
itemType != DisplayItemType::TYPE_PLUGIN)) {
|
||||
// Only process hit test info items or plugin items.
|
||||
continue;
|
||||
}
|
||||
|
||||
bool forceNewLayerData = false;
|
||||
size_t layerCountBeforeRecursing = mLayerScrollData.size();
|
||||
if (apzEnabled) {
|
||||
|
@ -1594,6 +1601,13 @@ void WebRenderCommandBuilder::CreateWebRenderCommandsFromDisplayList(
|
|||
GP("attempting to enter the grouping code\n");
|
||||
}
|
||||
|
||||
AutoRestore<bool> restoreForEventsAndPluginsOnly(
|
||||
mForEventsAndPluginsOnly);
|
||||
if (itemType == DisplayItemType::TYPE_OPACITY &&
|
||||
static_cast<nsDisplayOpacity*>(item)->ForEventsAndPluginsOnly()) {
|
||||
mForEventsAndPluginsOnly = true;
|
||||
}
|
||||
|
||||
if (dumpEnabled) {
|
||||
std::stringstream ss;
|
||||
nsFrame::PrintDisplayItem(aDisplayListBuilder, item, ss,
|
||||
|
|
|
@ -42,6 +42,7 @@ class WebRenderCommandBuilder {
|
|||
mBuilderDumpIndex(0),
|
||||
mDumpIndent(0),
|
||||
mDoGrouping(false),
|
||||
mForEventsAndPluginsOnly(false),
|
||||
mContainsSVGGroup(false) {}
|
||||
|
||||
void Destroy();
|
||||
|
@ -199,6 +200,10 @@ class WebRenderCommandBuilder {
|
|||
// blob image.
|
||||
bool mDoGrouping;
|
||||
|
||||
// True if we're currently within an opacity:0 container, and only
|
||||
// plugin and hit test items should be considered.
|
||||
bool mForEventsAndPluginsOnly;
|
||||
|
||||
// True if the most recently build display list contained an svg that
|
||||
// we did grouping for.
|
||||
bool mContainsSVGGroup;
|
||||
|
|
|
@ -5336,6 +5336,8 @@ class nsDisplayOpacity : public nsDisplayWrapList {
|
|||
|
||||
float GetOpacity() const { return mOpacity; }
|
||||
|
||||
bool ForEventsAndPluginsOnly() const { return mForEventsAndPluginsOnly; }
|
||||
|
||||
private:
|
||||
bool ApplyOpacityToChildren(nsDisplayListBuilder* aBuilder);
|
||||
bool IsEffectsWrapper() const;
|
||||
|
|
Загрузка…
Ссылка в новой задаче