diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h b/chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h index 42e8bc6ad2a..26b4bb67899 100644 --- a/chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h +++ b/chromium/third_party/blink/renderer/core/paint/ng/ng_text_painter.h @@ -12,6 +12,7 @@ namespace blink { +class LayoutSVGInlineText; class NGFragmentItem; struct NGTextFragmentPaintInfo; @@ -24,6 +25,29 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase { STACK_ALLOCATED(); public: + class SvgTextPaintState final { + public: + SvgTextPaintState(const LayoutSVGInlineText&, + const ComputedStyle&, + bool is_rendering_clip_path_as_mask_image); + + const LayoutSVGInlineText& InlineText() const; + const ComputedStyle& Style() const; + bool IsPaintingSelection() const; + bool IsRenderingClipPathAsMaskImage() const; + + AffineTransform& EnsureShaderTransform(); + const AffineTransform* GetShaderTransform() const; + + private: + const LayoutSVGInlineText& layout_svg_inline_text_; + const ComputedStyle& style_; + absl::optional<AffineTransform> shader_transform_; + bool is_painting_selection_ = false; + bool is_rendering_clip_path_as_mask_image_ = false; + friend class NGTextPainter; + }; + NGTextPainter(GraphicsContext& context, const Font& font, const NGTextFragmentPaintInfo& fragment_paint_info, @@ -58,7 +82,6 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase { const PhysicalRect& selection_rect, DOMNodeId node_id); - // Based on legacy TextPainter. void PaintDecorationsExceptLineThrough( const NGFragmentItem& text_item, const PaintInfo& paint_info, @@ -68,7 +91,6 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase { const absl::optional<AppliedTextDecoration>& selection_decoration, bool* has_line_through_decoration); - // Based on legacy TextPainter. void PaintDecorationsOnlyLineThrough( const NGFragmentItem& text_item, const PaintInfo& paint_info, @@ -77,6 +99,11 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase { const PhysicalRect& decoration_rect, const absl::optional<AppliedTextDecoration>& selection_decoration); + SvgTextPaintState& SetSvgState(const LayoutSVGInlineText&, + const ComputedStyle&, + bool is_rendering_clip_path_as_mask_image); + SvgTextPaintState* GetSvgState(); + private: template <PaintInternalStep step> void PaintInternalFragment(unsigned from, unsigned to, DOMNodeId node_id); @@ -87,10 +114,11 @@ class CORE_EXPORT NGTextPainter : public TextPainterBase { unsigned truncation_point, DOMNodeId node_id); - void PaintEmphasisMarkForCombinedText(); + void PaintSvgTextFragment(DOMNodeId node_id); NGTextFragmentPaintInfo fragment_paint_info_; const IntRect& visual_rect_; + absl::optional<SvgTextPaintState> svg_text_paint_state_; }; } // namespace blink |