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