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

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

Issue 1892473002: Update PaintLayer::needsPaintPhaseXXX flags when add/remove layer on style change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 8 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.h
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 2a28fab1e5e6925ffe7f4d3a4fbeb02656f76888..c24a277c369fffc240d952ef0972d847ec3c9974 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -231,8 +231,8 @@ public:
void addChild(PaintLayer* newChild, PaintLayer* beforeChild = 0);
PaintLayer* removeChild(PaintLayer*);
- void removeOnlyThisLayer();
- void insertOnlyThisLayer();
+ void removeOnlyThisLayerAfterStyleChange();
+ void insertOnlyThisLayerAfterStyleChange();
void styleDidChange(StyleDifference, const ComputedStyle* oldStyle);
@@ -660,6 +660,7 @@ public:
// Used to skip PaintPhaseDescendantOutlinesOnly for layers that have never had descendant outlines.
// Once it's set we never clear it because it's not easy to track if all outlines have been removed.
+ // For more details, see core/paint/REAME.md#Empty paint phase optimization.
bool needsPaintPhaseDescendantOutlines() const { return m_needsPaintPhaseDescendantOutlines; }
void setNeedsPaintPhaseDescendantOutlines() { ASSERT(isSelfPaintingLayer()); m_needsPaintPhaseDescendantOutlines = true; }
@@ -762,6 +763,13 @@ private:
return *m_rareData;
}
+ void mergeNeedsPaintPhaseFlagsFrom(const PaintLayer& layer)
+ {
+ m_needsPaintPhaseDescendantOutlines |= layer.m_needsPaintPhaseDescendantOutlines;
+ m_needsPaintPhaseFloat |= layer.m_needsPaintPhaseFloat;
+ m_needsPaintPhaseDescendantBlockBackgrounds |= layer.m_needsPaintPhaseDescendantBlockBackgrounds;
+ }
+
unsigned m_layerType : 2; // PaintLayerType
// Self-painting layer is an optimization where we avoid the heavy Layer painting
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698