Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
PathTransformBench Class Reference
Inheritance diagram for PathTransformBench:
RandomPathBench Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 PathTransformBench (bool inPlace)
 
- Public Member Functions inherited from RandomPathBench
bool isSuitableFor (Backend backend) override
 
- Public Member Functions inherited from Benchmark
 Benchmark ()
 
const char * getName ()
 
const char * getUniqueName ()
 
SkISize getSize ()
 
virtual bool isSuitableFor (Backend backend)
 
virtual void modifyGrContextOptions (GrContextOptions *)
 
virtual bool shouldLoop () const
 
void delayedSetup ()
 
void perCanvasPreDraw (SkCanvas *)
 
void perCanvasPostDraw (SkCanvas *)
 
void preDraw (SkCanvas *)
 
void postDraw (SkCanvas *)
 
void draw (int loops, SkCanvas *)
 
virtual void getGpuStats (SkCanvas *, skia_private::TArray< SkString > *keys, skia_private::TArray< double > *values)
 
virtual bool getDMSAAStats (GrRecordingContext *)
 
int getUnits () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Protected Member Functions

const char * onGetName () override
 
void onDelayedSetup () override
 
void onDraw (int loops, SkCanvas *) override
 
- Protected Member Functions inherited from RandomPathBench
void createData (int minVerbs, int maxVerbs, bool allowMoves=true, SkRect *bounds=nullptr)
 
void restartMakingPaths ()
 
void makePath (SkPath *path)
 
void finishedMakingPaths ()
 
- Protected Member Functions inherited from Benchmark
void setUnits (int units)
 
virtual void setupPaint (SkPaint *paint)
 
virtual const char * onGetName ()=0
 
virtual const char * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
virtual void onDraw (int loops, SkCanvas *)=0
 
virtual SkISize onGetSize ()
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 473 of file PathBench.cpp.

Constructor & Destructor Documentation

◆ PathTransformBench()

PathTransformBench::PathTransformBench ( bool  inPlace)
inline

Definition at line 475 of file PathBench.cpp.

475: fInPlace(inPlace) {}

Member Function Documentation

◆ onDelayedSetup()

void PathTransformBench::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 482 of file PathBench.cpp.

482 {
483 fMatrix.setScale(5 * SK_Scalar1, 6 * SK_Scalar1);
484 this->createData(10, 100);
485 fPaths.reset(kPathCnt);
486 for (int i = 0; i < kPathCnt; ++i) {
487 this->makePath(&fPaths[i]);
488 }
489 this->finishedMakingPaths();
490 if (!fInPlace) {
491 fTransformed.reset(kPathCnt);
492 }
493 }
#define SK_Scalar1
Definition: SkScalar.h:18
void makePath(SkPath *path)
Definition: PathBench.cpp:346
void createData(int minVerbs, int maxVerbs, bool allowMoves=true, SkRect *bounds=nullptr)
Definition: PathBench.cpp:313
void finishedMakingPaths()
Definition: PathBench.cpp:384
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:296
void reset(size_t count=0)
Definition: SkTemplates.h:123

◆ onDraw()

void PathTransformBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 495 of file PathBench.cpp.

495 {
496 if (fInPlace) {
497 for (int i = 0; i < loops; ++i) {
498 fPaths[i & (kPathCnt - 1)].transform(fMatrix);
499 }
500 } else {
501 for (int i = 0; i < loops; ++i) {
502 int idx = i & (kPathCnt - 1);
503 fPaths[idx].transform(fMatrix, &fTransformed[idx]);
504 }
505 }
506 }
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47

◆ onGetName()

const char * PathTransformBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 478 of file PathBench.cpp.

478 {
479 return fInPlace ? "path_transform_in_place" : "path_transform_copy";
480 }

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