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

Public Member Functions

 FloorBench (bool fast)
 
bool isSuitableFor (Backend backend) override
 
virtual void process (float)
 
- 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

void onDraw (int loops, SkCanvas *) override
 
const char * onGetName () 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 309 of file MathBench.cpp.

Constructor & Destructor Documentation

◆ FloorBench()

FloorBench::FloorBench ( bool  fast)
inline

Definition at line 317 of file MathBench.cpp.

317 : fFast(fast) {
318 SkRandom rand;
319
320 for (int i = 0; i < ARRAY; ++i) {
321 fData[i] = rand.nextSScalar1();
322 }
323
324 if (fast) {
325 fName = "floor_fast";
326 } else {
327 fName = "floor_std";
328 }
329 }
SkScalar nextSScalar1()
Definition: SkRandom.h:113

Member Function Documentation

◆ isSuitableFor()

bool FloorBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 331 of file MathBench.cpp.

331 {
333 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 338 of file MathBench.cpp.

338 {
339 SkRandom rand;
340 float accum = 0;
341 const float* data = fData;
342
343 if (fFast) {
344 for (int j = 0; j < loops; ++j) {
345 for (int i = 0; i < ARRAY; ++i) {
346 accum += fast_floor(data[i]);
347 }
348 this->process(accum);
349 }
350 } else {
351 for (int j = 0; j < loops; ++j) {
352 for (int i = 0; i < ARRAY; ++i) {
353 accum += std::floor(data[i]);
354 }
355 this->process(accum);
356 }
357 }
358 }
static float fast_floor(float x)
Definition: MathBench.cpp:21
virtual void process(float)
Definition: MathBench.cpp:335
SIN Vec< N, float > floor(const Vec< N, float > &x)
Definition: SkVx.h:703
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onGetName()

const char * FloorBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 360 of file MathBench.cpp.

360 {
361 return fName;
362 }

◆ process()

virtual void FloorBench::process ( float  )
inlinevirtual

Definition at line 335 of file MathBench.cpp.

335{}

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