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