Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skia::textlayout::CanvasParagraphPainter Class Reference

#include <ParagraphPainterImpl.h>

Inheritance diagram for skia::textlayout::CanvasParagraphPainter:
skia::textlayout::ParagraphPainter

Public Member Functions

 CanvasParagraphPainter (SkCanvas *canvas)
 
void drawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const SkPaintOrID &paint) override
 
void drawTextShadow (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, SkColor color, SkScalar blurSigma) override
 
void drawRect (const SkRect &rect, const SkPaintOrID &paint) override
 
void drawFilledRect (const SkRect &rect, const DecorationStyle &decorStyle) override
 
void drawPath (const SkPath &path, const DecorationStyle &decorStyle) override
 
void drawLine (SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const DecorationStyle &decorStyle) override
 
void clipRect (const SkRect &rect) override
 
void translate (SkScalar dx, SkScalar dy) override
 
void save () override
 
void restore () override
 
- Public Member Functions inherited from skia::textlayout::ParagraphPainter
virtual ~ParagraphPainter ()=default
 
virtual void drawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const SkPaintOrID &paint)=0
 
virtual void drawTextShadow (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, SkColor color, SkScalar blurSigma)=0
 
virtual void drawRect (const SkRect &rect, const SkPaintOrID &paint)=0
 
virtual void drawFilledRect (const SkRect &rect, const DecorationStyle &decorStyle)=0
 
virtual void drawPath (const SkPath &path, const DecorationStyle &decorStyle)=0
 
virtual void drawLine (SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const DecorationStyle &decorStyle)=0
 
virtual void clipRect (const SkRect &rect)=0
 
virtual void translate (SkScalar dx, SkScalar dy)=0
 
virtual void save ()=0
 
virtual void restore ()=0
 

Additional Inherited Members

- Public Types inherited from skia::textlayout::ParagraphPainter
typedef int PaintID
 
typedef std::variant< SkPaint, PaintIDSkPaintOrID
 

Detailed Description

Definition at line 11 of file ParagraphPainterImpl.h.

Constructor & Destructor Documentation

◆ CanvasParagraphPainter()

skia::textlayout::CanvasParagraphPainter::CanvasParagraphPainter ( SkCanvas canvas)

Definition at line 39 of file ParagraphPainterImpl.cpp.

40 : fCanvas(canvas) {}

Member Function Documentation

◆ clipRect()

void skia::textlayout::CanvasParagraphPainter::clipRect ( const SkRect rect)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 77 of file ParagraphPainterImpl.cpp.

77 {
78 fCanvas->clipRect(rect);
79}
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ drawFilledRect()

void skia::textlayout::CanvasParagraphPainter::drawFilledRect ( const SkRect rect,
const DecorationStyle decorStyle 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 63 of file ParagraphPainterImpl.cpp.

63 {
64 SkPaint p(decorStyle.skPaint());
65 p.setStroke(false);
66 fCanvas->drawRect(rect, p);
67}
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673

◆ drawLine()

void skia::textlayout::CanvasParagraphPainter::drawLine ( SkScalar  x0,
SkScalar  y0,
SkScalar  x1,
SkScalar  y1,
const DecorationStyle decorStyle 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 73 of file ParagraphPainterImpl.cpp.

73 {
74 fCanvas->drawLine(x0, y0, x1, y1, decorStyle.skPaint());
75}
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700

◆ drawPath()

void skia::textlayout::CanvasParagraphPainter::drawPath ( const SkPath path,
const DecorationStyle decorStyle 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 69 of file ParagraphPainterImpl.cpp.

69 {
70 fCanvas->drawPath(path, decorStyle.skPaint());
71}
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ drawRect()

void skia::textlayout::CanvasParagraphPainter::drawRect ( const SkRect rect,
const SkPaintOrID paint 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 58 of file ParagraphPainterImpl.cpp.

58 {
59 SkASSERT(std::holds_alternative<SkPaint>(paint));
60 fCanvas->drawRect(rect, std::get<SkPaint>(paint));
61}
#define SkASSERT(cond)
Definition: SkAssert.h:116
const Paint & paint
Definition: color_source.cc:38

◆ drawTextBlob()

void skia::textlayout::CanvasParagraphPainter::drawTextBlob ( const sk_sp< SkTextBlob > &  blob,
SkScalar  x,
SkScalar  y,
const SkPaintOrID paint 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 42 of file ParagraphPainterImpl.cpp.

42 {
43 SkASSERT(std::holds_alternative<SkPaint>(paint));
44 fCanvas->drawTextBlob(blob, x, y, std::get<SkPaint>(paint));
45}
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2484
double y
double x

◆ drawTextShadow()

void skia::textlayout::CanvasParagraphPainter::drawTextShadow ( const sk_sp< SkTextBlob > &  blob,
SkScalar  x,
SkScalar  y,
SkColor  color,
SkScalar  blurSigma 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 47 of file ParagraphPainterImpl.cpp.

47 {
49 paint.setColor(color);
50 if (blurSigma != 0.0) {
52 kNormal_SkBlurStyle, blurSigma, false);
53 paint.setMaskFilter(filter);
54 }
55 fCanvas->drawTextBlob(blob, x, y, paint);
56}
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
DlColor color

◆ restore()

void skia::textlayout::CanvasParagraphPainter::restore ( )
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 89 of file ParagraphPainterImpl.cpp.

89 {
90 fCanvas->restore();
91}
void restore()
Definition: SkCanvas.cpp:461

◆ save()

void skia::textlayout::CanvasParagraphPainter::save ( )
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 85 of file ParagraphPainterImpl.cpp.

85 {
86 fCanvas->save();
87}
int save()
Definition: SkCanvas.cpp:447

◆ translate()

void skia::textlayout::CanvasParagraphPainter::translate ( SkScalar  dx,
SkScalar  dy 
)
overridevirtual

Implements skia::textlayout::ParagraphPainter.

Definition at line 81 of file ParagraphPainterImpl.cpp.

81 {
82 fCanvas->translate(dx, dy);
83}
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208

The documentation for this class was generated from the following files: