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.
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"
15 void SVGTextPainter::paint(const PaintInfo
& paintInfo
)
17 if (paintInfo
.phase
!= PaintPhaseForeground
&& paintInfo
.phase
!= PaintPhaseSelection
)
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());