Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1556)

Unified Diff: Source/core/paint/SVGTextPainter.cpp

Issue 599283002: Move paint code from RenderSVGText to SVGTextPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/SVGTextPainter.h ('k') | Source/core/rendering/svg/RenderSVGText.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGTextPainter.cpp
diff --git a/Source/core/paint/SVGTextPainter.cpp b/Source/core/paint/SVGTextPainter.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..72c79c470f820a56bf21aedfc4069677287fc178
--- /dev/null
+++ b/Source/core/paint/SVGTextPainter.cpp
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/paint/SVGTextPainter.h"
+
+#include "core/paint/BlockPainter.h"
+#include "core/rendering/PaintInfo.h"
+#include "core/rendering/svg/RenderSVGText.h"
+#include "platform/graphics/GraphicsContextStateSaver.h"
+
+namespace blink {
+
+void SVGTextPainter::paint(PaintInfo& paintInfo)
+{
+ if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection)
+ return;
+
+ PaintInfo blockInfo(paintInfo);
+ GraphicsContextStateSaver stateSaver(*blockInfo.context, false);
+ const AffineTransform& localTransform = m_renderSVGText.localToParentTransform();
+ if (!localTransform.isIdentity()) {
+ stateSaver.save();
+ blockInfo.applyTransform(localTransform, false);
+ }
+ BlockPainter(m_renderSVGText).paint(blockInfo, LayoutPoint());
+
+ // Paint the outlines, if any
+ if (paintInfo.phase == PaintPhaseForeground) {
+ blockInfo.phase = PaintPhaseSelfOutline;
+ BlockPainter(m_renderSVGText).paint(blockInfo, LayoutPoint());
+ }
+}
+
+} // namespace blink
« no previous file with comments | « Source/core/paint/SVGTextPainter.h ('k') | Source/core/rendering/svg/RenderSVGText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698