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

Side by Side Diff: Source/core/paint/SVGRootInlineBoxPainter.cpp

Issue 671943004: Move SVG inline flow box paint code to SVGInlineFlowBoxPainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/SVGRootInlineBoxPainter.h" 6 #include "core/paint/SVGRootInlineBoxPainter.h"
7 7
8 #include "core/paint/SVGInlineFlowBoxPainter.h"
8 #include "core/paint/SVGInlineTextBoxPainter.h" 9 #include "core/paint/SVGInlineTextBoxPainter.h"
9 #include "core/rendering/PaintInfo.h" 10 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/svg/SVGInlineFlowBox.h" 11 #include "core/rendering/svg/SVGInlineFlowBox.h"
11 #include "core/rendering/svg/SVGInlineTextBox.h" 12 #include "core/rendering/svg/SVGInlineTextBox.h"
12 #include "core/rendering/svg/SVGRenderingContext.h" 13 #include "core/rendering/svg/SVGRenderingContext.h"
13 #include "core/rendering/svg/SVGRootInlineBox.h" 14 #include "core/rendering/svg/SVGRootInlineBox.h"
14 #include "platform/graphics/GraphicsContextStateSaver.h" 15 #include "platform/graphics/GraphicsContextStateSaver.h"
15 16
16 namespace blink { 17 namespace blink {
17 18
18 void SVGRootInlineBoxPainter::paint(PaintInfo& paintInfo, const LayoutPoint& pai ntOffset) 19 void SVGRootInlineBoxPainter::paint(PaintInfo& paintInfo, const LayoutPoint& pai ntOffset)
19 { 20 {
20 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPh aseSelection); 21 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPh aseSelection);
21 22
22 bool isPrinting = m_svgRootInlineBox.renderer().document().printing(); 23 bool isPrinting = m_svgRootInlineBox.renderer().document().printing();
23 bool hasSelection = !isPrinting && m_svgRootInlineBox.selectionState() != Re nderObject::SelectionNone; 24 bool hasSelection = !isPrinting && m_svgRootInlineBox.selectionState() != Re nderObject::SelectionNone;
24 25
25 PaintInfo childPaintInfo(paintInfo); 26 PaintInfo childPaintInfo(paintInfo);
26 if (hasSelection) { 27 if (hasSelection) {
27 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) { 28 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) {
28 if (child->isSVGInlineTextBox()) 29 if (child->isSVGInlineTextBox())
29 SVGInlineTextBoxPainter(*toSVGInlineTextBox(child)).paintSelecti onBackground(childPaintInfo); 30 SVGInlineTextBoxPainter(*toSVGInlineTextBox(child)).paintSelecti onBackground(childPaintInfo);
30 else if (child->isSVGInlineFlowBox()) 31 else if (child->isSVGInlineFlowBox())
31 toSVGInlineFlowBox(child)->paintSelectionBackground(childPaintIn fo); 32 SVGInlineFlowBoxPainter(*toSVGInlineFlowBox(child)).paintSelecti onBackground(childPaintInfo);
32 } 33 }
33 } 34 }
34 35
35 GraphicsContextStateSaver stateSaver(*paintInfo.context); 36 GraphicsContextStateSaver stateSaver(*paintInfo.context);
36 SVGRenderingContext renderingContext(&m_svgRootInlineBox.renderer(), paintIn fo); 37 SVGRenderingContext renderingContext(&m_svgRootInlineBox.renderer(), paintIn fo);
37 if (renderingContext.isRenderingPrepared()) { 38 if (renderingContext.isRenderingPrepared()) {
38 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) 39 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine())
39 child->paint(paintInfo, paintOffset, 0, 0); 40 child->paint(paintInfo, paintOffset, 0, 0);
40 } 41 }
41 } 42 }
42 43
43 } // namespace blink 44 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGInlineFlowBoxPainter.cpp ('k') | Source/core/rendering/svg/SVGInlineFlowBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698