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