| 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 "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/layout/LayoutInline.h" | 10 #include "core/layout/LayoutInline.h" |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 // creating a transform node for SVG-specific transforms without 3D. | 264 // creating a transform node for SVG-specific transforms without 3D. |
| 265 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( | 265 void PaintPropertyTreeBuilder::updateTransformForNonRootSVG( |
| 266 const LayoutObject& object, | 266 const LayoutObject& object, |
| 267 PaintPropertyTreeBuilderContext& context) { | 267 PaintPropertyTreeBuilderContext& context) { |
| 268 DCHECK(object.isSVG() && !object.isSVGRoot()); | 268 DCHECK(object.isSVG() && !object.isSVGRoot()); |
| 269 // SVG (other than SVGForeignObject) does not use paint offset internally. | 269 // SVG (other than SVGForeignObject) does not use paint offset internally. |
| 270 DCHECK(object.isSVGForeignObject() || | 270 DCHECK(object.isSVGForeignObject() || |
| 271 context.current.paintOffset == LayoutPoint()); | 271 context.current.paintOffset == LayoutPoint()); |
| 272 | 272 |
| 273 if (object.needsPaintPropertyUpdate()) { | 273 if (object.needsPaintPropertyUpdate()) { |
| 274 // TODO(pdr): Refactor this so all non-root SVG objects use the same | 274 AffineTransform transform = object.localToSVGParentTransform(); |
| 275 // transform function. | |
| 276 const AffineTransform& transform = object.isSVGForeignObject() | |
| 277 ? object.localSVGTransform() | |
| 278 : object.localToSVGParentTransform(); | |
| 279 // TODO(pdr): Check for the presence of a transform instead of the value. | 275 // TODO(pdr): Check for the presence of a transform instead of the value. |
| 280 // Checking for an identity matrix will cause the property tree structure | 276 // Checking for an identity matrix will cause the property tree structure |
| 281 // to change during animations if the animation passes through the | 277 // to change during animations if the animation passes through the |
| 282 // identity matrix. | 278 // identity matrix. |
| 283 if (!transform.isIdentity()) { | 279 if (!transform.isIdentity()) { |
| 284 // The origin is included in the local transform, so leave origin empty. | 280 // The origin is included in the local transform, so leave origin empty. |
| 285 object.getMutableForPainting().ensurePaintProperties().updateTransform( | 281 object.getMutableForPainting().ensurePaintProperties().updateTransform( |
| 286 context.current.transform, TransformationMatrix(transform), | 282 context.current.transform, TransformationMatrix(transform), |
| 287 FloatPoint3D()); | 283 FloatPoint3D()); |
| 288 } else { | 284 } else { |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 #endif | 896 #endif |
| 901 | 897 |
| 902 updateOverflowClip(object, context); | 898 updateOverflowClip(object, context); |
| 903 updatePerspective(object, context); | 899 updatePerspective(object, context); |
| 904 updateSvgLocalToBorderBoxTransform(object, context); | 900 updateSvgLocalToBorderBoxTransform(object, context); |
| 905 updateScrollAndScrollTranslation(object, context); | 901 updateScrollAndScrollTranslation(object, context); |
| 906 updateOutOfFlowContext(object, context); | 902 updateOutOfFlowContext(object, context); |
| 907 } | 903 } |
| 908 | 904 |
| 909 } // namespace blink | 905 } // namespace blink |
| OLD | NEW |