OLD | NEW |
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& paint_info, | 20 void SVGRootInlineBoxPainter::Paint(const PaintInfo& paint_info, |
21 const LayoutPoint& paint_offset) { | 21 const LayoutPoint& paint_offset) { |
22 DCHECK(paint_info.phase == kPaintPhaseForeground || | 22 DCHECK(paint_info.phase == kPaintPhaseForeground || |
23 paint_info.phase == kPaintPhaseSelection); | 23 paint_info.phase == kPaintPhaseSelection); |
24 | 24 |
25 bool has_selection = | 25 bool has_selection = |
26 !paint_info.IsPrinting() && | 26 !paint_info.IsPrinting() && |
27 svg_root_inline_box_.GetSelectionState() != SelectionNone; | 27 svg_root_inline_box_.GetSelectionState() != SelectionState::kNone; |
28 | 28 |
29 PaintInfo paint_info_before_filtering(paint_info); | 29 PaintInfo paint_info_before_filtering(paint_info); |
30 if (has_selection && !LayoutObjectDrawingRecorder::UseCachedDrawingIfPossible( | 30 if (has_selection && !LayoutObjectDrawingRecorder::UseCachedDrawingIfPossible( |
31 paint_info_before_filtering.context, | 31 paint_info_before_filtering.context, |
32 *LineLayoutAPIShim::ConstLayoutObjectFrom( | 32 *LineLayoutAPIShim::ConstLayoutObjectFrom( |
33 svg_root_inline_box_.GetLineLayoutItem()), | 33 svg_root_inline_box_.GetLineLayoutItem()), |
34 paint_info_before_filtering.phase)) { | 34 paint_info_before_filtering.phase)) { |
35 LayoutObjectDrawingRecorder recorder( | 35 LayoutObjectDrawingRecorder recorder( |
36 paint_info_before_filtering.context, | 36 paint_info_before_filtering.context, |
37 *LineLayoutAPIShim::ConstLayoutObjectFrom( | 37 *LineLayoutAPIShim::ConstLayoutObjectFrom( |
(...skipping 16 matching lines...) Expand all Loading... |
54 paint_info_before_filtering); | 54 paint_info_before_filtering); |
55 if (paint_context.ApplyClipMaskAndFilterIfNecessary()) { | 55 if (paint_context.ApplyClipMaskAndFilterIfNecessary()) { |
56 for (InlineBox* child = svg_root_inline_box_.FirstChild(); child; | 56 for (InlineBox* child = svg_root_inline_box_.FirstChild(); child; |
57 child = child->NextOnLine()) | 57 child = child->NextOnLine()) |
58 child->Paint(paint_context.GetPaintInfo(), paint_offset, LayoutUnit(), | 58 child->Paint(paint_context.GetPaintInfo(), paint_offset, LayoutUnit(), |
59 LayoutUnit()); | 59 LayoutUnit()); |
60 } | 60 } |
61 } | 61 } |
62 | 62 |
63 } // namespace blink | 63 } // namespace blink |
OLD | NEW |