| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 style.transformOriginZ()); | 95 style.transformOriginZ()); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void PaintPropertyTreeBuilder::updateTransform(const LayoutObject& object, Paint
PropertyTreeBuilderContext& context) | 98 void PaintPropertyTreeBuilder::updateTransform(const LayoutObject& object, Paint
PropertyTreeBuilderContext& context) |
| 99 { | 99 { |
| 100 if (object.isSVG() && !object.isSVGRoot()) { | 100 if (object.isSVG() && !object.isSVGRoot()) { |
| 101 // SVG does not use paint offset internally and the root should have alr
eady accounted for | 101 // SVG does not use paint offset internally and the root should have alr
eady accounted for |
| 102 // any paint offset in the root's svgLocalToBorderBox transform. | 102 // any paint offset in the root's svgLocalToBorderBox transform. |
| 103 DCHECK(context.paintOffset == LayoutPoint()); | 103 DCHECK(context.paintOffset == LayoutPoint()); |
| 104 | 104 |
| 105 // TODO(pdr): Check for the presence of a transform instead of the value
. Checking for an | 105 // FIXME(pdr): Check for the presence of a transform instead of the valu
e. Checking for an |
| 106 // identity matrix will cause the property tree structure to change duri
ng animations if | 106 // identity matrix will cause the property tree structure to change duri
ng animations if |
| 107 // the animation passes through the identity matrix. | 107 // the animation passes through the identity matrix. |
| 108 const AffineTransform& transform = object.localToSVGParentTransform(); | 108 // FIXME(pdr): Refactor this so all non-root SVG objects use the same tr
ansform function. |
| 109 const AffineTransform& transform = object.isSVGForeignObject() ? object.
localSVGTransform() : object.localToSVGParentTransform(); |
| 109 if (transform.isIdentity()) | 110 if (transform.isIdentity()) |
| 110 return; | 111 return; |
| 111 | 112 |
| 112 // The origin is included in the local transform, so use an empty origin
. | 113 // The origin is included in the local transform, so use an empty origin
. |
| 113 RefPtr<TransformPaintPropertyNode> svgTransform = TransformPaintProperty
Node::create( | 114 RefPtr<TransformPaintPropertyNode> svgTransform = TransformPaintProperty
Node::create( |
| 114 transform, FloatPoint3D(0, 0, 0), context.currentTransform); | 115 transform, FloatPoint3D(0, 0, 0), context.currentTransform); |
| 115 context.currentTransform = svgTransform.get(); | 116 context.currentTransform = svgTransform.get(); |
| 116 object.getMutableForPainting().ensureObjectPaintProperties().setTransfor
m(svgTransform.release()); | 117 object.getMutableForPainting().ensureObjectPaintProperties().setTransfor
m(svgTransform.release()); |
| 117 return; | 118 return; |
| 118 } | 119 } |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 updateOverflowClip(object, context); | 400 updateOverflowClip(object, context); |
| 400 // TODO(trchen): Insert flattening transform here, as specified by | 401 // TODO(trchen): Insert flattening transform here, as specified by |
| 401 // http://www.w3.org/TR/css3-transforms/#transform-style-property | 402 // http://www.w3.org/TR/css3-transforms/#transform-style-property |
| 402 updatePerspective(object, context); | 403 updatePerspective(object, context); |
| 403 updateSvgLocalToBorderBoxTransform(object, context); | 404 updateSvgLocalToBorderBoxTransform(object, context); |
| 404 updateScrollTranslation(object, context); | 405 updateScrollTranslation(object, context); |
| 405 updateOutOfFlowContext(object, context); | 406 updateOutOfFlowContext(object, context); |
| 406 } | 407 } |
| 407 | 408 |
| 408 } // namespace blink | 409 } // namespace blink |
| OLD | NEW |