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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2404213004: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Cleanup needsUpdate finder construction, tighten reasons for updating a property subtree, misc clea… Created 4 years, 2 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/layout/LayoutObject.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 2c0ffc245410a99701fc65ede21418afc566040b..15619559481423c494bb924e366e0708e7a161fc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -1718,6 +1718,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
m_layoutObject.clearPreviousPaintInvalidationRects();
}
+ void setNeedsPaintPropertyUpdate() {
+ m_layoutObject.setNeedsPaintPropertyUpdate();
+ }
+ void clearNeedsPaintPropertyUpdate() {
+ m_layoutObject.clearNeedsPaintPropertyUpdate();
+ }
+
protected:
friend class PaintPropertyTreeBuilder;
// The following two functions can be called from PaintPropertyTreeBuilder
@@ -1740,6 +1747,23 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
return MutableForPainting(*this);
}
+ // Paint properties (see: |ObjectPaintProperties|) are built from an object's
+ // state (location, transform, etc) as well as properties from ancestors.
+ // When these inputs change, setNeedsPaintPropertyUpdate will cause a property
+ // tree update during the next document lifecycle update.
+ // TODO(pdr): Add additional granularity such as the ability to signal that
+ // only a local paint property update is needed.
+ void setNeedsPaintPropertyUpdate() {
+ m_bitfields.setNeedsPaintPropertyUpdate(true);
+ }
+ void clearNeedsPaintPropertyUpdate() {
+ DCHECK_EQ(document().lifecycle().state(), DocumentLifecycle::InPrePaint);
+ m_bitfields.setNeedsPaintPropertyUpdate(false);
+ }
+ bool needsPaintPropertyUpdate() const {
+ return m_bitfields.needsPaintPropertyUpdate();
+ }
+
void setIsScrollAnchorObject() { m_bitfields.setIsScrollAnchorObject(true); }
// If unconditionally is true, you are responsible for ensuring that
@@ -2119,6 +2143,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
m_isScrollAnchorObject(false),
m_scrollAnchorDisablingStyleChanged(false),
m_hasBoxDecorationBackground(false),
+ m_needsPaintPropertyUpdate(true),
m_positionedState(IsStaticallyPositioned),
m_selectionState(SelectionNone),
m_backgroundObscurationState(BackgroundObscurationStatusInvalid),
@@ -2283,6 +2308,10 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
ADD_BOOLEAN_BITFIELD(hasBoxDecorationBackground,
HasBoxDecorationBackground);
+ // Whether the paint properties need to be updated. For more details, see
+ // LayoutObject::needsPaintPropertyUpdate().
+ ADD_BOOLEAN_BITFIELD(needsPaintPropertyUpdate, NeedsPaintPropertyUpdate);
+
private:
// This is the cached 'position' value of this object
// (see ComputedStyle::position).
« no previous file with comments | « third_party/WebKit/Source/core/frame/FrameView.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698