Chromium Code Reviews| 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/paint/TextPainter.h" | |
|
pdr.
2015/07/21 05:59:46
I think you can just forward declare this ("class
| |
| 8 #include "core/style/ComputedStyleConstants.h" | 9 #include "core/style/ComputedStyleConstants.h" |
| 9 #include "platform/geometry/LayoutRect.h" | 10 #include "platform/geometry/LayoutRect.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 struct CompositionUnderline; | 14 struct CompositionUnderline; |
| 14 struct PaintInfo; | 15 struct PaintInfo; |
| 15 | 16 |
| 16 class Color; | 17 class Color; |
| 17 class ComputedStyle; | 18 class ComputedStyle; |
| 18 class DocumentMarker; | 19 class DocumentMarker; |
| 19 class FloatPoint; | 20 class FloatPoint; |
| 20 class FloatRect; | 21 class FloatRect; |
| 21 class Font; | 22 class Font; |
| 22 class GraphicsContext; | 23 class GraphicsContext; |
| 23 class InlineTextBox; | 24 class InlineTextBox; |
| 24 class LayoutPoint; | 25 class LayoutPoint; |
| 25 class LayoutTextCombine; | 26 class LayoutTextCombine; |
| 26 | 27 |
| 27 class InlineTextBoxPainter { | 28 class InlineTextBoxPainter { |
| 28 public: | 29 public: |
| 29 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT extBox) { } | 30 InlineTextBoxPainter(InlineTextBox& inlineTextBox) : m_inlineTextBox(inlineT extBox) { } |
| 30 | 31 |
| 31 void paint(const PaintInfo&, const LayoutPoint&); | 32 void paint(const PaintInfo&, const LayoutPoint&); |
| 33 void paintTextMatchMarkerText(TextPainter, int, const ComputedStyle&); | |
|
pdr.
2015/07/21 05:59:46
TextPainter is a large class so we shouldn't pass
| |
| 32 void paintDocumentMarkers(GraphicsContext*, const LayoutPoint& boxOrigin, co nst ComputedStyle&, const Font&, bool background); | 34 void paintDocumentMarkers(GraphicsContext*, const LayoutPoint& boxOrigin, co nst ComputedStyle&, const Font&, bool background); |
| 33 void paintDocumentMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Doc umentMarker*, const ComputedStyle&, const Font&, bool grammar); | 35 void paintDocumentMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Doc umentMarker*, const ComputedStyle&, const Font&, bool grammar); |
| 34 void paintTextMatchMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Do cumentMarker*, const ComputedStyle&, const Font&); | 36 void paintTextMatchMarker(GraphicsContext*, const LayoutPoint& boxOrigin, Do cumentMarker*, const ComputedStyle&, const Font&); |
| 35 | 37 |
| 36 static void removeFromTextBlobCache(InlineTextBox&); | 38 static void removeFromTextBlobCache(InlineTextBox&); |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 enum class PaintOptions { Normal, CombinedText }; | 41 enum class PaintOptions { Normal, CombinedText }; |
| 40 | 42 |
| 41 void paintCompositionBackgrounds(GraphicsContext*, const LayoutPoint& boxOri gin, const ComputedStyle&, const Font&, bool useCustomUnderlines); | 43 void paintCompositionBackgrounds(GraphicsContext*, const LayoutPoint& boxOri gin, const ComputedStyle&, const Font&, bool useCustomUnderlines); |
| 42 void paintSingleCompositionBackgroundRun(GraphicsContext*, const LayoutPoint & boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int start Pos, int endPos); | 44 void paintSingleCompositionBackgroundRun(GraphicsContext*, const LayoutPoint & boxOrigin, const ComputedStyle&, const Font&, Color backgroundColor, int start Pos, int endPos); |
| 43 template <PaintOptions> | 45 template <PaintOptions> |
| 44 void paintSelection(GraphicsContext*, const LayoutRect& boxRect, const Compu tedStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); | 46 void paintSelection(GraphicsContext*, const LayoutRect& boxRect, const Compu tedStyle&, const Font&, Color textColor, LayoutTextCombine* = nullptr); |
| 45 void paintDecoration(GraphicsContext*, const LayoutPoint& boxOrigin, TextDec oration); | 47 void paintDecoration(GraphicsContext*, const LayoutPoint& boxOrigin, TextDec oration); |
| 46 void paintCompositionUnderline(GraphicsContext*, const LayoutPoint& boxOrigi n, const CompositionUnderline&); | 48 void paintCompositionUnderline(GraphicsContext*, const LayoutPoint& boxOrigi n, const CompositionUnderline&); |
| 47 unsigned underlinePaintStart(const CompositionUnderline&); | 49 unsigned underlinePaintStart(const CompositionUnderline&); |
| 48 unsigned underlinePaintEnd(const CompositionUnderline&); | 50 unsigned underlinePaintEnd(const CompositionUnderline&); |
| 49 | 51 |
| 50 InlineTextBox& m_inlineTextBox; | 52 InlineTextBox& m_inlineTextBox; |
| 51 }; | 53 }; |
| 52 | 54 |
| 53 } // namespace blink | 55 } // namespace blink |
| 54 | 56 |
| 55 #endif // InlineTextBoxPainter_h | 57 #endif // InlineTextBoxPainter_h |
| OLD | NEW |