| 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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( | 277 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( |
| 278 const LayoutObject& object, | 278 const LayoutObject& object, |
| 279 PaintPropertyTreeBuilderContext& context) { | 279 PaintPropertyTreeBuilderContext& context) { |
| 280 DCHECK(object.isSVGChild()); | 280 DCHECK(object.isSVGChild()); |
| 281 // SVG does not use paint offset internally, except for SVGForeignObject which | 281 // SVG does not use paint offset internally, except for SVGForeignObject which |
| 282 // has different SVG and HTML coordinate spaces. | 282 // has different SVG and HTML coordinate spaces. |
| 283 DCHECK(object.isSVGForeignObject() || | 283 DCHECK(object.isSVGForeignObject() || |
| 284 context.current.paintOffset == LayoutPoint()); | 284 context.current.paintOffset == LayoutPoint()); |
| 285 | 285 |
| 286 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { | 286 if (object.needsPaintPropertyUpdate() || context.forceSubtreeUpdate) { |
| 287 AffineTransform transform = object.localToSVGParentTransform(); | 287 // TODO(pdr): Refactor this so all non-root SVG objects use the same |
| 288 // transform function. |
| 289 const AffineTransform& transform = object.isSVGForeignObject() |
| 290 ? object.localSVGTransform() |
| 291 : object.localToSVGParentTransform(); |
| 288 // TODO(pdr): Check for the presence of a transform instead of the value. | 292 // TODO(pdr): Check for the presence of a transform instead of the value. |
| 289 // Checking for an identity matrix will cause the property tree structure | 293 // Checking for an identity matrix will cause the property tree structure |
| 290 // to change during animations if the animation passes through the | 294 // to change during animations if the animation passes through the |
| 291 // identity matrix. | 295 // identity matrix. |
| 292 if (!transform.isIdentity()) { | 296 if (!transform.isIdentity()) { |
| 293 // The origin is included in the local transform, so leave origin empty. | 297 // The origin is included in the local transform, so leave origin empty. |
| 294 auto& properties = object.getMutableForPainting().ensurePaintProperties(); | 298 auto& properties = object.getMutableForPainting().ensurePaintProperties(); |
| 295 context.forceSubtreeUpdate |= properties.updateTransform( | 299 context.forceSubtreeUpdate |= properties.updateTransform( |
| 296 context.current.transform, TransformationMatrix(transform), | 300 context.current.transform, TransformationMatrix(transform), |
| 297 FloatPoint3D()); | 301 FloatPoint3D()); |
| (...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1121 updateOverflowClip(object, context); | 1125 updateOverflowClip(object, context); |
| 1122 updatePerspective(object, context); | 1126 updatePerspective(object, context); |
| 1123 updateSvgLocalToBorderBoxTransform(object, context); | 1127 updateSvgLocalToBorderBoxTransform(object, context); |
| 1124 updateScrollAndScrollTranslation(object, context); | 1128 updateScrollAndScrollTranslation(object, context); |
| 1125 updateOutOfFlowContext(object, context); | 1129 updateOutOfFlowContext(object, context); |
| 1126 | 1130 |
| 1127 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); | 1131 context.forceSubtreeUpdate |= object.subtreeNeedsPaintPropertyUpdate(); |
| 1128 } | 1132 } |
| 1129 | 1133 |
| 1130 } // namespace blink | 1134 } // namespace blink |
| OLD | NEW |