Flutter Engine
The Flutter Engine
Public Member Functions | Protected Attributes | List of all members
PathTextSlide::GlyphAnimator Class Reference
Inheritance diagram for PathTextSlide::GlyphAnimator:
PathTextSlide::MovingGlyphAnimator PathTextSlide::WavyGlyphAnimator

Public Member Functions

 GlyphAnimator (Glyph *glyphs)
 
virtual void reset (SkRandom *, int screenWidth, int screenHeight)
 
virtual bool animate (double nanos, int screenWidth, int screenHeight)
 
virtual void draw (SkCanvas *canvas)
 
virtual ~GlyphAnimator ()
 

Protected Attributes

Glyph *const fGlyphs
 

Detailed Description

Definition at line 100 of file PathTextSlide.cpp.

Constructor & Destructor Documentation

◆ GlyphAnimator()

PathTextSlide::GlyphAnimator::GlyphAnimator ( Glyph glyphs)
inline

Definition at line 102 of file PathTextSlide.cpp.

102: fGlyphs(glyphs) {}
uint16_t glyphs[5]
Definition: FontMgrTest.cpp:46

◆ ~GlyphAnimator()

virtual PathTextSlide::GlyphAnimator::~GlyphAnimator ( )
inlinevirtual

Definition at line 116 of file PathTextSlide.cpp.

116{}

Member Function Documentation

◆ animate()

virtual bool PathTextSlide::GlyphAnimator::animate ( double  nanos,
int  screenWidth,
int  screenHeight 
)
inlinevirtual

Reimplemented in PathTextSlide::MovingGlyphAnimator.

Definition at line 104 of file PathTextSlide.cpp.

104{ return false; }

◆ draw()

virtual void PathTextSlide::GlyphAnimator::draw ( SkCanvas canvas)
inlinevirtual

Reimplemented in PathTextSlide::MovingGlyphAnimator, and PathTextSlide::WavyGlyphAnimator.

Definition at line 105 of file PathTextSlide.cpp.

105 {
106 for (int i = 0; i < kNumPaths; ++i) {
107 Glyph& glyph = fGlyphs[i];
108 SkAutoCanvasRestore acr(canvas, true);
109 canvas->translate(glyph.fPosition.x(), glyph.fPosition.y());
110 canvas->scale(glyph.fZoom, glyph.fZoom);
111 canvas->rotate(glyph.fSpin);
112 canvas->translate(-glyph.fMidpt.x(), -glyph.fMidpt.y());
113 canvas->drawPath(glyph.fPath, glyph.fPaint);
114 }
115 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289

◆ reset()

virtual void PathTextSlide::GlyphAnimator::reset ( SkRandom ,
int  screenWidth,
int  screenHeight 
)
inlinevirtual

Reimplemented in PathTextSlide::MovingGlyphAnimator, and PathTextSlide::WavyGlyphAnimator.

Definition at line 103 of file PathTextSlide.cpp.

103{}

Member Data Documentation

◆ fGlyphs

Glyph* const PathTextSlide::GlyphAnimator::fGlyphs
protected

Definition at line 119 of file PathTextSlide.cpp.


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