| 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 SVGInlineTextBoxPainter_h | 5 #ifndef SVGInlineTextBoxPainter_h |
| 6 #define SVGInlineTextBoxPainter_h | 6 #define SVGInlineTextBoxPainter_h |
| 7 | 7 |
| 8 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" | 8 #include "core/layout/svg/LayoutSVGResourcePaintServer.h" |
| 9 #include "core/style/ComputedStyleConstants.h" | 9 #include "core/style/ComputedStyleConstants.h" |
| 10 #include "platform/wtf/Allocator.h" | 10 #include "platform/wtf/Allocator.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class DocumentMarker; |
| 14 class Font; | 15 class Font; |
| 15 struct PaintInfo; | 16 struct PaintInfo; |
| 16 class LayoutPoint; | 17 class LayoutPoint; |
| 17 class LayoutSVGInlineText; | 18 class LayoutSVGInlineText; |
| 18 class ComputedStyle; | 19 class ComputedStyle; |
| 19 class SVGInlineTextBox; | 20 class SVGInlineTextBox; |
| 20 struct SVGTextFragment; | 21 struct SVGTextFragment; |
| 22 class TextMatchMarker; |
| 21 class TextRun; | 23 class TextRun; |
| 22 class DocumentMarker; | |
| 23 | 24 |
| 24 struct SVGTextFragmentWithRange { | 25 struct SVGTextFragmentWithRange { |
| 25 SVGTextFragmentWithRange(const SVGTextFragment& fragment, | 26 SVGTextFragmentWithRange(const SVGTextFragment& fragment, |
| 26 int start_position, | 27 int start_position, |
| 27 int end_position) | 28 int end_position) |
| 28 : fragment(fragment), | 29 : fragment(fragment), |
| 29 start_position(start_position), | 30 start_position(start_position), |
| 30 end_position(end_position) {} | 31 end_position(end_position) {} |
| 31 const SVGTextFragment& fragment; | 32 const SVGTextFragment& fragment; |
| 32 int start_position; | 33 int start_position; |
| 33 int end_position; | 34 int end_position; |
| 34 }; | 35 }; |
| 35 | 36 |
| 36 class SVGInlineTextBoxPainter { | 37 class SVGInlineTextBoxPainter { |
| 37 STACK_ALLOCATED(); | 38 STACK_ALLOCATED(); |
| 38 | 39 |
| 39 public: | 40 public: |
| 40 SVGInlineTextBoxPainter(const SVGInlineTextBox& svg_inline_text_box) | 41 SVGInlineTextBoxPainter(const SVGInlineTextBox& svg_inline_text_box) |
| 41 : svg_inline_text_box_(svg_inline_text_box) {} | 42 : svg_inline_text_box_(svg_inline_text_box) {} |
| 42 void Paint(const PaintInfo&, const LayoutPoint&); | 43 void Paint(const PaintInfo&, const LayoutPoint&); |
| 43 void PaintSelectionBackground(const PaintInfo&); | 44 void PaintSelectionBackground(const PaintInfo&); |
| 44 void PaintTextMatchMarkerForeground(const PaintInfo&, | 45 void PaintTextMatchMarkerForeground(const PaintInfo&, |
| 45 const LayoutPoint&, | 46 const LayoutPoint&, |
| 46 const DocumentMarker&, | 47 const TextMatchMarker&, |
| 47 const ComputedStyle&, | 48 const ComputedStyle&, |
| 48 const Font&); | 49 const Font&); |
| 49 void PaintTextMatchMarkerBackground(const PaintInfo&, | 50 void PaintTextMatchMarkerBackground(const PaintInfo&, |
| 50 const LayoutPoint&, | 51 const LayoutPoint&, |
| 51 const DocumentMarker&, | 52 const TextMatchMarker&, |
| 52 const ComputedStyle&, | 53 const ComputedStyle&, |
| 53 const Font&); | 54 const Font&); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 bool ShouldPaintSelection(const PaintInfo&) const; | 57 bool ShouldPaintSelection(const PaintInfo&) const; |
| 57 FloatRect BoundsForDrawingRecorder(const PaintInfo&, | 58 FloatRect BoundsForDrawingRecorder(const PaintInfo&, |
| 58 const ComputedStyle&, | 59 const ComputedStyle&, |
| 59 const LayoutPoint&, | 60 const LayoutPoint&, |
| 60 bool include_selection_rect) const; | 61 bool include_selection_rect) const; |
| 61 void PaintTextFragments(const PaintInfo&, LayoutObject&); | 62 void PaintTextFragments(const PaintInfo&, LayoutObject&); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 86 LayoutObject& InlineLayoutObject() const; | 87 LayoutObject& InlineLayoutObject() const; |
| 87 LayoutObject& ParentInlineLayoutObject() const; | 88 LayoutObject& ParentInlineLayoutObject() const; |
| 88 LayoutSVGInlineText& InlineText() const; | 89 LayoutSVGInlineText& InlineText() const; |
| 89 | 90 |
| 90 const SVGInlineTextBox& svg_inline_text_box_; | 91 const SVGInlineTextBox& svg_inline_text_box_; |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace blink | 94 } // namespace blink |
| 94 | 95 |
| 95 #endif // SVGInlineTextBoxPainter_h | 96 #endif // SVGInlineTextBoxPainter_h |
| OLD | NEW |