OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "core/paint/ObjectPaintProperties.h" | 5 #include "core/paint/ObjectPaintProperties.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 void ObjectPaintProperties::getContentsPropertyTreeState( | 9 ObjectPaintProperties::PropertyTreeStateWithOffset |
10 GeometryPropertyTreeState& state, | 10 ObjectPaintProperties::contentsProperties() const { |
11 LayoutPoint& paintOffsetFromState) const { | 11 ObjectPaintProperties::PropertyTreeStateWithOffset propertiesWithOffset = |
12 state = localBorderBoxProperties()->geometryPropertyTreeState; | 12 *localBorderBoxProperties(); |
13 if (svgLocalToBorderBoxTransform()) { | 13 if (svgLocalToBorderBoxTransform()) { |
14 state.transform = svgLocalToBorderBoxTransform(); | 14 propertiesWithOffset.propertyTreeState.setTransform( |
15 // No paint offset from the state because svgLocalToBorderTransform | 15 svgLocalToBorderBoxTransform()); |
16 // embeds the paint offset in it. | 16 // There's no paint offset for the contents because svgLocalToBorderBoxTrans
form bakes in |
17 paintOffsetFromState = LayoutPoint(); | 17 // the paint offset. |
18 } else { | 18 propertiesWithOffset.paintOffset = LayoutPoint(); |
19 if (scrollTranslation()) | 19 } else if (scrollTranslation()) { |
20 state.transform = scrollTranslation(); | 20 propertiesWithOffset.propertyTreeState.setTransform(scrollTranslation()); |
21 paintOffsetFromState = localBorderBoxProperties()->paintOffset; | |
22 } | 21 } |
23 | 22 |
24 if (overflowClip()) | 23 if (overflowClip()) |
25 state.clip = overflowClip(); | 24 propertiesWithOffset.propertyTreeState.setClip(overflowClip()); |
26 else if (cssClip()) | 25 else if (cssClip()) |
27 state.clip = cssClip(); | 26 propertiesWithOffset.propertyTreeState.setClip(cssClip()); |
| 27 |
28 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. | 28 // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. |
| 29 |
| 30 return propertiesWithOffset; |
29 } | 31 } |
30 | 32 |
31 } // namespace blink | 33 } // namespace blink |
OLD | NEW |