Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
SkContourMeasureIter Class Reference

#include <SkContourMeasure.h>

Classes

class  Impl
 

Public Member Functions

 SkContourMeasureIter ()
 
 SkContourMeasureIter (const SkPath &path, bool forceClosed, SkScalar resScale=1)
 
 ~SkContourMeasureIter ()
 
 SkContourMeasureIter (SkContourMeasureIter &&)
 
SkContourMeasureIteroperator= (SkContourMeasureIter &&)
 
void reset (const SkPath &path, bool forceClosed, SkScalar resScale=1)
 
sk_sp< SkContourMeasurenext ()
 

Detailed Description

Definition at line 96 of file SkContourMeasure.h.

Constructor & Destructor Documentation

◆ SkContourMeasureIter() [1/3]

SkContourMeasureIter::SkContourMeasureIter ( )

Definition at line 500 of file SkContourMeasure.cpp.

500 {
501}

◆ SkContourMeasureIter() [2/3]

SkContourMeasureIter::SkContourMeasureIter ( const SkPath path,
bool  forceClosed,
SkScalar  resScale = 1 
)

Initialize the Iter with a path. The parts of the path that are needed are copied, so the client is free to modify/delete the path after this call.

resScale controls the precision of the measure. values > 1 increase the precision (and possibly slow down the computation).

Definition at line 503 of file SkContourMeasure.cpp.

504 {
505 this->reset(path, forceClosed, resScale);
506}
m reset()

◆ ~SkContourMeasureIter()

SkContourMeasureIter::~SkContourMeasureIter ( )

Definition at line 508 of file SkContourMeasure.cpp.

508{}

◆ SkContourMeasureIter() [3/3]

SkContourMeasureIter::SkContourMeasureIter ( SkContourMeasureIter &&  )
default

Member Function Documentation

◆ next()

sk_sp< SkContourMeasure > SkContourMeasureIter::next ( )

Iterates through contours in path, returning a contour-measure object for each contour in the path. Returns null when it is done.

This only returns non-zero length contours, where a contour is the segments between a kMove_Verb and either ...

  • the next kMove_Verb
  • kClose_Verb (1 or more)
  • kDone_Verb If it encounters a zero-length contour, it is skipped.

Definition at line 523 of file SkContourMeasure.cpp.

523 {
524 if (!fImpl) {
525 return nullptr;
526 }
527 while (fImpl->hasNextSegments()) {
528 auto cm = fImpl->buildSegments();
529 if (cm) {
530 return sk_sp<SkContourMeasure>(cm);
531 }
532 }
533 return nullptr;
534}

◆ operator=()

SkContourMeasureIter & SkContourMeasureIter::operator= ( SkContourMeasureIter &&  )
default

◆ reset()

void SkContourMeasureIter::reset ( const SkPath path,
bool  forceClosed,
SkScalar  resScale = 1 
)

Reset the Iter with a path. The parts of the path that are needed are copied, so the client is free to modify/delete the path after this call.

Assign a new path, or null to have none.

Definition at line 515 of file SkContourMeasure.cpp.

515 {
516 if (path.isFinite()) {
517 fImpl = std::make_unique<Impl>(path, forceClosed, resScale);
518 } else {
519 fImpl.reset();
520 }
521}
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

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