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 #ifndef SVGInlineTextBoxPainter_h | 5 #ifndef SVGInlineTextBoxPainter_h |
6 #define SVGInlineTextBoxPainter_h | 6 #define SVGInlineTextBoxPainter_h |
7 | 7 |
8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
9 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" | 9 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class SVGInlineTextBoxPainter { | 36 class SVGInlineTextBoxPainter { |
37 STACK_ALLOCATED(); | 37 STACK_ALLOCATED(); |
38 | 38 |
39 public: | 39 public: |
40 SVGInlineTextBoxPainter(const SVGInlineTextBox& svgInlineTextBox) | 40 SVGInlineTextBoxPainter(const SVGInlineTextBox& svgInlineTextBox) |
41 : m_svgInlineTextBox(svgInlineTextBox) {} | 41 : m_svgInlineTextBox(svgInlineTextBox) {} |
42 void paint(const PaintInfo&, const LayoutPoint&); | 42 void paint(const PaintInfo&, const LayoutPoint&); |
43 void paintSelectionBackground(const PaintInfo&); | 43 void paintSelectionBackground(const PaintInfo&); |
44 void paintTextMatchMarkerForeground(const PaintInfo&, | 44 void paintTextMatchMarkerForeground(const PaintInfo&, |
45 const LayoutPoint&, | 45 const LayoutPoint&, |
46 DocumentMarker*, | 46 const DocumentMarker&, |
47 const ComputedStyle&, | 47 const ComputedStyle&, |
48 const Font&); | 48 const Font&); |
49 void paintTextMatchMarkerBackground(const PaintInfo&, | 49 void paintTextMatchMarkerBackground(const PaintInfo&, |
50 const LayoutPoint&, | 50 const LayoutPoint&, |
51 DocumentMarker*, | 51 const DocumentMarker&, |
52 const ComputedStyle&, | 52 const ComputedStyle&, |
53 const Font&); | 53 const Font&); |
54 | 54 |
55 private: | 55 private: |
56 bool shouldPaintSelection(const PaintInfo&) const; | 56 bool shouldPaintSelection(const PaintInfo&) const; |
57 FloatRect boundsForDrawingRecorder(const PaintInfo&, | 57 FloatRect boundsForDrawingRecorder(const PaintInfo&, |
58 const ComputedStyle&, | 58 const ComputedStyle&, |
59 const LayoutPoint&, | 59 const LayoutPoint&, |
60 bool includeSelectionRect) const; | 60 bool includeSelectionRect) const; |
61 void paintTextFragments(const PaintInfo&, LayoutObject&); | 61 void paintTextFragments(const PaintInfo&, LayoutObject&); |
62 void paintDecoration(const PaintInfo&, | 62 void paintDecoration(const PaintInfo&, |
63 TextDecoration, | 63 TextDecoration, |
64 const SVGTextFragment&); | 64 const SVGTextFragment&); |
65 bool setupTextPaint(const PaintInfo&, | 65 bool setupTextPaint(const PaintInfo&, |
66 const ComputedStyle&, | 66 const ComputedStyle&, |
67 LayoutSVGResourceMode, | 67 LayoutSVGResourceMode, |
68 SkPaint&); | 68 SkPaint&); |
69 void paintText(const PaintInfo&, | 69 void paintText(const PaintInfo&, |
70 TextRun&, | 70 TextRun&, |
71 const SVGTextFragment&, | 71 const SVGTextFragment&, |
72 int startPosition, | 72 int startPosition, |
73 int endPosition, | 73 int endPosition, |
74 const SkPaint&); | 74 const SkPaint&); |
75 void paintText(const PaintInfo&, | 75 void paintText(const PaintInfo&, |
76 const ComputedStyle&, | 76 const ComputedStyle&, |
77 const ComputedStyle& selectionStyle, | 77 const ComputedStyle& selectionStyle, |
78 const SVGTextFragment&, | 78 const SVGTextFragment&, |
79 LayoutSVGResourceMode, | 79 LayoutSVGResourceMode, |
80 bool shouldPaintSelection); | 80 bool shouldPaintSelection); |
81 Vector<SVGTextFragmentWithRange> collectTextMatches(DocumentMarker*) const; | 81 Vector<SVGTextFragmentWithRange> collectTextMatches( |
| 82 const DocumentMarker&) const; |
82 Vector<SVGTextFragmentWithRange> collectFragmentsInRange( | 83 Vector<SVGTextFragmentWithRange> collectFragmentsInRange( |
83 int startPosition, | 84 int startPosition, |
84 int endPosition) const; | 85 int endPosition) const; |
85 LayoutObject& inlineLayoutObject() const; | 86 LayoutObject& inlineLayoutObject() const; |
86 LayoutObject& parentInlineLayoutObject() const; | 87 LayoutObject& parentInlineLayoutObject() const; |
87 LayoutSVGInlineText& inlineText() const; | 88 LayoutSVGInlineText& inlineText() const; |
88 | 89 |
89 const SVGInlineTextBox& m_svgInlineTextBox; | 90 const SVGInlineTextBox& m_svgInlineTextBox; |
90 }; | 91 }; |
91 | 92 |
92 } // namespace blink | 93 } // namespace blink |
93 | 94 |
94 #endif // SVGInlineTextBoxPainter_h | 95 #endif // SVGInlineTextBoxPainter_h |
OLD | NEW |