| 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 "platform/wtf/Allocator.h" | 10 #include "platform/wtf/Allocator.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 struct PaintInfo; | 14 struct PaintInfo; |
| 15 | 15 |
| 16 class AppliedTextDecoration; | |
| 17 class Color; | 16 class Color; |
| 18 class CompositionUnderline; | 17 class CompositionUnderline; |
| 19 class ComputedStyle; | 18 class ComputedStyle; |
| 20 class DocumentMarker; | 19 class DocumentMarker; |
| 21 class Font; | 20 class Font; |
| 22 class GraphicsContext; | 21 class GraphicsContext; |
| 23 class InlineTextBox; | 22 class InlineTextBox; |
| 24 class LayoutObject; | 23 class LayoutObject; |
| 25 class LayoutPoint; | 24 class LayoutPoint; |
| 26 class LayoutTextCombine; | 25 class LayoutTextCombine; |
| 27 class TextPainter; | |
| 28 | 26 |
| 29 enum class DocumentMarkerPaintPhase { kForeground, kBackground }; | 27 enum class DocumentMarkerPaintPhase { kForeground, kBackground }; |
| 30 | 28 |
| 31 class InlineTextBoxPainter { | 29 class InlineTextBoxPainter { |
| 32 STACK_ALLOCATED(); | 30 STACK_ALLOCATED(); |
| 33 | 31 |
| 34 public: | 32 public: |
| 35 InlineTextBoxPainter(const InlineTextBox& inline_text_box) | 33 InlineTextBoxPainter(const InlineTextBox& inline_text_box) |
| 36 : inline_text_box_(inline_text_box) {} | 34 : inline_text_box_(inline_text_box) {} |
| 37 | 35 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 Color background_color, | 73 Color background_color, |
| 76 int start_pos, | 74 int start_pos, |
| 77 int end_pos); | 75 int end_pos); |
| 78 template <PaintOptions> | 76 template <PaintOptions> |
| 79 void PaintSelection(GraphicsContext&, | 77 void PaintSelection(GraphicsContext&, |
| 80 const LayoutRect& box_rect, | 78 const LayoutRect& box_rect, |
| 81 const ComputedStyle&, | 79 const ComputedStyle&, |
| 82 const Font&, | 80 const Font&, |
| 83 Color text_color, | 81 Color text_color, |
| 84 LayoutTextCombine* = nullptr); | 82 LayoutTextCombine* = nullptr); |
| 85 void PaintDecorations(TextPainter&, | 83 |
| 86 const PaintInfo&, | |
| 87 const LayoutPoint& box_origin, | |
| 88 const Vector<AppliedTextDecoration>&); | |
| 89 void PaintCompositionUnderline(GraphicsContext&, | 84 void PaintCompositionUnderline(GraphicsContext&, |
| 90 const LayoutPoint& box_origin, | 85 const LayoutPoint& box_origin, |
| 91 const CompositionUnderline&); | 86 const CompositionUnderline&); |
| 92 unsigned UnderlinePaintStart(const CompositionUnderline&); | 87 unsigned UnderlinePaintStart(const CompositionUnderline&); |
| 93 unsigned UnderlinePaintEnd(const CompositionUnderline&); | 88 unsigned UnderlinePaintEnd(const CompositionUnderline&); |
| 94 bool ShouldPaintTextBox(const PaintInfo&); | 89 bool ShouldPaintTextBox(const PaintInfo&); |
| 95 void ExpandToIncludeNewlineForSelection(LayoutRect&); | 90 void ExpandToIncludeNewlineForSelection(LayoutRect&); |
| 96 LayoutObject& InlineLayoutObject() const; | 91 LayoutObject& InlineLayoutObject() const; |
| 97 | 92 |
| 98 const InlineTextBox& inline_text_box_; | 93 const InlineTextBox& inline_text_box_; |
| 99 }; | 94 }; |
| 100 | 95 |
| 101 } // namespace blink | 96 } // namespace blink |
| 102 | 97 |
| 103 #endif // InlineTextBoxPainter_h | 98 #endif // InlineTextBoxPainter_h |
| OLD | NEW |