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" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 class FloatRect; | 21 class FloatRect; |
22 class Font; | 22 class Font; |
23 class GraphicsContext; | 23 class GraphicsContext; |
24 class InlineTextBox; | 24 class InlineTextBox; |
25 class LayoutPoint; | 25 class LayoutPoint; |
26 class LayoutTextCombine; | 26 class LayoutTextCombine; |
27 | 27 |
28 class InlineTextBoxPainter { | 28 class InlineTextBoxPainter { |
29 STACK_ALLOCATED(); | 29 STACK_ALLOCATED(); |
30 public: | 30 public: |
31 enum class DocumentMarkerPaintPhase { Foreground, Background }; | |
pdr.
2015/12/19 02:39:45
Wdyt about moving this up so you don't need to qua
ramya.v
2015/12/21 08:13:49
Done.
| |
31 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) : m_inlineTextBox(i nlineTextBox) { } | 32 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) : m_inlineTextBox(i nlineTextBox) { } |
32 | 33 |
33 void paint(const PaintInfo&, const LayoutPoint&); | 34 void paint(const PaintInfo&, const LayoutPoint&); |
34 void paintDocumentMarkers(GraphicsContext&, const LayoutPoint& boxOrigin, co nst ComputedStyle&, const Font&, bool background); | 35 void paintDocumentMarkers(const PaintInfo&, const LayoutPoint& boxOrigin, co nst ComputedStyle&, const Font&, DocumentMarkerPaintPhase); |
35 void paintDocumentMarker(GraphicsContext&, const LayoutPoint& boxOrigin, Doc umentMarker*, const ComputedStyle&, const Font&, bool grammar); | 36 void paintDocumentMarker(GraphicsContext&, const LayoutPoint& boxOrigin, Doc umentMarker*, const ComputedStyle&, const Font&, bool grammar); |
36 void paintTextMatchMarker(GraphicsContext&, const LayoutPoint& boxOrigin, Do cumentMarker*, const ComputedStyle&, const Font&); | 37 void paintTextMatchMarkerForeground(const PaintInfo&, const LayoutPoint& box Origin, DocumentMarker*, const ComputedStyle&, const Font&); |
38 void paintTextMatchMarkerBackground(const PaintInfo&, const LayoutPoint& box Origin, DocumentMarker*, const ComputedStyle&, const Font&); | |
37 | 39 |
38 static void removeFromTextBlobCache(const InlineTextBox&); | 40 static void removeFromTextBlobCache(const InlineTextBox&); |
39 | 41 |
40 private: | 42 private: |
41 enum class PaintOptions { Normal, CombinedText }; | 43 enum class PaintOptions { Normal, CombinedText }; |
42 | 44 |
43 void paintCompositionBackgrounds(GraphicsContext&, const LayoutPoint& boxOri gin, const ComputedStyle&, const Font&, bool useCustomUnderlines); | 45 void paintCompositionBackgrounds(GraphicsContext&, const LayoutPoint& boxOri gin, const ComputedStyle&, const Font&, bool useCustomUnderlines); |
44 void paintSingleCompositionBackgroundRun(GraphicsContext&, const LayoutPoint & boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int start Pos, int endPos); | 46 void paintSingleCompositionBackgroundRun(GraphicsContext&, const LayoutPoint & boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int start Pos, int endPos); |
45 template <PaintOptions> | 47 template <PaintOptions> |
46 void paintSelection(GraphicsContext&, const LayoutRect& boxRect, const Compu tedStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); | 48 void paintSelection(GraphicsContext&, const LayoutRect& boxRect, const Compu tedStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); |
47 void paintDecoration(const PaintInfo&, const LayoutPoint& boxOrigin, TextDec oration); | 49 void paintDecoration(const PaintInfo&, const LayoutPoint& boxOrigin, TextDec oration); |
48 void paintCompositionUnderline(GraphicsContext&, const LayoutPoint& boxOrigi n, const CompositionUnderline&); | 50 void paintCompositionUnderline(GraphicsContext&, const LayoutPoint& boxOrigi n, const CompositionUnderline&); |
49 unsigned underlinePaintStart(const CompositionUnderline&); | 51 unsigned underlinePaintStart(const CompositionUnderline&); |
50 unsigned underlinePaintEnd(const CompositionUnderline&); | 52 unsigned underlinePaintEnd(const CompositionUnderline&); |
51 bool shouldPaintTextBox(const PaintInfo&); | 53 bool shouldPaintTextBox(const PaintInfo&); |
52 void expandToIncludeNewlineForSelection(LayoutRect&); | 54 void expandToIncludeNewlineForSelection(LayoutRect&); |
53 | 55 |
54 const InlineTextBox& m_inlineTextBox; | 56 const InlineTextBox& m_inlineTextBox; |
55 }; | 57 }; |
56 | 58 |
57 } // namespace blink | 59 } // namespace blink |
58 | 60 |
59 #endif // InlineTextBoxPainter_h | 61 #endif // InlineTextBoxPainter_h |
OLD | NEW |