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

Public Member Functions

 StrokeBench (const SkPath &path, const SkPaint &paint, const char pathType[], SkScalar res)
 
- 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

bool isSuitableFor (Backend backend) override
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *canvas) override
 
- 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 15 of file StrokeBench.cpp.

Constructor & Destructor Documentation

◆ StrokeBench()

StrokeBench::StrokeBench ( const SkPath path,
const SkPaint paint,
const char  pathType[],
SkScalar  res 
)
inline

Definition at line 17 of file StrokeBench.cpp.

18 : fPath(path), fPaint(paint), fRes(res)
19 {
20 fName.printf("build_stroke_%s_%g_%d_%d",
21 pathType, paint.getStrokeWidth(), paint.getStrokeJoin(), paint.getStrokeCap());
22 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const Paint & paint
Definition: color_source.cc:38
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

Member Function Documentation

◆ isSuitableFor()

bool StrokeBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 25 of file StrokeBench.cpp.

25 {
27 }
const char * backend

◆ onDraw()

void StrokeBench::onDraw ( int  loops,
SkCanvas canvas 
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 31 of file StrokeBench.cpp.

31 {
32 SkPaint paint(fPaint);
33 this->setupPaint(&paint);
34
35 for (int outer = 0; outer < 10; ++outer) {
36 for (int i = 0; i < loops; ++i) {
38 skpathutils::FillPathWithPaint(fPath, paint, &result, nullptr, fRes);
39 }
40 }
41 }
virtual void setupPaint(SkPaint *paint)
Definition: Benchmark.cpp:55
Definition: SkPath.h:59
GAsyncResult * result
SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst, const SkRect *cullRect, SkScalar resScale=1)
Definition: SkPathUtils.cpp:23

◆ onGetName()

const char * StrokeBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 29 of file StrokeBench.cpp.

29{ return fName.c_str(); }
const char * c_str() const
Definition: SkString.h:133

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