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

Public Member Functions

 CubicMapBench (SkPoint p1, SkPoint p2)
 
bool isSuitableFor (Backend backend) override
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) 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
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 
- 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 ()
 

Detailed Description

Definition at line 11 of file CubicMapBench.cpp.

Constructor & Destructor Documentation

◆ CubicMapBench()

CubicMapBench::CubicMapBench ( SkPoint  p1,
SkPoint  p2 
)
inline

Definition at line 13 of file CubicMapBench.cpp.

13 : fCMap(p1, p2) {
14 fName.printf("cubicmap_%g_%g_%g_%g", p1.fX, p1.fY, p2.fX, p2.fY);
15 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
float fX
x-axis value
Definition: SkPoint_impl.h:164
float fY
y-axis value
Definition: SkPoint_impl.h:165

Member Function Documentation

◆ isSuitableFor()

bool CubicMapBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 17 of file CubicMapBench.cpp.

17 {
19 }
const char * backend

◆ onDraw()

void CubicMapBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverridevirtual

Implements Benchmark.

Definition at line 25 of file CubicMapBench.cpp.

25 {
26 for (int outer = 0; outer < 100; ++outer) {
27 for (int i = 0; i < loops; ++i) {
28 for (SkScalar x = 0; x <= 1; x += 1.0f / 512) {
29 fCMap.computeYFromX(x);
30 }
31 }
32 }
33 }
float computeYFromX(float x) const
Definition: SkCubicMap.cpp:61
float SkScalar
Definition: extension.cpp:12
double x

◆ onGetName()

const char * CubicMapBench::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 21 of file CubicMapBench.cpp.

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

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