Chromium Code Reviews| 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 6048057f8bf45ca6b03a8d8d4e3967d9cb5f3968..499ce448248d5c7bd6cc02f6c4764d94a1a92225 100644 |
| --- a/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h |
| +++ b/third_party/WebKit/Source/core/paint/ObjectPaintProperties.h |
| @@ -5,8 +5,10 @@ |
| #ifndef ObjectPaintProperties_h |
| #define ObjectPaintProperties_h |
| +#include "platform/geometry/LayoutPoint.h" |
|
pdr.
2016/02/04 04:54:01
Can you update PaintPropertyTreePrinter too?
To t
trchen
2016/02/04 23:08:40
Acknowledged.
trchen
2016/02/04 23:49:01
I examined PaintPropertyTreePainter. The painter o
|
| #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| #include "platform/graphics/paint/EffectPaintPropertyNode.h" |
| +#include "platform/graphics/paint/PaintChunkProperties.h" |
| #include "platform/graphics/paint/TransformPaintPropertyNode.h" |
| #include "wtf/PassOwnPtr.h" |
| #include "wtf/PassRefPtr.h" |
| @@ -27,21 +29,26 @@ class ObjectPaintProperties { |
| WTF_MAKE_NONCOPYABLE(ObjectPaintProperties); |
| USING_FAST_MALLOC(ObjectPaintProperties); |
| public: |
| + struct PropertyTreeContext; |
| + |
| static PassOwnPtr<ObjectPaintProperties> create( |
| PassRefPtr<TransformPaintPropertyNode> paintOffsetTranslation, |
| PassRefPtr<TransformPaintPropertyNode> transform, |
| PassRefPtr<EffectPaintPropertyNode> effect, |
| PassRefPtr<ClipPaintPropertyNode> overflowClip, |
| PassRefPtr<TransformPaintPropertyNode> perspective, |
| - PassRefPtr<TransformPaintPropertyNode> scrollTranslation) |
| + PassRefPtr<TransformPaintPropertyNode> scrollTranslation, |
| + PassOwnPtr<PropertyTreeContext> propertyTreeContext) |
| { |
| - return adoptPtr(new ObjectPaintProperties(paintOffsetTranslation, transform, effect, overflowClip, perspective, scrollTranslation)); |
| + return adoptPtr(new ObjectPaintProperties(paintOffsetTranslation, transform, effect, overflowClip, perspective, scrollTranslation, propertyTreeContext)); |
| } |
| // The hierarchy of transform subtree created by a LayoutObject. |
| // [ paintOffsetTranslation ] Normally paint offset is accumulated without creating a node |
| // | until we see, for example, transform or position:fixed. |
| // +---[ transform ] The space created by CSS transform. |
| + // | It is the local border box space the painter expects, |
|
pdr.
2016/02/04 04:54:01
This helped me understand the situation. Maybe eve
trchen
2016/02/04 23:08:40
Acknowledged.
|
| + // | see PropertyTreeContext below. |
| // +---[ perspective ] The space created by CSS perspective. |
| // +---[ scrollTranslation ] The space created by overflow clip. |
| TransformPaintPropertyNode* paintOffsetTranslation() const { return m_paintOffsetTranslation.get(); } |
| @@ -57,6 +64,19 @@ public: |
| 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. |
| + struct PropertyTreeContext { |
|
pdr.
2016/02/04 04:54:01
WDYT of "LocalBorderBoxProperties"? In reading thr
trchen
2016/02/04 23:08:40
Sounds clear! Let's do that.
|
| + LayoutPoint paintOffset; |
| + PaintChunkProperties properties; |
|
pdr.
2016/02/04 04:54:01
Can you think of a case when the effect/filter pro
trchen
2016/02/04 23:08:40
Probably not. Effect node can be derived from the
|
| + }; |
| + PropertyTreeContext* propertyTreeContext() const { return m_propertyTreeContext.get(); } |
| + |
| private: |
| ObjectPaintProperties( |
| PassRefPtr<TransformPaintPropertyNode> paintOffsetTranslation, |
| @@ -64,13 +84,15 @@ private: |
| PassRefPtr<EffectPaintPropertyNode> effect, |
| PassRefPtr<ClipPaintPropertyNode> overflowClip, |
| PassRefPtr<TransformPaintPropertyNode> perspective, |
| - PassRefPtr<TransformPaintPropertyNode> scrollTranslation) |
| + PassRefPtr<TransformPaintPropertyNode> scrollTranslation, |
| + PassOwnPtr<PropertyTreeContext> propertyTreeContext) |
| : m_paintOffsetTranslation(paintOffsetTranslation) |
| , m_transform(transform) |
| , m_effect(effect) |
| , m_overflowClip(overflowClip) |
| , m_perspective(perspective) |
| - , m_scrollTranslation(scrollTranslation) { } |
| + , m_scrollTranslation(scrollTranslation) |
| + , m_propertyTreeContext(propertyTreeContext) { } |
| RefPtr<TransformPaintPropertyNode> m_paintOffsetTranslation; |
| RefPtr<TransformPaintPropertyNode> m_transform; |
| @@ -78,6 +100,8 @@ private: |
| RefPtr<ClipPaintPropertyNode> m_overflowClip; |
| RefPtr<TransformPaintPropertyNode> m_perspective; |
| RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
| + |
| + OwnPtr<PropertyTreeContext> m_propertyTreeContext; |
| }; |
| } // namespace blink |