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 "platform/wtf/Allocator.h" | 10 #include "platform/wtf/Allocator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 struct PaintInfo; | 14 struct PaintInfo; |
15 | 15 |
16 class Color; | 16 class Color; |
17 class CompositionUnderline; | 17 class CompositionUnderline; |
18 class ComputedStyle; | 18 class ComputedStyle; |
19 class DocumentMarker; | 19 class DocumentMarker; |
20 class Font; | 20 class Font; |
21 class GraphicsContext; | 21 class GraphicsContext; |
22 class InlineTextBox; | 22 class InlineTextBox; |
23 class LayoutObject; | 23 class LayoutObject; |
24 class LayoutPoint; | 24 class LayoutPoint; |
25 class LayoutTextCombine; | 25 class LayoutTextCombine; |
| 26 class TextMatchMarker; |
26 | 27 |
27 enum class DocumentMarkerPaintPhase { kForeground, kBackground }; | 28 enum class DocumentMarkerPaintPhase { kForeground, kBackground }; |
28 | 29 |
29 class InlineTextBoxPainter { | 30 class InlineTextBoxPainter { |
30 STACK_ALLOCATED(); | 31 STACK_ALLOCATED(); |
31 | 32 |
32 public: | 33 public: |
33 InlineTextBoxPainter(const InlineTextBox& inline_text_box) | 34 InlineTextBoxPainter(const InlineTextBox& inline_text_box) |
34 : inline_text_box_(inline_text_box) {} | 35 : inline_text_box_(inline_text_box) {} |
35 | 36 |
36 void Paint(const PaintInfo&, const LayoutPoint&); | 37 void Paint(const PaintInfo&, const LayoutPoint&); |
37 void PaintDocumentMarkers(const PaintInfo&, | 38 void PaintDocumentMarkers(const PaintInfo&, |
38 const LayoutPoint& box_origin, | 39 const LayoutPoint& box_origin, |
39 const ComputedStyle&, | 40 const ComputedStyle&, |
40 const Font&, | 41 const Font&, |
41 DocumentMarkerPaintPhase); | 42 DocumentMarkerPaintPhase); |
42 void PaintDocumentMarker(GraphicsContext&, | 43 void PaintDocumentMarker(GraphicsContext&, |
43 const LayoutPoint& box_origin, | 44 const LayoutPoint& box_origin, |
44 const DocumentMarker&, | 45 const DocumentMarker&, |
45 const ComputedStyle&, | 46 const ComputedStyle&, |
46 const Font&, | 47 const Font&, |
47 bool grammar); | 48 bool grammar); |
48 void PaintTextMatchMarkerForeground(const PaintInfo&, | 49 void PaintTextMatchMarkerForeground(const PaintInfo&, |
49 const LayoutPoint& box_origin, | 50 const LayoutPoint& box_origin, |
50 const DocumentMarker&, | 51 const TextMatchMarker&, |
51 const ComputedStyle&, | 52 const ComputedStyle&, |
52 const Font&); | 53 const Font&); |
53 void PaintTextMatchMarkerBackground(const PaintInfo&, | 54 void PaintTextMatchMarkerBackground(const PaintInfo&, |
54 const LayoutPoint& box_origin, | 55 const LayoutPoint& box_origin, |
55 const DocumentMarker&, | 56 const TextMatchMarker&, |
56 const ComputedStyle&, | 57 const ComputedStyle&, |
57 const Font&); | 58 const Font&); |
58 | 59 |
59 static bool PaintsMarkerHighlights(const LayoutObject&); | 60 static bool PaintsMarkerHighlights(const LayoutObject&); |
60 | 61 |
61 private: | 62 private: |
62 enum class PaintOptions { kNormal, kCombinedText }; | 63 enum class PaintOptions { kNormal, kCombinedText }; |
63 | 64 |
64 void PaintCompositionBackgrounds(GraphicsContext&, | 65 void PaintCompositionBackgrounds(GraphicsContext&, |
65 const LayoutPoint& box_origin, | 66 const LayoutPoint& box_origin, |
(...skipping 23 matching lines...) Expand all Loading... |
89 bool ShouldPaintTextBox(const PaintInfo&); | 90 bool ShouldPaintTextBox(const PaintInfo&); |
90 void ExpandToIncludeNewlineForSelection(LayoutRect&); | 91 void ExpandToIncludeNewlineForSelection(LayoutRect&); |
91 LayoutObject& InlineLayoutObject() const; | 92 LayoutObject& InlineLayoutObject() const; |
92 | 93 |
93 const InlineTextBox& inline_text_box_; | 94 const InlineTextBox& inline_text_box_; |
94 }; | 95 }; |
95 | 96 |
96 } // namespace blink | 97 } // namespace blink |
97 | 98 |
98 #endif // InlineTextBoxPainter_h | 99 #endif // InlineTextBoxPainter_h |
OLD | NEW |