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

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

Issue 1391753005: (WIP) Invalidation during painting (for synchronized painting) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
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 "core/paint/SVGRootInlineBoxPainter.h" 5 #include "core/paint/SVGRootInlineBoxPainter.h"
6 6
7 #include "core/layout/api/LineLayoutAPIShim.h" 7 #include "core/layout/api/LineLayoutAPIShim.h"
8 #include "core/layout/api/SelectionState.h" 8 #include "core/layout/api/SelectionState.h"
9 #include "core/layout/svg/line/SVGInlineFlowBox.h" 9 #include "core/layout/svg/line/SVGInlineFlowBox.h"
10 #include "core/layout/svg/line/SVGInlineTextBox.h" 10 #include "core/layout/svg/line/SVGInlineTextBox.h"
11 #include "core/layout/svg/line/SVGRootInlineBox.h" 11 #include "core/layout/svg/line/SVGRootInlineBox.h"
12 #include "core/paint/LayoutObjectDrawingRecorder.h" 12 #include "core/paint/LayoutObjectDrawingRecorder.h"
13 #include "core/paint/PaintInfo.h" 13 #include "core/paint/PaintInfo.h"
14 #include "core/paint/SVGInlineFlowBoxPainter.h" 14 #include "core/paint/SVGInlineFlowBoxPainter.h"
15 #include "core/paint/SVGInlineTextBoxPainter.h" 15 #include "core/paint/SVGInlineTextBoxPainter.h"
16 #include "core/paint/SVGPaintContext.h" 16 #include "core/paint/SVGPaintContext.h"
17 17
18 namespace blink { 18 namespace blink {
19 19
20 void SVGRootInlineBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin t& paintOffset) 20 void SVGRootInlineBoxPainter::paint(const PaintInfo& paintInfo, const LayoutPoin t& paintOffset)
21 { 21 {
22 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPh aseSelection); 22 ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPh aseSelection);
23 23
24 bool hasSelection = !paintInfo.isPrinting() && m_svgRootInlineBox.selectionS tate() != SelectionNone; 24 bool hasSelection = !paintInfo.isPrinting() && m_svgRootInlineBox.selectionS tate() != SelectionNone;
25 25
26 PaintInfo paintInfoBeforeFiltering(paintInfo); 26 PaintInfo paintInfoBeforeFiltering(paintInfo);
27 if (hasSelection && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible (paintInfoBeforeFiltering.context, *LineLayoutAPIShim::constLayoutObjectFrom(m_s vgRootInlineBox.lineLayoutItem()), 27 if (hasSelection && !LayoutObjectDrawingRecorder::useCachedDrawingIfPossible (paintInfoBeforeFiltering.context, *LineLayoutAPIShim::constLayoutObjectFrom(m_s vgRootInlineBox.lineLayoutItem()), paintInfoBeforeFiltering.phase)) {
28 paintInfoBeforeFiltering.phase, paintOffset)) { 28 LayoutObjectDrawingRecorder recorder(paintInfoBeforeFiltering.context, * LineLayoutAPIShim::constLayoutObjectFrom(m_svgRootInlineBox.lineLayoutItem()), p aintInfoBeforeFiltering.phase, paintInfoBeforeFiltering.cullRect().m_rect);
29 LayoutObjectDrawingRecorder recorder(paintInfoBeforeFiltering.context, * LineLayoutAPIShim::constLayoutObjectFrom(m_svgRootInlineBox.lineLayoutItem()), p aintInfoBeforeFiltering.phase,
30 paintInfoBeforeFiltering.cullRect().m_rect, paintOffset);
31 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) { 29 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) {
32 if (child->isSVGInlineTextBox()) 30 if (child->isSVGInlineTextBox())
33 SVGInlineTextBoxPainter(*toSVGInlineTextBox(child)).paintSelecti onBackground(paintInfoBeforeFiltering); 31 SVGInlineTextBoxPainter(*toSVGInlineTextBox(child)).paintSelecti onBackground(paintInfoBeforeFiltering);
34 else if (child->isSVGInlineFlowBox()) 32 else if (child->isSVGInlineFlowBox())
35 SVGInlineFlowBoxPainter(*toSVGInlineFlowBox(child)).paintSelecti onBackground(paintInfoBeforeFiltering); 33 SVGInlineFlowBoxPainter(*toSVGInlineFlowBox(child)).paintSelecti onBackground(paintInfoBeforeFiltering);
36 } 34 }
37 } 35 }
38 36
39 SVGPaintContext paintContext(*LineLayoutAPIShim::constLayoutObjectFrom(m_svg RootInlineBox.lineLayoutItem()), paintInfoBeforeFiltering); 37 SVGPaintContext paintContext(*LineLayoutAPIShim::constLayoutObjectFrom(m_svg RootInlineBox.lineLayoutItem()), paintInfoBeforeFiltering);
40 if (paintContext.applyClipMaskAndFilterIfNecessary()) { 38 if (paintContext.applyClipMaskAndFilterIfNecessary()) {
41 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine()) 39 for (InlineBox* child = m_svgRootInlineBox.firstChild(); child; child = child->nextOnLine())
42 child->paint(paintContext.paintInfo(), paintOffset, LayoutUnit(), La youtUnit()); 40 child->paint(paintContext.paintInfo(), paintOffset, LayoutUnit(), La youtUnit());
43 } 41 }
44 } 42 }
45 43
46 } // namespace blink 44 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/SVGPaintContext.cpp ('k') | third_party/WebKit/Source/core/paint/SVGShapePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698