Flutter Engine
The Flutter Engine
Classes | Functions
MotionMarkSlide.cpp File Reference
#include <vector>
#include "include/core/SkCanvas.h"
#include "include/core/SkPath.h"
#include "include/effects/SkGradientShader.h"
#include "src/base/SkRandom.h"
#include "tools/Resources.h"
#include "tools/gpu/YUVUtils.h"
#include "tools/viewer/Slide.h"

Go to the source code of this file.

Classes

class  MMObject
 
class  Stage
 
class  MotionMarkSlide
 
struct  LineSegmentParams
 
class  CanvasLineSegment
 
class  CanvasLineSegmentStage
 
class  CanvasArc
 
class  CanvasArcStage
 
class  CanvasLinePoint
 
class  CanvasQuadraticSegment
 
class  CanvasBezierSegment
 
class  CanvasLinePathStage
 
class  Rotater
 
class  BouncingParticle
 
class  BouncingParticlesStage
 
class  BouncingTaggedImage
 
class  BouncingTaggedImagesStage
 
class  CanvasLinesSlide
 
class  CanvasArcsSlide
 
class  PathsSlide
 
class  BouncingTaggedImagesSlide
 

Functions

std::unique_ptr< CanvasLinePointmake_line_path (SkRandom *random, SkSize size, SkPoint *prev)
 
SkPoint random_position (SkRandom *random, SkSize maxPosition)
 
float random_angle (SkRandom *random)
 
float random_velocity (SkRandom *random, float maxVelocity)
 
Rotater random_rotater (SkRandom *random)
 
SkPoint point_on_circle (float angle, float radius)
 

Function Documentation

◆ make_line_path()

std::unique_ptr< CanvasLinePoint > make_line_path ( SkRandom random,
SkSize  size,
SkPoint prev 
)

Definition at line 545 of file MotionMarkSlide.cpp.

545 {
546 int choice = random->nextRangeU(0, 3);
547 switch (choice) {
548 case 0:
549 return std::make_unique<CanvasQuadraticSegment>(random, size, prev);
550 break;
551 case 1:
552 return std::make_unique<CanvasBezierSegment>(random, size, prev);
553 break;
554 case 2:
555 case 3:
556 default:
557 return std::make_unique<CanvasLinePoint>(random, size, prev);
558 break;
559 }
560}
static float prev(float f)
uint32_t nextRangeU(uint32_t min, uint32_t max)
Definition: SkRandom.h:80
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

◆ point_on_circle()

SkPoint point_on_circle ( float  angle,
float  radius 
)

Definition at line 660 of file MotionMarkSlide.cpp.

660 {
661 return {radius * SkScalarCos(angle), radius * SkScalarSin(angle)};
662}
#define SkScalarSin(radians)
Definition: SkScalar.h:45
#define SkScalarCos(radians)
Definition: SkScalar.h:46

◆ random_angle()

float random_angle ( SkRandom random)

Definition at line 629 of file MotionMarkSlide.cpp.

629 {
630 return random->nextRangeF(0, 2*SK_FloatPI);
631}
constexpr float SK_FloatPI
float nextRangeF(float min, float max)
Definition: SkRandom.h:64

◆ random_position()

SkPoint random_position ( SkRandom random,
SkSize  maxPosition 
)

Definition at line 624 of file MotionMarkSlide.cpp.

624 {
625 return {(float)random->nextRangeU(0, maxPosition.width()),
626 (float)random->nextRangeU(0, maxPosition.height())};
627}
SkScalar width() const
Definition: SkSize.h:76
SkScalar height() const
Definition: SkSize.h:77

◆ random_rotater()

Rotater random_rotater ( SkRandom random)

Definition at line 656 of file MotionMarkSlide.cpp.

656 {
657 return Rotater(random->nextRangeF(10, 100));
658}

◆ random_velocity()

float random_velocity ( SkRandom random,
float  maxVelocity 
)

Definition at line 633 of file MotionMarkSlide.cpp.

633 {
634 return random->nextRangeF(maxVelocity/8, maxVelocity);
635}