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

Public Member Functions

 SlidesSlide ()
 
void load (SkScalar w, SkScalar h) override
 
void draw (SkCanvas *canvas) override
 
- Public Member Functions inherited from ClickHandlerSlide
bool onMouse (SkScalar x, SkScalar y, skui::InputState clickState, skui::ModifierKey modifierKeys) final
 
- 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
 

Protected Member Functions

ClickonFindClickHandler (SkScalar x, SkScalar y, skui::ModifierKey) override
 
bool onClick (ClickHandlerSlide::Click *) override
 
virtual ClickonFindClickHandler (SkScalar x, SkScalar y, skui::ModifierKey modi)=0
 
virtual bool onClick (Click *)=0
 

Additional Inherited Members

- Protected Attributes inherited from Slide
SkString fName
 

Detailed Description

Definition at line 401 of file SlidesSlide.cpp.

Constructor & Destructor Documentation

◆ SlidesSlide()

SlidesSlide::SlidesSlide ( )
inline

Definition at line 405 of file SlidesSlide.cpp.

405{ fName = "Slides"; }
SkString fName
Definition: Slide.h:54

Member Function Documentation

◆ draw()

void SlidesSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 426 of file SlidesSlide.cpp.

426 {
427 gProc[fIndex](canvas);
428 }
static const SlideProc gProc[]

◆ load()

void SlidesSlide::load ( SkScalar  w,
SkScalar  h 
)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 407 of file SlidesSlide.cpp.

407 {
408 fIndex = 0;
409
410 SkBitmap bm;
411 bm.allocN32Pixels(1024, 768);
412 SkCanvas canvas(bm);
413 SkScalar s = SkIntToScalar(1024) / 640;
414 canvas.scale(s, s);
415 for (size_t i = 0; i < std::size(gProc); i++) {
416 canvas.save();
417 canvas.drawColor(BG_COLOR);
418 gProc[i](&canvas);
419 canvas.restore();
420 SkString str;
421 str.printf("/skimages/slide_%zu.png", i);
423 }
424 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
#define BG_COLOR
Definition: SlidesSlide.cpp:18
void allocN32Pixels(int width, int height, bool isOpaque=false)
Definition: SkBitmap.cpp:232
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const char * c_str() const
Definition: SkString.h:133
float SkScalar
Definition: extension.cpp:12
struct MyStruct s
bool EncodeImageToPngFile(const char *path, const SkBitmap &src)
Definition: EncodeUtils.cpp:60
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

◆ onClick()

bool SlidesSlide::onClick ( ClickHandlerSlide::Click )
inlineoverrideprotectedvirtual

Override to track clicks. Return true as long as you want to track the pen/mouse.

Implements ClickHandlerSlide.

Definition at line 436 of file SlidesSlide.cpp.

436{ return false; }

◆ onFindClickHandler()

Click * SlidesSlide::onFindClickHandler ( SkScalar  x,
SkScalar  y,
skui::ModifierKey  modi 
)
inlineoverrideprotectedvirtual

Return a Click object to handle the click. onClick will be called repeatedly with the latest mouse state tracked on the Click object until it returns false.

Implements ClickHandlerSlide.

Definition at line 431 of file SlidesSlide.cpp.

431 {
432 fIndex = (fIndex + 1) % std::size(gProc);
433 return nullptr;
434 }

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