Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
BlurRectBench Class Referenceabstract
Inheritance diagram for BlurRectBench:
Benchmark SkRefCnt SkRefCntBase BlurRectDirectBench BlurRectSeparableBench BlurRectBoxFilterBench BlurRectGaussianBench

Public Member Functions

 BlurRectBench (SkScalar rad)
 
- 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

const char * onGetName () override
 
SkScalar radius () const
 
void setName (const SkString &name)
 
void onDraw (int loops, SkCanvas *) override
 
virtual void makeBlurryRect (const SkRect &)=0
 
virtual void preBenchSetup (const SkRect &)
 
- 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 24 of file BlurRectBench.cpp.

Constructor & Destructor Documentation

◆ BlurRectBench()

BlurRectBench::BlurRectBench ( SkScalar  rad)
inline

Definition at line 30 of file BlurRectBench.cpp.

30 {
31 fRadius = rad;
32
33 if (fRadius > SkIntToScalar(25)) {
34 fLoopCount = 100;
35 } else if (fRadius > SkIntToScalar(5)) {
36 fLoopCount = 1000;
37 } else {
38 fLoopCount = 10000;
39 }
40 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57

Member Function Documentation

◆ makeBlurryRect()

virtual void BlurRectBench::makeBlurryRect ( const SkRect )
protectedpure virtual

◆ onDraw()

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

Implements Benchmark.

Definition at line 55 of file BlurRectBench.cpp.

55 {
57 this->setupPaint(&paint);
58
59 paint.setAntiAlias(true);
60
61 SkScalar pad = fRadius*3/2 + SK_Scalar1;
62 SkRect r = SkRect::MakeWH(2 * pad + SK_Scalar1, 2 * pad + SK_Scalar1);
63
65
66 for (int i = 0; i < loops; i++) {
67 this->makeBlurryRect(r);
68 }
69 }
#define SK_Scalar1
Definition: SkScalar.h:18
virtual void setupPaint(SkPaint *paint)
Definition: Benchmark.cpp:55
virtual void makeBlurryRect(const SkRect &)=0
virtual void preBenchSetup(const SkRect &)
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

◆ onGetName()

const char * BlurRectBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 43 of file BlurRectBench.cpp.

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

◆ preBenchSetup()

virtual void BlurRectBench::preBenchSetup ( const SkRect )
inlineprotectedvirtual

Reimplemented in BlurRectSeparableBench.

Definition at line 72 of file BlurRectBench.cpp.

72{}

◆ radius()

SkScalar BlurRectBench::radius ( ) const
inlineprotected

Definition at line 47 of file BlurRectBench.cpp.

47 {
48 return fRadius;
49 }

◆ setName()

void BlurRectBench::setName ( const SkString name)
inlineprotected

Definition at line 51 of file BlurRectBench.cpp.

51 {
52 fName = name;
53 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

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