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

Public Member Functions

 MixerSlide ()
 
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 (Click *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 27 of file MixerSlide.cpp.

Constructor & Destructor Documentation

◆ MixerSlide()

MixerSlide::MixerSlide ( )
inline

Definition at line 36 of file MixerSlide.cpp.

36{ fName = "Mixer"; }
SkString fName
Definition: Slide.h:54

Member Function Documentation

◆ draw()

void MixerSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 38 of file MixerSlide.cpp.

38 {
39 if (!fImg) {
40 fImg = ToolUtils::GetResourceAsImage("images/mandrill_256.png");
43 }
44
45 float gap = fImg->width() * 3;
46
47 canvas->translate(10, 10);
48 dodraw(canvas, nullptr, fCF1, gap);
49 canvas->translate(0, fImg->height() + 10);
50 dodraw(canvas, fCF0, nullptr, gap);
51 canvas->translate(0, fImg->height() + 10);
52 dodraw(canvas, fCF0, fCF1, gap);
53
54 fWeight += fDW;
55 if (fWeight > 1 || fWeight < 0) {
56 fDW = -fDW;
57 }
58 }
const float gMat[]
Definition: MixerSlide.cpp:20
@ kScreen
r = s + d - s*d
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
int width() const
Definition: SkImage.h:285
int height() const
Definition: SkImage.h:291
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition: DecodeUtils.h:25

◆ onClick()

bool MixerSlide::onClick ( Click )
inlineoverrideprotectedvirtual

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

Implements ClickHandlerSlide.

Definition at line 66 of file MixerSlide.cpp.

66 {
67 fRect.offset(click->fCurr.fX - click->fPrev.fX,
68 click->fCurr.fY - click->fPrev.fY);
69 return true;
70 }
void offset(int32_t dx, int32_t dy)
Definition: SkRect.h:367

◆ onFindClickHandler()

Click * MixerSlide::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 61 of file MixerSlide.cpp.

61 {
62 return fRect.contains(SkScalarRoundToInt(x),
63 SkScalarRoundToInt(y)) ? new Click() : nullptr;
64 }
#define SkScalarRoundToInt(x)
Definition: SkScalar.h:37
double y
double x
bool contains(int32_t x, int32_t y) const
Definition: SkRect.h:463

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