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

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

Issue 2495893002: Implement incremental paint property tree rebuilding (Closed)
Patch Set: Suppress main thread scrolling invalidation failures Created 4 years, 1 month 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 87ea2a4ebba246a4f98d0dad57f6afb0f8a6f179..e92c28fd043fb0e31cfce4757ce9deaa4e8e96d0 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -1702,6 +1702,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
void clearPreviousVisualRects() {
m_layoutObject.clearPreviousVisualRects();
}
+ void setNeedsPaintPropertyUpdate() {
+ m_layoutObject.setNeedsPaintPropertyUpdate();
+ }
+ void clearNeedsPaintPropertyUpdate() {
+ m_layoutObject.clearNeedsPaintPropertyUpdate();
+ }
+
protected:
friend class PaintPropertyTreeBuilder;
// The following two functions can be called from PaintPropertyTreeBuilder
@@ -1724,6 +1731,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); }
// Clears the IsScrollAnchorObject bit if and only if no ScrollAnchors still
// reference this LayoutObject.
@@ -2110,6 +2134,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
m_hasPreviousLocationInBacking(false),
m_hasPreviousSelectionVisualRect(false),
m_hasPreviousBoxGeometries(false),
+ m_needsPaintPropertyUpdate(true),
m_positionedState(IsStaticallyPositioned),
m_selectionState(SelectionNone),
m_backgroundObscurationState(BackgroundObscurationStatusInvalid),
@@ -2278,9 +2303,13 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
HasPreviousSelectionVisualRect);
ADD_BOOLEAN_BITFIELD(hasPreviousBoxGeometries, HasPreviousBoxGeometries);
+ // Whether the paint properties need to be updated. For more details, see
+ // LayoutObject::needsPaintPropertyUpdate().
+ ADD_BOOLEAN_BITFIELD(needsPaintPropertyUpdate, NeedsPaintPropertyUpdate);
+
protected:
// Use protected to avoid warning about unused variable.
- unsigned m_unusedBits : 10;
+ unsigned m_unusedBits : 9;
private:
// This is the cached 'position' value of this object
« 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