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/layout/style/LayoutStyleConstants.h" | 8 #include "core/layout/style/LayoutStyleConstants.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 struct CompositionUnderline; | 12 struct CompositionUnderline; |
13 struct PaintInfo; | 13 struct PaintInfo; |
14 | 14 |
15 class Color; | 15 class Color; |
16 class DocumentMarker; | 16 class DocumentMarker; |
17 class FloatPoint; | 17 class FloatPoint; |
18 class FloatRect; | 18 class FloatRect; |
19 class Font; | 19 class Font; |
20 class GraphicsContext; | 20 class GraphicsContext; |
21 class InlineTextBox; | 21 class InlineTextBox; |
22 class LayoutPoint; | 22 class LayoutPoint; |
23 class LayoutStyle; | 23 class LayoutStyle; |
24 class RenderCombineText; | 24 class LayoutTextCombine; |
25 | 25 |
26 class InlineTextBoxPainter { | 26 class InlineTextBoxPainter { |
27 public: | 27 public: |
28 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT
extBox) { } | 28 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT
extBox) { } |
29 | 29 |
30 void paint(const PaintInfo&, const LayoutPoint&); | 30 void paint(const PaintInfo&, const LayoutPoint&); |
31 void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, con
st LayoutStyle&, const Font&, bool background); | 31 void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, con
st LayoutStyle&, const Font&, bool background); |
32 void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, Docu
mentMarker*, const LayoutStyle&, const Font&, bool grammar); | 32 void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, Docu
mentMarker*, const LayoutStyle&, const Font&, bool grammar); |
33 void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, Doc
umentMarker*, const LayoutStyle&, const Font&); | 33 void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, Doc
umentMarker*, const LayoutStyle&, const Font&); |
34 | 34 |
35 static void removeFromTextBlobCache(InlineTextBox&); | 35 static void removeFromTextBlobCache(InlineTextBox&); |
36 | 36 |
37 private: | 37 private: |
38 enum class PaintOptions { Normal, CombinedText }; | 38 enum class PaintOptions { Normal, CombinedText }; |
39 | 39 |
40 void paintCompositionBackgrounds(GraphicsContext*, const FloatPoint& boxOrig
in, const LayoutStyle&, const Font&, bool useCustomUnderlines); | 40 void paintCompositionBackgrounds(GraphicsContext*, const FloatPoint& boxOrig
in, const LayoutStyle&, const Font&, bool useCustomUnderlines); |
41 void paintSingleCompositionBackgroundRun(GraphicsContext*, const FloatPoint&
boxOrigin, const LayoutStyle&, const Font&, Color backgroundColor, int startPos
, int endPos); | 41 void paintSingleCompositionBackgroundRun(GraphicsContext*, const FloatPoint&
boxOrigin, const LayoutStyle&, const Font&, Color backgroundColor, int startPos
, int endPos); |
42 template <PaintOptions> | 42 template <PaintOptions> |
43 void paintSelection(GraphicsContext*, const FloatRect& boxRect, const Layout
Style&, const Font&, Color textColor, RenderCombineText* = nullptr); | 43 void paintSelection(GraphicsContext*, const FloatRect& boxRect, const Layout
Style&, const Font&, Color textColor, LayoutTextCombine* = nullptr); |
44 void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, TextDeco
ration); | 44 void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, TextDeco
ration); |
45 void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin
, const CompositionUnderline&); | 45 void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin
, const CompositionUnderline&); |
46 unsigned underlinePaintStart(const CompositionUnderline&); | 46 unsigned underlinePaintStart(const CompositionUnderline&); |
47 unsigned underlinePaintEnd(const CompositionUnderline&); | 47 unsigned underlinePaintEnd(const CompositionUnderline&); |
48 | 48 |
49 InlineTextBox& m_inlineTextBox; | 49 InlineTextBox& m_inlineTextBox; |
50 }; | 50 }; |
51 | 51 |
52 } // namespace blink | 52 } // namespace blink |
53 | 53 |
54 #endif // InlineTextBoxPainter_h | 54 #endif // InlineTextBoxPainter_h |
OLD | NEW |