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

Public Member Functions

 DisplacementZeroBench (bool small)
 
- Public Member Functions inherited from DisplacementBaseBench
 DisplacementBaseBench (bool small)
 
- 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
 
void onDraw (int loops, SkCanvas *canvas) override
 
- Protected Member Functions inherited from DisplacementBaseBench
void onDelayedSetup () override
 
void makeBitmap ()
 
void makeCheckerboard ()
 
void drawClippedBitmap (SkCanvas *canvas, int x, int y, const SkPaint &paint)
 
bool isSmall () const
 
- 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
}
 
- Protected Attributes inherited from DisplacementBaseBench
sk_sp< SkImagefImage
 
sk_sp< SkImagefCheckerboard
 

Detailed Description

Definition at line 89 of file DisplacementBench.cpp.

Constructor & Destructor Documentation

◆ DisplacementZeroBench()

DisplacementZeroBench::DisplacementZeroBench ( bool  small)
inline

Definition at line 91 of file DisplacementBench.cpp.

91: INHERITED(small) { }

Member Function Documentation

◆ onDraw()

void DisplacementZeroBench::onDraw ( int  loops,
SkCanvas canvas 
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 98 of file DisplacementBench.cpp.

98 {
101 // No displacement effect
103 0.0f, std::move(displ), nullptr));
104
105 for (int i = 0; i < loops; i++) {
106 this->drawClippedBitmap(canvas, 0, 0, paint);
107 }
108 }
sk_sp< SkImage > fCheckerboard
void drawClippedBitmap(SkCanvas *canvas, int x, int y, const SkPaint &paint)
static sk_sp< SkImageFilter > DisplacementMap(SkColorChannel xChannelSelector, SkColorChannel yChannelSelector, SkScalar scale, sk_sp< SkImageFilter > displacement, sk_sp< SkImageFilter > color, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
const Paint & paint
Definition: color_source.cc:38

◆ onGetName()

const char * DisplacementZeroBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 94 of file DisplacementBench.cpp.

94 {
95 return this->isSmall() ? "displacement_zero_small" : "displacement_zero_large";
96 }

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