Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Stage Class Referenceabstract
Inheritance diagram for Stage:
BouncingParticlesStage CanvasArcStage CanvasLinePathStage CanvasLineSegmentStage BouncingTaggedImagesStage

Public Member Functions

 Stage (SkSize size, int startingObjectCount, int objectIncrement)
 
virtual ~Stage ()=default
 
virtual void draw (SkCanvas *canvas)
 
virtual bool animate (double nanos)
 
virtual bool onChar (SkUnichar uni)
 

Protected Member Functions

virtual std::unique_ptr< MMObjectcreateObject ()=0
 
void initializeObjects ()
 

Protected Attributes

SkSize fSize
 
int fStartingObjectCount
 
int fObjectIncrement
 
std::vector< std::unique_ptr< MMObject > > fObjects
 
SkRandom fRandom
 

Detailed Description

Definition at line 33 of file MotionMarkSlide.cpp.

Constructor & Destructor Documentation

◆ Stage()

Stage::Stage ( SkSize  size,
int  startingObjectCount,
int  objectIncrement 
)
inline

Definition at line 35 of file MotionMarkSlide.cpp.

36 : fSize(size)
37 , fStartingObjectCount(startingObjectCount)
38 , fObjectIncrement(objectIncrement) {}
SkSize fSize
int fStartingObjectCount
int fObjectIncrement
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ ~Stage()

virtual Stage::~Stage ( )
virtualdefault

Member Function Documentation

◆ animate()

virtual bool Stage::animate ( double  nanos)
inlinevirtual

Reimplemented in CanvasLineSegmentStage, BouncingParticlesStage, and CanvasLinePathStage.

Definition at line 49 of file MotionMarkSlide.cpp.

49 {
50 for (size_t i = 0; i < fObjects.size(); ++i) {
51 fObjects[i]->animate(nanos);
52 }
53 return true;
54 }
std::vector< std::unique_ptr< MMObject > > fObjects

◆ createObject()

virtual std::unique_ptr< MMObject > Stage::createObject ( )
protectedpure virtual

◆ draw()

virtual void Stage::draw ( SkCanvas canvas)
inlinevirtual

Reimplemented in CanvasLineSegmentStage, CanvasArcStage, CanvasLinePathStage, and BouncingTaggedImagesStage.

Definition at line 43 of file MotionMarkSlide.cpp.

43 {
44 for (size_t i = 0; i < fObjects.size(); ++i) {
45 fObjects[i]->draw(canvas);
46 }
47 }

◆ initializeObjects()

void Stage::initializeObjects ( )
inlineprotected

Definition at line 84 of file MotionMarkSlide.cpp.

84 {
85 for (int i = 0; i < fStartingObjectCount; ++i) {
86 fObjects.push_back(this->createObject());
87 }
88 }
virtual std::unique_ptr< MMObject > createObject()=0

◆ onChar()

virtual bool Stage::onChar ( SkUnichar  uni)
inlinevirtual

Definition at line 57 of file MotionMarkSlide.cpp.

57 {
58 bool handled = false;
59 switch (uni) {
60 case '+':
61 case '=':
62 for (int i = 0; i < fObjectIncrement; ++i) {
63 fObjects.push_back(this->createObject());
64 }
65 handled = true;
66 break;
67 case '-':
68 case '_':
69 if (fObjects.size() > (size_t) fObjectIncrement) {
70 fObjects.resize(fObjects.size() - (size_t) fObjectIncrement);
71 }
72 handled = true;
73 break;
74 default:
75 break;
76 }
77
78 return handled;
79 }

Member Data Documentation

◆ fObjectIncrement

int Stage::fObjectIncrement
protected

Definition at line 93 of file MotionMarkSlide.cpp.

◆ fObjects

std::vector<std::unique_ptr<MMObject> > Stage::fObjects
protected

Definition at line 95 of file MotionMarkSlide.cpp.

◆ fRandom

SkRandom Stage::fRandom
protected

Definition at line 96 of file MotionMarkSlide.cpp.

◆ fSize

SkSize Stage::fSize
protected

Definition at line 90 of file MotionMarkSlide.cpp.

◆ fStartingObjectCount

int Stage::fStartingObjectCount
protected

Definition at line 92 of file MotionMarkSlide.cpp.


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