Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
CTZBench Class Reference
Inheritance diagram for CTZBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 CTZBench (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 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 * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
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 430 of file MathBench.cpp.

Constructor & Destructor Documentation

◆ CTZBench()

CTZBench::CTZBench ( bool  usePortable)
inline

Definition at line 438 of file MathBench.cpp.

438 : fUsePortable(usePortable) {
439
440 SkRandom rand;
441 for (int i = 0; i < ARRAY; ++i) {
442 fData[i] = rand.nextU();
443 }
444
445 if (fUsePortable) {
446 fName = "ctz_portable";
447 } else {
448 fName = "ctz_intrinsic";
449 }
450 }
uint32_t nextU()
Definition SkRandom.h:42

Member Function Documentation

◆ isSuitableFor()

bool CTZBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 452 of file MathBench.cpp.

452 {
454 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 460 of file MathBench.cpp.

460 {
461 int accum = 0;
462
463 if (fUsePortable) {
464 for (int j = 0; j < loops; ++j) {
465 for (int i = 0; i < ARRAY; ++i) {
466 accum += SkCTZ_portable(fData[i]);
467 }
468 this->process(accum);
469 }
470 } else {
471 for (int j = 0; j < loops; ++j) {
472 for (int i = 0; i < ARRAY; ++i) {
473 accum += SkCTZ(fData[i]);
474 }
475 this->process(accum);
476 }
477 }
478 }
constexpr int SkCTZ_portable(uint32_t x)
Returns the number of trailing zero bits (0...32)
Definition SkMathPriv.h:193
static int SkCTZ(uint32_t mask)
Definition SkMathPriv.h:224
virtual void process(int)

◆ onGetName()

const char * CTZBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 480 of file MathBench.cpp.

480 {
481 return fName;
482 }

◆ process()

virtual void CTZBench::process ( int  )
inlinevirtual

Definition at line 457 of file MathBench.cpp.

457{}

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