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

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

Issue 2370553002: Refactor LocalBorderBoxProperties to use PropertyTreeState (Closed)
Patch Set: Rebase from space Created 4 years, 3 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/ObjectPaintProperties.h
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
index 0e47c7782c4516f1107ac74f67890ad6a2fd1bec..e11e21431d2b44fe33c0bd0bcda6b98fdc95b4c9 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h
@@ -38,8 +38,9 @@ struct PropertyTreeState {
// This class stores property tree related information associated with a LayoutObject.
// Currently there are two groups of information:
// 1. The set of property nodes created locally by this LayoutObject.
-// 2. [Optional] A suite of property nodes (PaintChunkProperties) and paint offset
-// that can be used to paint the border box of this LayoutObject.
+// 2. [Optional] A suite of property nodes (PropertyTreeState) and paint offset
chrishtr 2016/09/26 17:09:51 Remove the parenthetical, not accurate at this poi
+// that can be used to paint the border box of this LayoutObject. These nodes
+// may be created locally by the LayoutObject, or may be in inherited.
class CORE_EXPORT ObjectPaintProperties {
WTF_MAKE_NONCOPYABLE(ObjectPaintProperties);
USING_FAST_MALLOC(ObjectPaintProperties);
@@ -87,24 +88,23 @@ public:
const ClipPaintPropertyNode* cssClipFixedPosition() const { return m_cssClipFixedPosition.get(); }
const ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.get(); }
- // This is a complete set of property nodes that should be used as a starting point to paint
- // this layout object. It is needed becauase some property inherits from the containing block,
- // not painting parent, thus can't be derived in O(1) during paint walk.
- // Note: If this layout object has transform or stacking-context effects, those are already
- // baked into in the context here. However for properties that affects only children,
- // for example, perspective and overflow clip, those should be applied by the painter
- // at the right painting step.
- // TODO(pdr): Refactor this to use PropertyTreeState.
+ // This is a complete state that should be used as a starting point to paint this object. It is
+ // needed because some properties inherit from the containing block, not painting parent, and
+ // can't be derived in O(1) during paint walk.
+ // If this layout object has transform or stacking-context effects, those are already baked into
+ // in the context here. Properties that affect only children, for example perspective and
+ // overflow clip, should be applied by the painter at the right painting step.
struct LocalBorderBoxProperties {
+ LocalBorderBoxProperties(LayoutPoint offset, PropertyTreeState treeState)
+ : paintOffset(offset), propertyTreeState(treeState) { }
LayoutPoint paintOffset;
- GeometryPropertyTreeState geometryPropertyTreeState;
- const ScrollPaintPropertyNode* scroll;
+ PropertyTreeState propertyTreeState;
};
const LocalBorderBoxProperties* localBorderBoxProperties() const { return m_localBorderBoxProperties.get(); }
- // ContentsProperties is the GeometryPropertyTreeState that is the same as in
- // localBorderBoxProperties, except that it is inside any clips and scrolls caused by this
- // object. This GeometryPropertyTreeState is suitable as the destination for paint invalidation.
- void getContentsProperties(GeometryPropertyTreeState&) const;
+ // ContentsProperties returns the same property tree state in localBorderBoxProperties
+ // but modified to be inside any clips and scrolls caused by this object. This
+ // GeometryPropertyTreeState is suitable as the destination for paint invalidation.
+ GeometryPropertyTreeState getContentsProperties() const;
szager1 2016/09/24 01:30:17 Why do we need both PropertyTreeState and Geometry
void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; }
void clearTransform() { m_transform = nullptr; }

Powered by Google App Engine
This is Rietveld 408576698