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