Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
skia::textlayout::ParagraphPainter::DecorationStyle Class Reference

#include <ParagraphPainter.h>

Public Member Functions

 DecorationStyle ()
 
 DecorationStyle (SkColor color, SkScalar strokeWidth, std::optional< DashPathEffect > dashPathEffect)
 
SkColor getColor () const
 
SkScalar getStrokeWidth () const
 
std::optional< DashPathEffectgetDashPathEffect () const
 
const SkPaintskPaint () const
 

Detailed Description

Definition at line 26 of file ParagraphPainter.h.

Constructor & Destructor Documentation

◆ DecorationStyle() [1/2]

skia::textlayout::ParagraphPainter::DecorationStyle::DecorationStyle ( )

Definition at line 17 of file ParagraphPainterImpl.cpp.

18 : ParagraphPainter::DecorationStyle(SK_ColorTRANSPARENT, 0, std::nullopt) {}
constexpr SkColor SK_ColorTRANSPARENT
Definition SkColor.h:99

◆ DecorationStyle() [2/2]

skia::textlayout::ParagraphPainter::DecorationStyle::DecorationStyle ( SkColor  color,
SkScalar  strokeWidth,
std::optional< DashPathEffect dashPathEffect 
)

Definition at line 20 of file ParagraphPainterImpl.cpp.

23 : fColor(color), fStrokeWidth(strokeWidth), fDashPathEffect(dashPathEffect) {
25 fPaint.setAntiAlias(true);
26 fPaint.setColor(fColor);
27 fPaint.setStrokeWidth(fStrokeWidth);
28
29 if (fDashPathEffect) {
30 const std::array<SkScalar, 4> intervals =
31 {fDashPathEffect->fOnLength, fDashPathEffect->fOffLength,
32 fDashPathEffect->fOnLength, fDashPathEffect->fOffLength};
34 SkDashPathEffect::Make(intervals.data(), intervals.size(), 0.0f),
36 }
37}
static const int strokeWidth
Definition BlurTest.cpp:60
SkColor4f color
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static sk_sp< SkPathEffect > Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist=0)
void setStyle(Style style)
Definition SkPaint.cpp:105
void setColor(SkColor color)
Definition SkPaint.cpp:119
void setAntiAlias(bool aa)
Definition SkPaint.h:170
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
void setStrokeWidth(SkScalar width)
Definition SkPaint.cpp:159
static sk_sp< SkPathEffect > MakeCompose(sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)

Member Function Documentation

◆ getColor()

SkColor skia::textlayout::ParagraphPainter::DecorationStyle::getColor ( ) const
inline

Definition at line 32 of file ParagraphPainter.h.

32{ return fColor; }

◆ getDashPathEffect()

std::optional< DashPathEffect > skia::textlayout::ParagraphPainter::DecorationStyle::getDashPathEffect ( ) const
inline

Definition at line 34 of file ParagraphPainter.h.

34{ return fDashPathEffect; }

◆ getStrokeWidth()

SkScalar skia::textlayout::ParagraphPainter::DecorationStyle::getStrokeWidth ( ) const
inline

Definition at line 33 of file ParagraphPainter.h.

33{ return fStrokeWidth; }

◆ skPaint()

const SkPaint & skia::textlayout::ParagraphPainter::DecorationStyle::skPaint ( ) const
inline

Definition at line 35 of file ParagraphPainter.h.

35{ return fPaint; }

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