Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(655)

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1841673003: Store PaintLayerFilterInfo in PaintLayerRareData instead of a HashMap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayer.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index c96f42c49d496e00d9ca3538e287babc7d8d072d..02f40fbc8e3eec86471d78e74fd9cdc5292aa228 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -149,7 +149,6 @@ PaintLayer::PaintLayer(LayoutBoxModelObject* layoutObject, PaintLayerType type)
, m_3DTransformedDescendantStatusDirty(true)
, m_has3DTransformedDescendant(false)
, m_containsDirtyOverlayScrollbars(false)
- , m_hasFilterInfo(false)
, m_needsAncestorDependentCompositingInputsUpdate(true)
, m_needsDescendantDependentCompositingInputsUpdate(true)
, m_childNeedsCompositingInputsUpdate(true)
@@ -193,8 +192,6 @@ PaintLayer::~PaintLayer()
scrollingCoordinator->willDestroyLayer(this);
}
- removeFilterInfoIfNeeded();
-
if (groupedMapping()) {
DisableCompositingQueryAsserts disabler;
setGroupedMapping(0, InvalidateLayerAndRemoveFromMapping);
@@ -2614,17 +2611,23 @@ FilterOperations PaintLayer::computeBackdropFilterOperations(const ComputedStyle
return computeFilterOperationsHandleReferenceFilters(style.backdropFilter(), style.effectiveZoom(), enclosingNode());
}
-void PaintLayer::updateOrRemoveFilterClients()
+PaintLayerFilterInfo& PaintLayer::ensureFilterInfo()
{
- if (!hasFilter()) {
- removeFilterInfoIfNeeded();
- return;
- }
+ PaintLayerRareData& rareData = ensureRareData();
+ if (!rareData.filterInfo)
+ rareData.filterInfo = adoptPtr(new PaintLayerFilterInfo(this));
+ return *rareData.filterInfo;
+}
- if (layoutObject()->style()->filter().hasReferenceFilter())
- ensureFilterInfo()->updateReferenceFilterClients(layoutObject()->style()->filter());
- else if (hasFilterInfo())
+void PaintLayer::updateOrRemoveFilterClients()
+{
+ if (!hasFilter() && m_rareData) {
+ m_rareData->filterInfo = nullptr;
+ } else if (layoutObject()->style()->filter().hasReferenceFilter()) {
+ ensureFilterInfo().updateReferenceFilterClients(layoutObject()->style()->filter());
+ } else if (filterInfo()) {
filterInfo()->clearFilterReferences();
+ }
}
FilterEffectBuilder* PaintLayer::updateFilterEffectBuilder() const
@@ -2683,7 +2686,7 @@ void PaintLayer::updateOrRemoveFilterEffectBuilder()
return;
}
- ensureFilterInfo()->setBuilder(nullptr);
+ ensureFilterInfo().setBuilder(nullptr);
}
void PaintLayer::filterNeedsPaintInvalidation()
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/paint/PaintLayerFilterInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698