| 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 #include "core/paint/PaintPropertyTreeBuilder.h" | 5 #include "core/paint/PaintPropertyTreeBuilder.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include "core/dom/DOMNodeIds.h" | 8 #include "core/dom/DOMNodeIds.h" |
| 9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( | 276 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( |
| 277 const LayoutObject& object, | 277 const LayoutObject& object, |
| 278 PaintPropertyTreeBuilderContext& context) { | 278 PaintPropertyTreeBuilderContext& context) { |
| 279 DCHECK(object.isSVGChild()); | 279 DCHECK(object.isSVGChild()); |
| 280 // SVG does not use paint offset internally, except for SVGForeignObject which | 280 // SVG does not use paint offset internally, except for SVGForeignObject which |
| 281 // has different SVG and HTML coordinate spaces. | 281 // has different SVG and HTML coordinate spaces. |
| 282 DCHECK(object.isSVGForeignObject() || | 282 DCHECK(object.isSVGForeignObject() || |
| 283 context.current.paintOffset == LayoutPoint()); | 283 context.current.paintOffset == LayoutPoint()); |
| 284 | 284 |
| 285 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 285 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
| 286 // TODO(pdr): Refactor this so all non-root SVG objects use the same | 286 AffineTransform transform = object.localToSVGParentTransform(); |
| 287 // transform function. | |
| 288 const AffineTransform& transform = object.isSVGForeignObject() | |
| 289 ? object.localSVGTransform() | |
| 290 : object.localToSVGParentTransform(); | |
| 291 // TODO(pdr): Check for the presence of a transform instead of the value. | 287 // TODO(pdr): Check for the presence of a transform instead of the value. |
| 292 // Checking for an identity matrix will cause the property tree structure | 288 // Checking for an identity matrix will cause the property tree structure |
| 293 // to change during animations if the animation passes through the | 289 // to change during animations if the animation passes through the |
| 294 // identity matrix. | 290 // identity matrix. |
| 295 if (!transform.isIdentity()) { | 291 if (!transform.isIdentity()) { |
| 296 // The origin is included in the local transform, so leave origin empty. | 292 // The origin is included in the local transform, so leave origin empty. |
| 297 auto& properties = object.getMutableForPainting().ensurePaintProperties(); | 293 auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| 298 context.forceSubtreeUpdate |= properties.updateTransform( | 294 context.forceSubtreeUpdate |= properties.updateTransform( |
| 299 context.current.transform, TransformationMatrix(transform), | 295 context.current.transform, TransformationMatrix(transform), |
| 300 FloatPoint3D()); | 296 FloatPoint3D()); |
| (...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 updateOverflowClip(object, context); | 1132 updateOverflowClip(object, context); |
| 1137 updatePerspective(object, context); | 1133 updatePerspective(object, context); |
| 1138 updateSvgLocalToBorderBoxTransform(object, context); | 1134 updateSvgLocalToBorderBoxTransform(object, context); |
| 1139 updateScrollAndScrollTranslation(object, context); | 1135 updateScrollAndScrollTranslation(object, context); |
| 1140 updateOutOfFlowContext(object, context); | 1136 updateOutOfFlowContext(object, context); |
| 1141 | 1137 |
| 1142 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1138 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 1143 } | 1139 } |
| 1144 | 1140 |
| 1145 } // namespace blink | 1141 } // namespace blink |
| OLD | NEW |