| 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 | 10 |
| 10 namespace blink { | 11 namespace blink { |
| 11 | 12 |
| 12 struct CompositionUnderline; | 13 struct CompositionUnderline; |
| 13 struct PaintInfo; | 14 struct PaintInfo; |
| 14 | 15 |
| 15 class Color; | 16 class Color; |
| 16 class ComputedStyle; | 17 class ComputedStyle; |
| 17 class DocumentMarker; | 18 class DocumentMarker; |
| 18 class FloatPoint; | 19 class FloatPoint; |
| 19 class FloatRect; | 20 class FloatRect; |
| 20 class Font; | 21 class Font; |
| 21 class GraphicsContext; | 22 class GraphicsContext; |
| 22 class InlineTextBox; | 23 class InlineTextBox; |
| 23 class LayoutPoint; | 24 class LayoutPoint; |
| 24 class LayoutTextCombine; | 25 class LayoutTextCombine; |
| 25 | 26 |
| 26 class InlineTextBoxPainter { | 27 class InlineTextBoxPainter { |
| 27 public: | 28 public: |
| 28 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT
extBox) { } | 29 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT
extBox) { } |
| 29 | 30 |
| 30 void paint(const PaintInfo&, const LayoutPoint&); | 31 void paint(const PaintInfo&, const LayoutPoint&); |
| 31 void paintDocumentMarkers(GraphicsContext*, const FloatPoint& boxOrigin, con
st ComputedStyle&, const Font&, bool background); | 32 void paintDocumentMarkers(GraphicsContext*, const LayoutPoint& boxOrigin, co
nst ComputedStyle&, const Font&, bool background); |
| 32 void paintDocumentMarker(GraphicsContext*, const FloatPoint& boxOrigin, Docu
mentMarker*, const ComputedStyle&, const Font&, bool grammar); | 33 void paintDocumentMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Doc
umentMarker*, const ComputedStyle&, const Font&, bool grammar); |
| 33 void paintTextMatchMarker(GraphicsContext*, const FloatPoint& boxOrigin, Doc
umentMarker*, const ComputedStyle&, const Font&); | 34 void paintTextMatchMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Do
cumentMarker*, const ComputedStyle&, const Font&); |
| 34 | 35 |
| 35 static void removeFromTextBlobCache(InlineTextBox&); | 36 static void removeFromTextBlobCache(InlineTextBox&); |
| 36 | 37 |
| 37 private: | 38 private: |
| 38 enum class PaintOptions { Normal, CombinedText }; | 39 enum class PaintOptions { Normal, CombinedText }; |
| 39 | 40 |
| 40 void paintCompositionBackgrounds(GraphicsContext*, const FloatPoint& boxOrig
in, const ComputedStyle&, const Font&, bool useCustomUnderlines); | 41 void paintCompositionBackgrounds(GraphicsContext*, const LayoutPoint& boxOri
gin, const ComputedStyle&, const Font&, bool useCustomUnderlines); |
| 41 void paintSingleCompositionBackgroundRun(GraphicsContext*, const FloatPoint&
boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int startP
os, int endPos); | 42 void paintSingleCompositionBackgroundRun(GraphicsContext*, const LayoutPoint
& boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int start
Pos, int endPos); |
| 42 template <PaintOptions> | 43 template <PaintOptions> |
| 43 void paintSelection(GraphicsContext*, const FloatRect& boxRect, const Comput
edStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); | 44 void paintSelection(GraphicsContext*, const LayoutRect& boxRect, const Compu
tedStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); |
| 44 void paintDecoration(GraphicsContext*, const FloatPoint& boxOrigin, TextDeco
ration); | 45 void paintDecoration(GraphicsContext*, const LayoutPoint& boxOrigin, TextDec
oration); |
| 45 void paintCompositionUnderline(GraphicsContext*, const FloatPoint& boxOrigin
, const CompositionUnderline&); | 46 void paintCompositionUnderline(GraphicsContext*, const LayoutPoint& boxOrigi
n, const CompositionUnderline&); |
| 46 unsigned underlinePaintStart(const CompositionUnderline&); | 47 unsigned underlinePaintStart(const CompositionUnderline&); |
| 47 unsigned underlinePaintEnd(const CompositionUnderline&); | 48 unsigned underlinePaintEnd(const CompositionUnderline&); |
| 48 | 49 |
| 49 InlineTextBox& m_inlineTextBox; | 50 InlineTextBox& m_inlineTextBox; |
| 50 }; | 51 }; |
| 51 | 52 |
| 52 } // namespace blink | 53 } // namespace blink |
| 53 | 54 |
| 54 #endif // InlineTextBoxPainter_h | 55 #endif // InlineTextBoxPainter_h |
| OLD | NEW |