| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/SVGTextPainter.h" | 5 #include "core/paint/SVGTextPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/svg/LayoutSVGText.h" | 7 #include "core/layout/svg/LayoutSVGText.h" |
| 8 #include "core/paint/BlockPainter.h" | 8 #include "core/paint/BlockPainter.h" |
| 9 #include "core/paint/PaintInfo.h" | 9 #include "core/paint/PaintInfo.h" |
| 10 #include "core/paint/TransformRecorder.h" | 10 #include "core/paint/SVGPaintContext.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 void SVGTextPainter::paint(const PaintInfo& paintInfo) | 14 void SVGTextPainter::paint(const PaintInfo& paintInfo) |
| 15 { | 15 { |
| 16 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection) | 16 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection) |
| 17 return; | 17 return; |
| 18 | 18 |
| 19 PaintInfo blockInfo(paintInfo); | 19 PaintInfo blockInfo(paintInfo); |
| 20 blockInfo.updateCullRect(m_layoutSVGText.localToSVGParentTransform()); | 20 blockInfo.updateCullRect(m_layoutSVGText.localToSVGParentTransform()); |
| 21 TransformRecorder transformRecorder(blockInfo.context, m_layoutSVGText, m_la
youtSVGText.localToSVGParentTransform()); | 21 SVGTransformContext transformContext(blockInfo.context, m_layoutSVGText, m_l
ayoutSVGText.localToSVGParentTransform()); |
| 22 | 22 |
| 23 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint()); | 23 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint()); |
| 24 | 24 |
| 25 // Paint the outlines, if any | 25 // Paint the outlines, if any |
| 26 if (paintInfo.phase == PaintPhaseForeground) { | 26 if (paintInfo.phase == PaintPhaseForeground) { |
| 27 blockInfo.phase = PaintPhaseOutline; | 27 blockInfo.phase = PaintPhaseOutline; |
| 28 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint()); | 28 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint()); |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace blink | 32 } // namespace blink |
| OLD | NEW |