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

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

Issue 1877093002: Update PaintLayer::needsPaintPhaseXXX flags when add/remove layer on style change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
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 4749c706032e32bc76e0331be327bd09f87e4ff1..44e4ec1427571fd6be7f56c0182aa8e7e96d3e57 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -229,8 +229,8 @@ public:
void addChild(PaintLayer* newChild, PaintLayer* beforeChild = 0);
PaintLayer* removeChild(PaintLayer*);
- void removeOnlyThisLayer();
- void insertOnlyThisLayer();
+ void removeOnlyThisLayerAfterStyleChange();
+ void insertOnlyThisLayerAfterStyleChange();
void styleChanged(StyleDifference, const ComputedStyle* oldStyle);
@@ -670,6 +670,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; }
@@ -772,6 +773,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