| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // because some properties inherit from the containing block chain instead of | 117 // because some properties inherit from the containing block chain instead of |
| 118 // the painting parent and cannot be derived in O(1) during the paint walk. | 118 // the painting parent and cannot be derived in O(1) during the paint walk. |
| 119 // For example, <div style='opacity: 0.3; position: relative; margin: 11px;'/> | 119 // For example, <div style='opacity: 0.3; position: relative; margin: 11px;'/> |
| 120 // would have a paint offset of (11px, 11px) and propertyTreeState.effect() | 120 // would have a paint offset of (11px, 11px) and propertyTreeState.effect() |
| 121 // would be an effect node with opacity of 0.3 which was created by the div | 121 // would be an effect node with opacity of 0.3 which was created by the div |
| 122 // itself. Note that propertyTreeState.transform() would not be null but would | 122 // itself. Note that propertyTreeState.transform() would not be null but would |
| 123 // instead point to the transform space setup by div's ancestors. | 123 // instead point to the transform space setup by div's ancestors. |
| 124 const PropertyTreeStateWithOffset* localBorderBoxProperties() const { | 124 const PropertyTreeStateWithOffset* localBorderBoxProperties() const { |
| 125 return m_localBorderBoxProperties.get(); | 125 return m_localBorderBoxProperties.get(); |
| 126 } | 126 } |
| 127 void setLocalBorderBoxProperties( | 127 void updateLocalBorderBoxProperties( |
| 128 std::unique_ptr<PropertyTreeStateWithOffset> properties) { | 128 LayoutPoint& paintOffset, |
| 129 m_localBorderBoxProperties = std::move(properties); | 129 const TransformPaintPropertyNode* transform, |
| 130 const ClipPaintPropertyNode* clip, |
| 131 const EffectPaintPropertyNode* effect, |
| 132 const ScrollPaintPropertyNode* scroll) { |
| 133 if (m_localBorderBoxProperties) { |
| 134 m_localBorderBoxProperties->paintOffset = paintOffset; |
| 135 m_localBorderBoxProperties->propertyTreeState.setTransform(transform); |
| 136 m_localBorderBoxProperties->propertyTreeState.setClip(clip); |
| 137 m_localBorderBoxProperties->propertyTreeState.setEffect(effect); |
| 138 m_localBorderBoxProperties->propertyTreeState.setScroll(scroll); |
| 139 } else { |
| 140 m_localBorderBoxProperties = |
| 141 wrapUnique(new ObjectPaintProperties::PropertyTreeStateWithOffset( |
| 142 paintOffset, PropertyTreeState(transform, clip, effect, scroll))); |
| 143 } |
| 130 } | 144 } |
| 131 | 145 |
| 132 // This is the complete set of property nodes and paint offset that can be | 146 // This is the complete set of property nodes and paint offset that can be |
| 133 // used to paint the contents of this object. It is similar to | 147 // used to paint the contents of this object. It is similar to |
| 134 // localBorderBoxProperties but includes properties (e.g., overflow clip, | 148 // localBorderBoxProperties but includes properties (e.g., overflow clip, |
| 135 // scroll translation) that apply to contents. This is suitable for paint | 149 // scroll translation) that apply to contents. This is suitable for paint |
| 136 // invalidation. | 150 // invalidation. |
| 137 ObjectPaintProperties::PropertyTreeStateWithOffset contentsProperties() const; | 151 ObjectPaintProperties::PropertyTreeStateWithOffset contentsProperties() const; |
| 138 | 152 |
| 139 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; } | 153 void clearPaintOffsetTranslation() { m_paintOffsetTranslation = nullptr; } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; | 287 RefPtr<TransformPaintPropertyNode> m_scrollTranslation; |
| 274 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; | 288 RefPtr<TransformPaintPropertyNode> m_scrollbarPaintOffset; |
| 275 RefPtr<ScrollPaintPropertyNode> m_scroll; | 289 RefPtr<ScrollPaintPropertyNode> m_scroll; |
| 276 | 290 |
| 277 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties; | 291 std::unique_ptr<PropertyTreeStateWithOffset> m_localBorderBoxProperties; |
| 278 }; | 292 }; |
| 279 | 293 |
| 280 } // namespace blink | 294 } // namespace blink |
| 281 | 295 |
| 282 #endif // ObjectPaintProperties_h | 296 #endif // ObjectPaintProperties_h |
| OLD | NEW |