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

Public Member Functions

 GetAlphafBench (SkColorType ct, const char label[])
 
- 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 onDelayedSetup () override
 
const char * onGetName () override
 
bool isSuitableFor (Backend backend) override
 
void onDraw (int loops, SkCanvas *) 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 104 of file ReadPixBench.cpp.

Constructor & Destructor Documentation

◆ GetAlphafBench()

GetAlphafBench::GetAlphafBench ( SkColorType  ct,
const char  label[] 
)
inline

Definition at line 108 of file ReadPixBench.cpp.

108 : fCT(ct) {
109 fName.printf("getalphaf_%s", label);
110 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534

Member Function Documentation

◆ isSuitableFor()

bool GetAlphafBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 122 of file ReadPixBench.cpp.

122 {
124 }
const char * backend

◆ onDelayedSetup()

void GetAlphafBench::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 113 of file ReadPixBench.cpp.

113 {
115 fBM.eraseColor(0x88112233);
116 }
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
void allocPixels(const SkImageInfo &info, size_t rowBytes)
Definition: SkBitmap.cpp:258
void eraseColor(SkColor4f) const
Definition: SkBitmap.cpp:442
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)

◆ onDraw()

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

Implements Benchmark.

Definition at line 126 of file ReadPixBench.cpp.

126 {
127 for (int i = 0; i < loops; ++i) {
128 for (int y = 0; y < fBM.height(); ++y) {
129 for (int x = 0; x < fBM.width(); ++x) {
130 fBM.getAlphaf(x, y);
131 }
132 }
133 }
134 }
int width() const
Definition: SkBitmap.h:149
float getAlphaf(int x, int y) const
Definition: SkBitmap.h:903
int height() const
Definition: SkBitmap.h:158
double y
double x

◆ onGetName()

const char * GetAlphafBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 118 of file ReadPixBench.cpp.

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

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