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

Public Member Functions

 TightBoundsBench (SkRect(*proc)(const SkPath &), const char suffix[])
 
- 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 1115 of file PathBench.cpp.

Constructor & Destructor Documentation

◆ TightBoundsBench()

TightBoundsBench::TightBoundsBench ( SkRect(*)(const SkPath &)  proc,
const char  suffix[] 
)
inline

Definition at line 1121 of file PathBench.cpp.

1121 : fProc(proc) {
1122 fName.printf("tight_bounds_%s", suffix);
1123
1124 const int N = 100;
1125 SkRandom rand;
1126 for (int i = 0; i < N; ++i) {
1127 fPath.moveTo(rand.nextF()*100, rand.nextF()*100);
1128 fPath.lineTo(rand.nextF()*100, rand.nextF()*100);
1129 fPath.quadTo(rand.nextF()*100, rand.nextF()*100, rand.nextF()*100, rand.nextF()*100);
1130 fPath.conicTo(rand.nextF()*100, rand.nextF()*100, rand.nextF()*100, rand.nextF()*100,
1131 rand.nextF()*10);
1132 fPath.cubicTo(rand.nextF()*100, rand.nextF()*100, rand.nextF()*100, rand.nextF()*100,
1133 rand.nextF()*100, rand.nextF()*100);
1134 }
1135 }
#define N
Definition: beziers.cpp:19
SkPath & moveTo(SkScalar x, SkScalar y)
Definition: SkPath.cpp:688
SkPath & lineTo(SkScalar x, SkScalar y)
Definition: SkPath.cpp:728
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Definition: SkPath.cpp:746
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition: SkPath.cpp:799
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Definition: SkPath.cpp:766
float nextF()
Definition: SkRandom.h:55
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534

Member Function Documentation

◆ isSuitableFor()

bool TightBoundsBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 1138 of file PathBench.cpp.

1138 {
1140 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 1144 of file PathBench.cpp.

1144 {
1145 for (int i = 0; i < loops*100; ++i) {
1146 fProc(fPath);
1147 }
1148 }

◆ onGetName()

const char * TightBoundsBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 1142 of file PathBench.cpp.

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

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