Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CanvasLinePoint Class Reference
Inheritance diagram for CanvasLinePoint:
MMObject CanvasBezierSegment CanvasQuadraticSegment

Public Member Functions

 CanvasLinePoint (SkRandom *random, SkSize size, SkPoint *prev)
 
 ~CanvasLinePoint () override=default
 
virtual void append (SkPath *path)
 
void draw (SkCanvas *) override
 
void animate (double) override
 
SkColor getColor ()
 
float getWidth ()
 
SkPoint getPoint ()
 
SkPoint getCoord ()
 
bool isSplit ()
 
void toggleIsSplit ()
 
- Public Member Functions inherited from MMObject
virtual ~MMObject ()=default
 

Protected Member Functions

void setEndPoint (SkRandom *random, SkSize size, SkPoint *prevCoord)
 

Detailed Description

Definition at line 430 of file MotionMarkSlide.cpp.

Constructor & Destructor Documentation

◆ CanvasLinePoint()

CanvasLinePoint::CanvasLinePoint ( SkRandom random,
SkSize  size,
SkPoint prev 
)
inline

Definition at line 458 of file MotionMarkSlide.cpp.

458 {
459 const SkColor kColors[7] = {
460 0xff101010, 0xff808080, 0xffc0c0c0, 0xff101010, 0xff808080, 0xffc0c0c0, 0xffe01040
461 };
462 fColor = kColors[random->nextRangeU(0, 6)];
463
464 fWidth = std::pow(random->nextF(), 5) * 20 + 1;
465 fIsSplit = random->nextBool();
466
467 this->setEndPoint(random, size, prev);
468 }
static float prev(float f)
uint32_t SkColor
Definition SkColor.h:37
void setEndPoint(SkRandom *random, SkSize size, SkPoint *prevCoord)
float nextF()
Definition SkRandom.h:55
bool nextBool()
Definition SkRandom.h:117
uint32_t nextRangeU(uint32_t min, uint32_t max)
Definition SkRandom.h:80
const DlColor kColors[]

◆ ~CanvasLinePoint()

CanvasLinePoint::~CanvasLinePoint ( )
overridedefault

Member Function Documentation

◆ animate()

void CanvasLinePoint::animate ( double  )
inlineoverridevirtual

Implements MMObject.

Definition at line 478 of file MotionMarkSlide.cpp.

478{}

◆ append()

virtual void CanvasLinePoint::append ( SkPath path)
inlinevirtual

Reimplemented in CanvasQuadraticSegment, and CanvasBezierSegment.

Definition at line 472 of file MotionMarkSlide.cpp.

472 {
473 path->lineTo(fPoint);
474 }
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ draw()

void CanvasLinePoint::draw ( SkCanvas )
inlineoverridevirtual

Implements MMObject.

Definition at line 477 of file MotionMarkSlide.cpp.

477{}

◆ getColor()

SkColor CanvasLinePoint::getColor ( )
inline

Definition at line 480 of file MotionMarkSlide.cpp.

480{ return fColor; }

◆ getCoord()

SkPoint CanvasLinePoint::getCoord ( )
inline

Definition at line 483 of file MotionMarkSlide.cpp.

483{ return fCoordinate; }

◆ getPoint()

SkPoint CanvasLinePoint::getPoint ( )
inline

Definition at line 482 of file MotionMarkSlide.cpp.

482{ return fPoint; }

◆ getWidth()

float CanvasLinePoint::getWidth ( )
inline

Definition at line 481 of file MotionMarkSlide.cpp.

481{ return fWidth; }

◆ isSplit()

bool CanvasLinePoint::isSplit ( )
inline

Definition at line 484 of file MotionMarkSlide.cpp.

484{ return fIsSplit; }

◆ setEndPoint()

void CanvasLinePoint::setEndPoint ( SkRandom random,
SkSize  size,
SkPoint prevCoord 
)
inlineprotected

Definition at line 432 of file MotionMarkSlide.cpp.

432 {
433 const SkSize kGridSize = { 80, 40 };
434 const SkPoint kGridCenter = { 40, 20 };
435 const SkPoint kOffsets[4] = {
436 {-4, 0},
437 {2, 0},
438 {1, -2},
439 {1, 2}
440 };
441
442 SkPoint coordinate = prevCoord ? *prevCoord : kGridCenter;
443 if (prevCoord) {
444 SkPoint offset = kOffsets[random->nextRangeU(0, 3)];
445 coordinate += offset;
446 if (coordinate.fX < 0 || coordinate.fX > kGridSize.width())
447 coordinate.fX -= offset.fX * 2;
448 if (coordinate.fY < 0 || coordinate.fY > kGridSize.height())
449 coordinate.fY -= offset.fY * 2;
450 }
451
452 fPoint = SkPoint::Make((coordinate.fX + 0.5f) * size.width() / (kGridSize.width() + 1),
453 (coordinate.fY + 0.5f) * size.height() / (kGridSize.height() + 1));
454 fCoordinate = coordinate;
455 }
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 offset
float fX
x-axis value
static constexpr SkPoint Make(float x, float y)
float fY
y-axis value
SkScalar width() const
Definition SkSize.h:76
SkScalar height() const
Definition SkSize.h:77

◆ toggleIsSplit()

void CanvasLinePoint::toggleIsSplit ( )
inline

Definition at line 485 of file MotionMarkSlide.cpp.

485{ fIsSplit = !fIsSplit; }

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