Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
DrawAtlasSlide Class Reference
Inheritance diagram for DrawAtlasSlide:
Slide SkRefCnt SkRefCntBase

Public Member Functions

 DrawAtlasSlide (const char name[], DrawAtlasProc proc)
 
bool onChar (SkUnichar uni) override
 
void draw (SkCanvas *canvas) override
 
bool animate (double) override
 
void load (SkScalar winWidth, SkScalar winHeight) override
 
SkISize getDimensions () const override
 
- Public Member Functions inherited from Slide
virtual SkISize getDimensions () const
 
virtual void gpuTeardown ()
 
virtual void draw (SkCanvas *canvas)=0
 
virtual bool animate (double nanos)
 
virtual void load (SkScalar winWidth, SkScalar winHeight)
 
virtual void resize (SkScalar winWidth, SkScalar winHeight)
 
virtual void unload ()
 
virtual bool onChar (SkUnichar c)
 
virtual bool onMouse (SkScalar x, SkScalar y, skui::InputState state, skui::ModifierKey modifiers)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
const SkStringgetName ()
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Protected Attributes inherited from Slide
SkString fName
 

Detailed Description

Definition at line 204 of file AtlasSlide.cpp.

Constructor & Destructor Documentation

◆ DrawAtlasSlide()

DrawAtlasSlide::DrawAtlasSlide ( const char  name[],
DrawAtlasProc  proc 
)
inline

Definition at line 209 of file AtlasSlide.cpp.

209: fProc(proc) { fName = name; }
SkString fName
Definition: Slide.h:54
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Member Function Documentation

◆ animate()

bool DrawAtlasSlide::animate ( double  )
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 223 of file AtlasSlide.cpp.

223{ return true; }

◆ draw()

void DrawAtlasSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 219 of file AtlasSlide.cpp.

219 {
220 canvas->drawDrawable(fDrawable.get());
221 }
void drawDrawable(SkDrawable *drawable, const SkMatrix *matrix=nullptr)
Definition: SkCanvas.cpp:2574
T * get() const
Definition: SkRefCnt.h:303

◆ getDimensions()

SkISize DrawAtlasSlide::getDimensions ( ) const
inlineoverridevirtual

A slide may have a content dimensions that is independent of the current window size. An empty size indicates that the Slide's dimensions are equal to the window's dimensions.

Reimplemented from Slide.

Definition at line 237 of file AtlasSlide.cpp.

237{ return {640, 480}; }

◆ load()

void DrawAtlasSlide::load ( SkScalar  winWidth,
SkScalar  winHeight 
)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 233 of file AtlasSlide.cpp.

233 {
234 fDrawable = sk_make_sp<DrawAtlasDrawable>(fProc, SkRect::Make(this->getDimensions()));
235 }
SkISize getDimensions() const override
Definition: AtlasSlide.cpp:237
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669

◆ onChar()

bool DrawAtlasSlide::onChar ( SkUnichar  uni)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 211 of file AtlasSlide.cpp.

211 {
212 switch (uni) {
213 case 'C': fDrawable->toggleUseColors(); return true;
214 default: break;
215 }
216 return false;
217 }

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