| 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 "platform/graphics/paint/GeometryMapper.h" | 5 #include "platform/graphics/paint/GeometryMapper.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/geometry/LayoutRect.h" | 8 #include "platform/geometry/LayoutRect.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 const auto& transformMatrix = | 155 const auto& transformMatrix = |
| 156 localToAncestorMatrix(localTransformNode, ancestorTransformNode); | 156 localToAncestorMatrix(localTransformNode, ancestorTransformNode); |
| 157 DCHECK(transformMatrix.isInvertible()); | 157 DCHECK(transformMatrix.isInvertible()); |
| 158 | 158 |
| 159 // TODO(chrishtr): Cache the inverse? | 159 // TODO(chrishtr): Cache the inverse? |
| 160 return transformMatrix.inverse().mapRect(rect); | 160 return transformMatrix.inverse().mapRect(rect); |
| 161 } | 161 } |
| 162 | 162 |
| 163 PrecomputedDataForAncestor& GeometryMapper::getPrecomputedDataForAncestor( | 163 PrecomputedDataForAncestor& GeometryMapper::getPrecomputedDataForAncestor( |
| 164 const TransformPaintPropertyNode* ancestorTransformNode) { | 164 const TransformPaintPropertyNode* ancestorTransformNode) { |
| 165 auto addResult = m_data.add(ancestorTransformNode, nullptr); | 165 auto addResult = m_data.insert(ancestorTransformNode, nullptr); |
| 166 if (addResult.isNewEntry) | 166 if (addResult.isNewEntry) |
| 167 addResult.storedValue->value = PrecomputedDataForAncestor::create(); | 167 addResult.storedValue->value = PrecomputedDataForAncestor::create(); |
| 168 return *addResult.storedValue->value; | 168 return *addResult.storedValue->value; |
| 169 } | 169 } |
| 170 | 170 |
| 171 FloatRect GeometryMapper::localToAncestorClipRect( | 171 FloatRect GeometryMapper::localToAncestorClipRect( |
| 172 const PropertyTreeState& localState, | 172 const PropertyTreeState& localState, |
| 173 const PropertyTreeState& ancestorState) { | 173 const PropertyTreeState& ancestorState) { |
| 174 bool success = false; | 174 bool success = false; |
| 175 FloatRect result = | 175 FloatRect result = |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 const TransformPaintPropertyNode*, | 338 const TransformPaintPropertyNode*, |
| 339 const TransformPaintPropertyNode*); | 339 const TransformPaintPropertyNode*); |
| 340 template const ClipPaintPropertyNode* GeometryMapper::lowestCommonAncestor( | 340 template const ClipPaintPropertyNode* GeometryMapper::lowestCommonAncestor( |
| 341 const ClipPaintPropertyNode*, | 341 const ClipPaintPropertyNode*, |
| 342 const ClipPaintPropertyNode*); | 342 const ClipPaintPropertyNode*); |
| 343 template const ScrollPaintPropertyNode* GeometryMapper::lowestCommonAncestor( | 343 template const ScrollPaintPropertyNode* GeometryMapper::lowestCommonAncestor( |
| 344 const ScrollPaintPropertyNode*, | 344 const ScrollPaintPropertyNode*, |
| 345 const ScrollPaintPropertyNode*); | 345 const ScrollPaintPropertyNode*); |
| 346 | 346 |
| 347 } // namespace blink | 347 } // namespace blink |
| OLD | NEW |