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

Public Member Functions

 SwizzleBench (const char *name, SkOpts::Swizzle_8888_u32 fn)
 
 SwizzleBench (const char *name, SkOpts::Swizzle_8888_u8 fn)
 
bool isSuitableFor (Backend backend) override
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) override
 
- 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

Definition at line 12 of file SwizzleBench.cpp.

Constructor & Destructor Documentation

◆ SwizzleBench() [1/2]

SwizzleBench::SwizzleBench ( const char *  name,
SkOpts::Swizzle_8888_u32  fn 
)
inline

Definition at line 15 of file SwizzleBench.cpp.

15: fName(name), fFn_u32(fn) {}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ SwizzleBench() [2/2]

SwizzleBench::SwizzleBench ( const char *  name,
SkOpts::Swizzle_8888_u8  fn 
)
inline

Definition at line 16 of file SwizzleBench.cpp.

16: fName(name), fFn_u8 (fn) {}

Member Function Documentation

◆ isSuitableFor()

bool SwizzleBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 18 of file SwizzleBench.cpp.

const char * backend

◆ onDraw()

void SwizzleBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverridevirtual

Implements Benchmark.

Definition at line 20 of file SwizzleBench.cpp.

20 {
21 static const int K = 1023; // Arbitrary, but nice to be a non-power-of-two to trip up SIMD.
22 uint32_t dst[K], src[K];
23 while (loops --> 0) {
24 if (fFn_u32) { fFn_u32(dst, src, K); }
25 if (fFn_u8) { fFn_u8 (dst, (const uint8_t*)src, K); }
26 }
27 }
static const int K
Definition: daa.cpp:21
dst
Definition: cp.py:12

◆ onGetName()

const char * SwizzleBench::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 19 of file SwizzleBench.cpp.

19{ return fName; }

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