| 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" |
| 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; | 17 class CompositionUnderline; |
| 18 class ComputedStyle; | 18 class ComputedStyle; |
| 19 class DocumentMarker; | 19 class DocumentMarker; |
| 20 class FloatPoint; | 20 class FloatPoint; |
| 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 LayoutObject; | 25 class LayoutObject; |
| 26 class LayoutPoint; | 26 class LayoutPoint; |
| 27 class LayoutTextCombine; | 27 class LayoutTextCombine; |
| 28 class TextPainter; |
| 28 | 29 |
| 29 enum class DocumentMarkerPaintPhase { Foreground, Background }; | 30 enum class DocumentMarkerPaintPhase { Foreground, Background }; |
| 30 | 31 |
| 31 class InlineTextBoxPainter { | 32 class InlineTextBoxPainter { |
| 32 STACK_ALLOCATED(); | 33 STACK_ALLOCATED(); |
| 33 | 34 |
| 34 public: | 35 public: |
| 35 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) | 36 InlineTextBoxPainter(const InlineTextBox& inlineTextBox) |
| 36 : m_inlineTextBox(inlineTextBox) {} | 37 : m_inlineTextBox(inlineTextBox) {} |
| 37 | 38 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 Color backgroundColor, | 77 Color backgroundColor, |
| 77 int startPos, | 78 int startPos, |
| 78 int endPos); | 79 int endPos); |
| 79 template <PaintOptions> | 80 template <PaintOptions> |
| 80 void paintSelection(GraphicsContext&, | 81 void paintSelection(GraphicsContext&, |
| 81 const LayoutRect& boxRect, | 82 const LayoutRect& boxRect, |
| 82 const ComputedStyle&, | 83 const ComputedStyle&, |
| 83 const Font&, | 84 const Font&, |
| 84 Color textColor, | 85 Color textColor, |
| 85 LayoutTextCombine* = nullptr); | 86 LayoutTextCombine* = nullptr); |
| 86 void paintDecoration(const PaintInfo&, | 87 void paintDecoration(TextPainter&, |
| 88 const PaintInfo&, |
| 87 const LayoutPoint& boxOrigin, | 89 const LayoutPoint& boxOrigin, |
| 88 TextDecoration); | 90 TextDecoration); |
| 89 void paintCompositionUnderline(GraphicsContext&, | 91 void paintCompositionUnderline(GraphicsContext&, |
| 90 const LayoutPoint& boxOrigin, | 92 const LayoutPoint& boxOrigin, |
| 91 const CompositionUnderline&); | 93 const CompositionUnderline&); |
| 92 unsigned underlinePaintStart(const CompositionUnderline&); | 94 unsigned underlinePaintStart(const CompositionUnderline&); |
| 93 unsigned underlinePaintEnd(const CompositionUnderline&); | 95 unsigned underlinePaintEnd(const CompositionUnderline&); |
| 94 bool shouldPaintTextBox(const PaintInfo&); | 96 bool shouldPaintTextBox(const PaintInfo&); |
| 95 void expandToIncludeNewlineForSelection(LayoutRect&); | 97 void expandToIncludeNewlineForSelection(LayoutRect&); |
| 96 LayoutObject& inlineLayoutObject() const; | 98 LayoutObject& inlineLayoutObject() const; |
| 97 | 99 |
| 98 const InlineTextBox& m_inlineTextBox; | 100 const InlineTextBox& m_inlineTextBox; |
| 99 }; | 101 }; |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| 102 | 104 |
| 103 #endif // InlineTextBoxPainter_h | 105 #endif // InlineTextBoxPainter_h |
| OLD | NEW |