Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
MemsetBench< T > Class Template Reference
Inheritance diagram for MemsetBench< T >:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 MemsetBench (size_t bytes)
 
bool isSuitableFor (Backend backend) override
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) override
 
void onDraw (int loops, SkCanvas *)
 
void onDraw (int loops, SkCanvas *)
 
void onDraw (int loops, SkCanvas *)
 
- 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

template<typename T>
class MemsetBench< T >

Definition at line 15 of file MemsetBench.cpp.

Constructor & Destructor Documentation

◆ MemsetBench()

template<typename T >
MemsetBench< T >::MemsetBench ( size_t  bytes)
inlineexplicit

Definition at line 17 of file MemsetBench.cpp.

18 : fN(bytes / sizeof(T))
19 , fBuffer(fN)
20 , fName(SkStringPrintf("memset%zu_%zu", sizeof(T)*8, bytes)) {}
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
#define T
Definition: precompiler.cc:65

Member Function Documentation

◆ isSuitableFor()

template<typename T >
bool MemsetBench< T >::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 22 of file MemsetBench.cpp.

const char * backend

◆ onDraw() [1/4]

void MemsetBench< uint64_t >::onDraw ( int  loops,
SkCanvas  
)
virtual

Implements Benchmark.

Definition at line 33 of file MemsetBench.cpp.

33 {
34 for (int i = 0; i < 1000*loops; i++) {
35 SkOpts::memset64(fBuffer.get(), 0xFACEFACEFACEFACE, fN);
36 }
37}
void(* memset64)(uint64_t[], uint64_t, int)

◆ onDraw() [2/4]

void MemsetBench< uint32_t >::onDraw ( int  loops,
SkCanvas  
)
virtual

Implements Benchmark.

Definition at line 39 of file MemsetBench.cpp.

39 {
40 for (int i = 0; i < 1000*loops; i++) {
41 SkOpts::memset32(fBuffer.get(), 0xFACEB004, fN);
42 }
43}
void(* memset32)(uint32_t[], uint32_t, int)

◆ onDraw() [3/4]

void MemsetBench< uint16_t >::onDraw ( int  loops,
SkCanvas  
)
virtual

Implements Benchmark.

Definition at line 45 of file MemsetBench.cpp.

45 {
46 for (int i = 0; i < 1000*loops; i++) {
47 SkOpts::memset16(fBuffer.get(), 0x4973, fN);
48 }
49}
void(* memset16)(uint16_t[], uint16_t, int)

◆ onDraw() [4/4]

template<typename T >
void MemsetBench< T >::onDraw ( int  loops,
SkCanvas  
)
overridevirtual

Implements Benchmark.

◆ onGetName()

template<typename T >
const char * MemsetBench< T >::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 23 of file MemsetBench.cpp.

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

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