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

Side by Side Diff: third_party/WebKit/Source/core/paint/InlineTextBoxPainter.h

Issue 2920373003: [ActiveSuggestionMarker #4] Refactor InlineTextBoxPainter to avoid using CompositionUnderline (Closed)
Patch Set: Rebase Created 3 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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;
18 class ComputedStyle; 17 class ComputedStyle;
19 class DocumentMarker; 18 class DocumentMarker;
20 class Font; 19 class Font;
21 class GraphicsContext; 20 class GraphicsContext;
22 class InlineTextBox; 21 class InlineTextBox;
23 class LayoutObject; 22 class LayoutObject;
24 class LayoutPoint; 23 class LayoutPoint;
25 class LayoutTextCombine; 24 class LayoutTextCombine;
25 class StyleableMarker;
26 class TextMatchMarker; 26 class TextMatchMarker;
27 27
28 enum class DocumentMarkerPaintPhase { kForeground, kBackground }; 28 enum class DocumentMarkerPaintPhase { kForeground, kBackground };
29 29
30 class InlineTextBoxPainter { 30 class InlineTextBoxPainter {
31 STACK_ALLOCATED(); 31 STACK_ALLOCATED();
32 32
33 public: 33 public:
34 InlineTextBoxPainter(const InlineTextBox& inline_text_box) 34 InlineTextBoxPainter(const InlineTextBox& inline_text_box)
35 : inline_text_box_(inline_text_box) {} 35 : inline_text_box_(inline_text_box) {}
(...skipping 19 matching lines...) Expand all
55 const LayoutPoint& box_origin, 55 const LayoutPoint& box_origin,
56 const TextMatchMarker&, 56 const TextMatchMarker&,
57 const ComputedStyle&, 57 const ComputedStyle&,
58 const Font&); 58 const Font&);
59 59
60 static bool PaintsMarkerHighlights(const LayoutObject&); 60 static bool PaintsMarkerHighlights(const LayoutObject&);
61 61
62 private: 62 private:
63 enum class PaintOptions { kNormal, kCombinedText }; 63 enum class PaintOptions { kNormal, kCombinedText };
64 64
65 void PaintSingleCompositionBackgroundRun(GraphicsContext&, 65 void PaintSingleMarkerBackgroundRun(GraphicsContext&,
66 const LayoutPoint& box_origin, 66 const LayoutPoint& box_origin,
67 const ComputedStyle&, 67 const ComputedStyle&,
68 const Font&, 68 const Font&,
69 Color background_color, 69 Color background_color,
70 int start_pos, 70 int start_pos,
71 int end_pos); 71 int end_pos);
72 template <PaintOptions> 72 template <PaintOptions>
73 void PaintSelection(GraphicsContext&, 73 void PaintSelection(GraphicsContext&,
74 const LayoutRect& box_rect, 74 const LayoutRect& box_rect,
75 const ComputedStyle&, 75 const ComputedStyle&,
76 const Font&, 76 const Font&,
77 Color text_color, 77 Color text_color,
78 LayoutTextCombine* = nullptr); 78 LayoutTextCombine* = nullptr);
79 79
80 void PaintCompositionUnderline(GraphicsContext&, 80 void PaintStyleableMarkerUnderline(GraphicsContext&,
81 const LayoutPoint& box_origin, 81 const LayoutPoint& box_origin,
82 const CompositionUnderline&); 82 const StyleableMarker&);
83 unsigned UnderlinePaintStart(const CompositionUnderline&); 83 unsigned MarkerPaintStart(const DocumentMarker&);
84 unsigned UnderlinePaintEnd(const CompositionUnderline&); 84 unsigned MarkerPaintEnd(const DocumentMarker&);
85 bool ShouldPaintTextBox(const PaintInfo&); 85 bool ShouldPaintTextBox(const PaintInfo&);
86 void ExpandToIncludeNewlineForSelection(LayoutRect&); 86 void ExpandToIncludeNewlineForSelection(LayoutRect&);
87 LayoutObject& InlineLayoutObject() const; 87 LayoutObject& InlineLayoutObject() const;
88 88
89 const InlineTextBox& inline_text_box_; 89 const InlineTextBox& inline_text_box_;
90 }; 90 };
91 91
92 } // namespace blink 92 } // namespace blink
93 93
94 #endif // InlineTextBoxPainter_h 94 #endif // InlineTextBoxPainter_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698