Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / paint / SVGTextPainter.cpp
blob5ba025877ab6926fba3953343fa087fe9036b061
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
3 // found in the LICENSE file.
5 #include "config.h"
6 #include "core/paint/SVGTextPainter.h"
8 #include "core/layout/svg/LayoutSVGText.h"
9 #include "core/paint/BlockPainter.h"
10 #include "core/paint/PaintInfo.h"
11 #include "core/paint/TransformRecorder.h"
13 namespace blink {
15 void SVGTextPainter::paint(const PaintInfo& paintInfo)
17 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
18 return;
20 PaintInfo blockInfo(paintInfo);
21 blockInfo.updateCullRectForSVGTransform(m_layoutSVGText.localToParentTransform());
22 TransformRecorder transformRecorder(*blockInfo.context, m_layoutSVGText, m_layoutSVGText.localToParentTransform());
24 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint());
26 // Paint the outlines, if any
27 if (paintInfo.phase == PaintPhaseForeground) {
28 blockInfo.phase = PaintPhaseSelfOutline;
29 BlockPainter(m_layoutSVGText).paint(blockInfo, LayoutPoint());
33 } // namespace blink