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

Public Member Functions

 AnimBlurSlide ()
 
void draw (SkCanvas *canvas) override
 
bool animate (double nanos) 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 27 of file AnimBlurSlide.cpp.

Constructor & Destructor Documentation

◆ AnimBlurSlide()

AnimBlurSlide::AnimBlurSlide ( )
inline

Definition at line 32 of file AnimBlurSlide.cpp.

32{ fName ="AnimBlur"; }
SkString fName
Definition: Slide.h:54

Member Function Documentation

◆ animate()

bool AnimBlurSlide::animate ( double  nanos)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 54 of file AnimBlurSlide.cpp.

54 {
55 fBlurSigma = get_anim_sin(1e-9 * nanos, 100, 4, 5);
56 fCircleRadius = 3 + get_anim_sin(1e-9 * nanos, 150, 25, 3);
57 return true;
58 }
SkScalar get_anim_sin(double secs, SkScalar amplitude, SkScalar periodInSec, SkScalar phaseInSec)

◆ draw()

void AnimBlurSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 34 of file AnimBlurSlide.cpp.

34 {
35 static const SkBlurStyle gStyles[] = {
40 };
41 SkRandom random;
42
43 for (size_t i = 0; i < std::size(gStyles); ++i) {
46 fBlurSigma));
47 paint.setColor(random.nextU() | 0xff000000);
48 canvas->drawCircle(200 * SK_Scalar1 + 400 * (i % 2) * SK_Scalar1,
49 200 * SK_Scalar1 + i / 2 * 400 * SK_Scalar1,
50 fCircleRadius, paint);
51 }
52 }
SkBlurStyle
Definition: SkBlurTypes.h:11
@ kOuter_SkBlurStyle
nothing inside, fuzzy outside
Definition: SkBlurTypes.h:14
@ kSolid_SkBlurStyle
solid inside, fuzzy outside
Definition: SkBlurTypes.h:13
@ kInner_SkBlurStyle
fuzzy inside, nothing outside
Definition: SkBlurTypes.h:15
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
#define SK_Scalar1
Definition: SkScalar.h:18
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
Definition: SkCanvas.cpp:2707
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
uint32_t nextU()
Definition: SkRandom.h:42
const Paint & paint
Definition: color_source.cc:38
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
static constexpr SkFontStyle gStyles[]
Definition: typeface.cpp:89

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