Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ObjectPaintProperties_h | 5 #ifndef ObjectPaintProperties_h |
| 6 #define ObjectPaintProperties_h | 6 #define ObjectPaintProperties_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "platform/geometry/LayoutPoint.h" | 9 #include "platform/geometry/LayoutPoint.h" |
| 10 #include "platform/graphics/paint/ClipPaintPropertyNode.h" | 10 #include "platform/graphics/paint/ClipPaintPropertyNode.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 } | 31 } |
| 32 const TransformPaintPropertyNode* transform; | 32 const TransformPaintPropertyNode* transform; |
| 33 const ClipPaintPropertyNode* clip; | 33 const ClipPaintPropertyNode* clip; |
| 34 const EffectPaintPropertyNode* effect; | 34 const EffectPaintPropertyNode* effect; |
| 35 const ScrollPaintPropertyNode* scroll; | 35 const ScrollPaintPropertyNode* scroll; |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // This class stores property tree related information associated with a LayoutO bject. | 38 // This class stores property tree related information associated with a LayoutO bject. |
| 39 // Currently there are two groups of information: | 39 // Currently there are two groups of information: |
| 40 // 1. The set of property nodes created locally by this LayoutObject. | 40 // 1. The set of property nodes created locally by this LayoutObject. |
| 41 // 2. [Optional] A suite of property nodes (PaintChunkProperties) and paint offs et | 41 // 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
| |
| 42 // that can be used to paint the border box of this LayoutObject. | 42 // that can be used to paint the border box of this LayoutObject. These nodes |
| 43 // may be created locally by the LayoutObject, or may be in inherited. | |
| 43 class CORE_EXPORT ObjectPaintProperties { | 44 class CORE_EXPORT ObjectPaintProperties { |
| 44 WTF_MAKE_NONCOPYABLE(ObjectPaintProperties); | 45 WTF_MAKE_NONCOPYABLE(ObjectPaintProperties); |
| 45 USING_FAST_MALLOC(ObjectPaintProperties); | 46 USING_FAST_MALLOC(ObjectPaintProperties); |
| 46 public: | 47 public: |
| 47 struct LocalBorderBoxProperties; | 48 struct LocalBorderBoxProperties; |
| 48 | 49 |
| 49 static std::unique_ptr<ObjectPaintProperties> create() | 50 static std::unique_ptr<ObjectPaintProperties> create() |
| 50 { | 51 { |
| 51 return wrapUnique(new ObjectPaintProperties()); | 52 return wrapUnique(new ObjectPaintProperties()); |
| 52 } | 53 } |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 80 | 81 |
| 81 // The hierarchy of the clip subtree created by a LayoutObject is as follows : | 82 // The hierarchy of the clip subtree created by a LayoutObject is as follows : |
| 82 // [ css clip ] | 83 // [ css clip ] |
| 83 // [ css clip fixed position] | 84 // [ css clip fixed position] |
| 84 // | | 85 // | |
| 85 // +--- [ overflow clip ] | 86 // +--- [ overflow clip ] |
| 86 const ClipPaintPropertyNode* cssClip() const { return m_cssClip.get(); } | 87 const ClipPaintPropertyNode* cssClip() const { return m_cssClip.get(); } |
| 87 const ClipPaintPropertyNode* cssClipFixedPosition() const { return m_cssClip FixedPosition.get(); } | 88 const ClipPaintPropertyNode* cssClipFixedPosition() const { return m_cssClip FixedPosition.get(); } |
| 88 const ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.ge t(); } | 89 const ClipPaintPropertyNode* overflowClip() const { return m_overflowClip.ge t(); } |
| 89 | 90 |
| 90 // This is a complete set of property nodes that should be used as a startin g point to paint | 91 // This is a complete state that should be used as a starting point to paint this object. It is |
| 91 // this layout object. It is needed becauase some property inherits from the containing block, | 92 // needed because some properties inherit from the containing block, not pai nting parent, and |
| 92 // not painting parent, thus can't be derived in O(1) during paint walk. | 93 // can't be derived in O(1) during paint walk. |
| 93 // Note: If this layout object has transform or stacking-context effects, th ose are already | 94 // If this layout object has transform or stacking-context effects, those ar e already baked into |
| 94 // baked into in the context here. However for properties that affects only children, | 95 // in the context here. Properties that affect only children, for example pe rspective and |
| 95 // for example, perspective and overflow clip, those should be applied by th e painter | 96 // overflow clip, should be applied by the painter at the right painting ste p. |
| 96 // at the right painting step. | |
| 97 // TODO(pdr): Refactor this to use PropertyTreeState. | |
| 98 struct LocalBorderBoxProperties { | 97 struct LocalBorderBoxProperties { |
| 98 LocalBorderBoxProperties(LayoutPoint offset, PropertyTreeState treeState ) | |
| 99 : paintOffset(offset), propertyTreeState(treeState) { } | |
| 99 LayoutPoint paintOffset; | 100 LayoutPoint paintOffset; |
| 100 GeometryPropertyTreeState geometryPropertyTreeState; | 101 PropertyTreeState propertyTreeState; |
| 101 const ScrollPaintPropertyNode* scroll; | |
| 102 }; | 102 }; |
| 103 const LocalBorderBoxProperties* localBorderBoxProperties() const { return m_ localBorderBoxProperties.get(); } | 103 const LocalBorderBoxProperties* localBorderBoxProperties() const { return m_ localBorderBoxProperties.get(); } |
| 104 // ContentsProperties is the GeometryPropertyTreeState that is the same as i n | 104 // ContentsProperties returns the same property tree state in localBorderBox Properties |
| 105 // localBorderBoxProperties, except that it is inside any clips and scrolls caused by this | 105 // but modified to be inside any clips and scrolls caused by this object. Th is |
| 106 // object. This GeometryPropertyTreeState is suitable as the destination for paint invalidation. | 106 // GeometryPropertyTreeState is suitable as the destination for paint invali dation. |
| 107 void getContentsProperties(GeometryPropertyTreeState&) const; | 107 GeometryPropertyTreeState getContentsProperties() const; |
|
szager1
2016/09/24 01:30:17
Why do we need both PropertyTreeState and Geometry
| |
| 108 | 108 |
| 109 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; } | 109 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; } |
| 110 void clearTransform() { m_transform = nullptr; } | 110 void clearTransform() { m_transform = nullptr; } |
| 111 void clearEffect() { m_effect = nullptr; } | 111 void clearEffect() { m_effect = nullptr; } |
| 112 void clearCssClip() { m_cssClip = nullptr; } | 112 void clearCssClip() { m_cssClip = nullptr; } |
| 113 void clearCssClipFixedPosition() { m_cssClipFixedPosition = nullptr; } | 113 void clearCssClipFixedPosition() { m_cssClipFixedPosition = nullptr; } |
| 114 void clearOverflowClip() { m_overflowClip = nullptr; } | 114 void clearOverflowClip() { m_overflowClip = nullptr; } |
| 115 void clearPerspective() { m_perspective = nullptr; } | 115 void clearPerspective() { m_perspective = nullptr; } |
| 116 void clearSvgLocalToBorderBoxTransform() { m_svgLocalToBorderBoxTransform = nullptr; } | 116 void clearSvgLocalToBorderBoxTransform() { m_svgLocalToBorderBoxTransform = nullptr; } |
| 117 void clearScrollTranslation() { m_scrollTranslation = nullptr; } | 117 void clearScrollTranslation() { m_scrollTranslation = nullptr; } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; | 165 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
| 166 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; | 166 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; |
| 167 RefPtr<ScrollPaintPropertyNode> m_scroll; | 167 RefPtr<ScrollPaintPropertyNode> m_scroll; |
| 168 | 168 |
| 169 std::unique_ptr<LocalBorderBoxProperties> m_localBorderBoxProperties; | 169 std::unique_ptr<LocalBorderBoxProperties> m_localBorderBoxProperties; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace blink | 172 } // namespace blink |
| 173 | 173 |
| 174 #endif // ObjectPaintProperties_h | 174 #endif // ObjectPaintProperties_h |
| OLD | NEW |