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

Public Member Functions

 ImageFilterXfermodeIn ()
 
- 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 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 155 of file ImageFilterDAGBench.cpp.

Constructor & Destructor Documentation

◆ ImageFilterXfermodeIn()

ImageFilterXfermodeIn::ImageFilterXfermodeIn ( )
inline

Definition at line 157 of file ImageFilterDAGBench.cpp.

157{}

Member Function Documentation

◆ onDraw()

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

Implements Benchmark.

Definition at line 162 of file ImageFilterDAGBench.cpp.

162 {
163 // Allocate filters once to avoid measuring instantiation time
164 auto blur = SkImageFilters::Blur(20.0f, 20.0f, nullptr);
165 auto offset1 = SkImageFilters::Offset(100.0f, 100.0f, blur);
166 auto offset2 = SkImageFilters::Offset(-100.0f, -100.0f, blur);
167 auto xfermode =
168 SkImageFilters::Blend(SkBlendMode::kSrcIn, offset1, offset2, nullptr);
169
171 paint.setImageFilter(xfermode);
172
173 // Measure only the filter time
174 for (int j = 0; j < loops; j++) {
175 canvas->drawRect(SkRect::MakeWH(200.0f, 200.0f), paint);
176 }
177 }
@ kSrcIn
r = s * da
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blend(SkBlendMode mode, sk_sp< SkImageFilter > background, sk_sp< SkImageFilter > foreground=nullptr, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
const Paint & paint
Definition: color_source.cc:38
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

◆ onGetName()

const char * ImageFilterXfermodeIn::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 160 of file ImageFilterDAGBench.cpp.

160{ return "image_filter_xfermode_in"; }

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