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

Public Member Functions

 BaseImageFilterCollapseBench ()
 
- 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 doPreDraw (sk_sp< SkColorFilter > colorFilters[], int nFilters)
 
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 23 of file ImageFilterCollapse.cpp.

Constructor & Destructor Documentation

◆ BaseImageFilterCollapseBench()

BaseImageFilterCollapseBench::BaseImageFilterCollapseBench ( )
inline

Definition at line 25 of file ImageFilterCollapse.cpp.

25{}

Member Function Documentation

◆ doPreDraw()

void BaseImageFilterCollapseBench::doPreDraw ( sk_sp< SkColorFilter colorFilters[],
int  nFilters 
)
inlineprotected

Definition at line 28 of file ImageFilterCollapse.cpp.

28 {
29 SkASSERT(!fImageFilter);
30
31 // Create a chain of ImageFilters from colorFilters
32 for(int i = nFilters; i --> 0;) {
33 fImageFilter = SkImageFilters::ColorFilter(colorFilters[i], fImageFilter);
34 }
35 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})

◆ onDraw()

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

Implements Benchmark.

Definition at line 37 of file ImageFilterCollapse.cpp.

37 {
38 makeBitmap();
39
40 for(int i = 0; i < loops; i++) {
42 paint.setImageFilter(fImageFilter);
43 canvas->drawImage(fImage, 0, 0, SkSamplingOptions(), &paint);
44 }
45 }
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
const Paint & paint
Definition: color_source.cc:38
SkSamplingOptions(SkFilterMode::kLinear))

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