Chromium Code Reviews| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 256 context.currentTransform = perspective.get(); | 256 context.currentTransform = perspective.get(); |
| 257 object.getMutableForPainting().ensureObjectPaintProperties().setPerspective( perspective.release()); | 257 object.getMutableForPainting().ensureObjectPaintProperties().setPerspective( perspective.release()); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(const LayoutOb ject& object, PaintPropertyTreeBuilderContext& context) | 260 void PaintPropertyTreeBuilder::updateSvgLocalToBorderBoxTransform(const LayoutOb ject& object, PaintPropertyTreeBuilderContext& context) |
| 261 { | 261 { |
| 262 if (!object.isSVGRoot()) | 262 if (!object.isSVGRoot()) |
| 263 return; | 263 return; |
| 264 | 264 |
| 265 AffineTransform transformToBorderBox = SVGRootPainter(toLayoutSVGRoot(object )).transformToPixelSnappedBorderBox(context.paintOffset); | 265 AffineTransform transformToBorderBox = SVGRootPainter(toLayoutSVGRoot(object )).transformToPixelSnappedBorderBox(context.paintOffset); |
| 266 if (transformToBorderBox.isIdentity()) | 266 if (transformToBorderBox.isIdentity()) { |
|
chrishtr
2016/07/08 15:07:03
What does paintOffset being zero have to do with t
| |
| 267 // SVG does not use paint offset internally so ensure it is set to zero. Pixel snapping can | |
| 268 // cause an identity |transformToBorderBox| even though |context.paintOf fset| is non-zero. | |
| 269 context.paintOffset = LayoutPoint(); | |
|
chrishtr
2016/07/08 17:40:21
How about just moving this line up above 266 then,
pdr.
2016/07/08 18:04:40
Sounds reasonable, done.
PTAL
| |
| 267 return; | 270 return; |
| 271 } | |
| 268 | 272 |
| 269 RefPtr<TransformPaintPropertyNode> svgLocalToBorderBoxTransform = TransformP aintPropertyNode::create( | 273 RefPtr<TransformPaintPropertyNode> svgLocalToBorderBoxTransform = TransformP aintPropertyNode::create( |
| 270 transformToBorderBox, FloatPoint3D(0, 0, 0), context.currentTransform); | 274 transformToBorderBox, FloatPoint3D(0, 0, 0), context.currentTransform); |
| 271 context.currentTransform = svgLocalToBorderBoxTransform.get(); | 275 context.currentTransform = svgLocalToBorderBoxTransform.get(); |
| 272 context.paintOffset = LayoutPoint(); | 276 context.paintOffset = LayoutPoint(); |
| 273 object.getMutableForPainting().ensureObjectPaintProperties().setSvgLocalToBo rderBoxTransform(svgLocalToBorderBoxTransform.release()); | 277 object.getMutableForPainting().ensureObjectPaintProperties().setSvgLocalToBo rderBoxTransform(svgLocalToBorderBoxTransform.release()); |
| 274 } | 278 } |
| 275 | 279 |
| 276 void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& objec t, PaintPropertyTreeBuilderContext& context) | 280 void PaintPropertyTreeBuilder::updateScrollTranslation(const LayoutObject& objec t, PaintPropertyTreeBuilderContext& context) |
| 277 { | 281 { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 403 updateOverflowClip(object, context); | 407 updateOverflowClip(object, context); |
| 404 // TODO(trchen): Insert flattening transform here, as specified by | 408 // TODO(trchen): Insert flattening transform here, as specified by |
| 405 // http://www.w3.org/TR/css3-transforms/#transform-style-property | 409 // http://www.w3.org/TR/css3-transforms/#transform-style-property |
| 406 updatePerspective(object, context); | 410 updatePerspective(object, context); |
| 407 updateSvgLocalToBorderBoxTransform(object, context); | 411 updateSvgLocalToBorderBoxTransform(object, context); |
| 408 updateScrollTranslation(object, context); | 412 updateScrollTranslation(object, context); |
| 409 updateOutOfFlowContext(object, context); | 413 updateOutOfFlowContext(object, context); |
| 410 } | 414 } |
| 411 | 415 |
| 412 } // namespace blink | 416 } // namespace blink |
| OLD | NEW |