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 InlineTextBoxPainter_h | 5 #ifndef InlineTextBoxPainter_h |
6 #define InlineTextBoxPainter_h | 6 #define InlineTextBoxPainter_h |
7 | 7 |
8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
9 #include "platform/geometry/LayoutRect.h" | 9 #include "platform/geometry/LayoutRect.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 struct PaintInfo; | 14 struct PaintInfo; |
15 | 15 |
16 class AppliedTextDecoration; | 16 class AppliedTextDecoration; |
17 class Color; | 17 class Color; |
18 class CompositionUnderline; | 18 class CompositionUnderline; |
19 class ComputedStyle; | 19 class ComputedStyle; |
20 class DocumentMarker; | 20 class DocumentMarker; |
21 class Font; | 21 class Font; |
22 class GraphicsContext; | 22 class GraphicsContext; |
23 class InlineTextBox; | 23 class InlineTextBox; |
24 class LayoutObject; | 24 class LayoutObject; |
25 class LayoutPoint; | 25 class LayoutPoint; |
26 class LayoutTextCombine; | 26 class LayoutTextCombine; |
| 27 class TextMatchMarker; |
27 class TextPainter; | 28 class TextPainter; |
28 | 29 |
29 enum class DocumentMarkerPaintPhase { Foreground, Background }; | 30 enum class DocumentMarkerPaintPhase { Foreground, Background }; |
30 | 31 |
31 class InlineTextBoxPainter { | 32 class InlineTextBoxPainter { |
32 STACK_ALLOCATED(); | 33 STACK_ALLOCATED(); |
33 | 34 |
34 public: | 35 public: |
35 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) | 36 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) |
36 : m_inlineTextBox(inlineTextBox) {} | 37 : m_inlineTextBox(inlineTextBox) {} |
37 | 38 |
38 void paint(const PaintInfo&, const LayoutPoint&); | 39 void paint(const PaintInfo&, const LayoutPoint&); |
39 void paintDocumentMarkers(const PaintInfo&, | 40 void paintDocumentMarkers(const PaintInfo&, |
40 const LayoutPoint& boxOrigin, | 41 const LayoutPoint& boxOrigin, |
41 const ComputedStyle&, | 42 const ComputedStyle&, |
42 const Font&, | 43 const Font&, |
43 DocumentMarkerPaintPhase); | 44 DocumentMarkerPaintPhase); |
44 void paintDocumentMarker(GraphicsContext&, | 45 void paintDocumentMarker(GraphicsContext&, |
45 const LayoutPoint& boxOrigin, | 46 const LayoutPoint& boxOrigin, |
46 const DocumentMarker&, | 47 const DocumentMarker&, |
47 const ComputedStyle&, | 48 const ComputedStyle&, |
48 const Font&, | 49 const Font&, |
49 bool grammar); | 50 bool grammar); |
50 void paintTextMatchMarkerForeground(const PaintInfo&, | 51 void paintTextMatchMarkerForeground(const PaintInfo&, |
51 const LayoutPoint& boxOrigin, | 52 const LayoutPoint& boxOrigin, |
52 const DocumentMarker&, | 53 const TextMatchMarker&, |
53 const ComputedStyle&, | 54 const ComputedStyle&, |
54 const Font&); | 55 const Font&); |
55 void paintTextMatchMarkerBackground(const PaintInfo&, | 56 void paintTextMatchMarkerBackground(const PaintInfo&, |
56 const LayoutPoint& boxOrigin, | 57 const LayoutPoint& boxOrigin, |
57 const DocumentMarker&, | 58 const TextMatchMarker&, |
58 const ComputedStyle&, | 59 const ComputedStyle&, |
59 const Font&); | 60 const Font&); |
60 | 61 |
61 static bool paintsMarkerHighlights(const LayoutObject&); | 62 static bool paintsMarkerHighlights(const LayoutObject&); |
62 | 63 |
63 private: | 64 private: |
64 enum class PaintOptions { Normal, CombinedText }; | 65 enum class PaintOptions { Normal, CombinedText }; |
65 | 66 |
66 void paintCompositionBackgrounds(GraphicsContext&, | 67 void paintCompositionBackgrounds(GraphicsContext&, |
67 const LayoutPoint& boxOrigin, | 68 const LayoutPoint& boxOrigin, |
(...skipping 26 matching lines...) Expand all Loading... |
94 bool shouldPaintTextBox(const PaintInfo&); | 95 bool shouldPaintTextBox(const PaintInfo&); |
95 void expandToIncludeNewlineForSelection(LayoutRect&); | 96 void expandToIncludeNewlineForSelection(LayoutRect&); |
96 LayoutObject& inlineLayoutObject() const; | 97 LayoutObject& inlineLayoutObject() const; |
97 | 98 |
98 const InlineTextBox& m_inlineTextBox; | 99 const InlineTextBox& m_inlineTextBox; |
99 }; | 100 }; |
100 | 101 |
101 } // namespace blink | 102 } // namespace blink |
102 | 103 |
103 #endif // InlineTextBoxPainter_h | 104 #endif // InlineTextBoxPainter_h |
OLD | NEW |