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

Public Member Functions

 NormalizeBench ()
 
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 492 of file MathBench.cpp.

Constructor & Destructor Documentation

◆ NormalizeBench()

NormalizeBench::NormalizeBench ( )
inline

Definition at line 499 of file MathBench.cpp.

499 {
500 SkRandom rand;
501 for (int i = 0; i < ARRAY; ++i) {
502 fVec[i].set(rand.nextSScalar1(), rand.nextSScalar1());
503 }
504
505 fName = "point_normalize";
506 }
SkScalar nextSScalar1()
Definition: SkRandom.h:113
void set(float x, float y)
Definition: SkPoint_impl.h:200

Member Function Documentation

◆ isSuitableFor()

bool NormalizeBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 508 of file MathBench.cpp.

508 {
510 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 516 of file MathBench.cpp.

516 {
517 int accum = 0;
518
519 for (int j = 0; j < loops; ++j) {
520 for (int i = 0; i < ARRAY; ++i) {
521 accum += fVec[i].normalize();
522 }
523 this->process(accum);
524 }
525 }
virtual void process(int)
Definition: MathBench.cpp:513
bool normalize()
Definition: SkPoint.cpp:22

◆ onGetName()

const char * NormalizeBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 527 of file MathBench.cpp.

527 {
528 return fName;
529 }

◆ process()

virtual void NormalizeBench::process ( int  )
inlinevirtual

Definition at line 513 of file MathBench.cpp.

513{}

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