Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
PathTextSlide::Glyph Struct Reference

Public Member Functions

void init (SkRandom &rand, const SkPath &path)
 
void reset (SkRandom &rand, int w, int h)
 

Public Attributes

SkPath fPath
 
SkPaint fPaint
 
SkPoint fPosition
 
SkScalar fZoom
 
SkScalar fSpin
 
SkPoint fMidpt
 

Detailed Description

Definition at line 88 of file PathTextSlide.cpp.

Member Function Documentation

◆ init()

void PathTextSlide::Glyph::init ( SkRandom rand,
const SkPath path 
)

Definition at line 132 of file PathTextSlide.cpp.

132 {
133 fPath = path;
134 fPaint.setAntiAlias(true);
135 fPaint.setColor(rand.nextU() | 0x80808080);
136}
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
uint32_t nextU()
Definition: SkRandom.h:42
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

◆ reset()

void PathTextSlide::Glyph::reset ( SkRandom rand,
int  w,
int  h 
)

Definition at line 138 of file PathTextSlide.cpp.

138 {
139 int screensize = std::max(w, h);
140 const SkRect& bounds = fPath.getBounds();
141 SkScalar t;
142
143 fPosition = {rand.nextF() * w, rand.nextF() * h};
144 t = pow(rand.nextF(), 100);
145 fZoom = ((1 - t) * screensize / 50 + t * screensize / 3) /
146 std::max(bounds.width(), bounds.height());
147 fSpin = rand.nextF() * 360;
148 fMidpt = {bounds.centerX(), bounds.centerY()};
149}
const SkRect & getBounds() const
Definition: SkPath.cpp:430
float nextF()
Definition: SkRandom.h:55
float SkScalar
Definition: extension.cpp:12
static float max(float r, float g, float b)
Definition: hsl.cpp:49
Optional< SkRect > bounds
Definition: SkRecords.h:189
SkScalar w
SkScalar h

Member Data Documentation

◆ fMidpt

SkPoint PathTextSlide::Glyph::fMidpt

Definition at line 97 of file PathTextSlide.cpp.

◆ fPaint

SkPaint PathTextSlide::Glyph::fPaint

Definition at line 93 of file PathTextSlide.cpp.

◆ fPath

SkPath PathTextSlide::Glyph::fPath

Definition at line 92 of file PathTextSlide.cpp.

◆ fPosition

SkPoint PathTextSlide::Glyph::fPosition

Definition at line 94 of file PathTextSlide.cpp.

◆ fSpin

SkScalar PathTextSlide::Glyph::fSpin

Definition at line 96 of file PathTextSlide.cpp.

◆ fZoom

SkScalar PathTextSlide::Glyph::fZoom

Definition at line 95 of file PathTextSlide.cpp.


The documentation for this struct was generated from the following file: