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

Public Member Functions

 CLZBench (bool usePortable)
 
bool isSuitableFor (Backend backend) override
 
virtual void process (int)
 
- 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 370 of file MathBench.cpp.

Constructor & Destructor Documentation

◆ CLZBench()

CLZBench::CLZBench ( bool  usePortable)
inline

Definition at line 378 of file MathBench.cpp.

378 : fUsePortable(usePortable) {
379
380 SkRandom rand;
381 for (int i = 0; i < ARRAY; ++i) {
382 fData[i] = rand.nextU();
383 }
384
385 if (fUsePortable) {
386 fName = "clz_portable";
387 } else {
388 fName = "clz_intrinsic";
389 }
390 }
uint32_t nextU()
Definition: SkRandom.h:42

Member Function Documentation

◆ isSuitableFor()

bool CLZBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 392 of file MathBench.cpp.

392 {
394 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 400 of file MathBench.cpp.

400 {
401 int accum = 0;
402
403 if (fUsePortable) {
404 for (int j = 0; j < loops; ++j) {
405 for (int i = 0; i < ARRAY; ++i) {
406 accum += SkCLZ_portable(fData[i]);
407 }
408 this->process(accum);
409 }
410 } else {
411 for (int j = 0; j < loops; ++j) {
412 for (int i = 0; i < ARRAY; ++i) {
413 accum += SkCLZ(fData[i]);
414 }
415 this->process(accum);
416 }
417 }
418 }
constexpr int SkCLZ_portable(uint32_t x)
Returns the number of leading zero bits (0...32)
Definition: SkMathPriv.h:149
static int SkCLZ(uint32_t mask)
Definition: SkMathPriv.h:186
virtual void process(int)
Definition: MathBench.cpp:397

◆ onGetName()

const char * CLZBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 420 of file MathBench.cpp.

420 {
421 return fName;
422 }

◆ process()

virtual void CLZBench::process ( int  )
inlinevirtual

Definition at line 397 of file MathBench.cpp.

397{}

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