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

Public Member Functions

 MergeBench (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 onDelayedSetup () 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 54 of file MergeBench.cpp.

Constructor & Destructor Documentation

◆ MergeBench()

MergeBench::MergeBench ( bool  small)
inline

Definition at line 56 of file MergeBench.cpp.

56: fIsSmall(small), fInitialized(false) { }

Member Function Documentation

◆ onDelayedSetup()

void MergeBench::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 63 of file MergeBench.cpp.

63 {
64 if (!fInitialized) {
65 fImage = make_bitmap();
66 fCheckerboard = make_checkerboard();
67 fInitialized = true;
68 }
69 }
static sk_sp< SkImage > make_checkerboard()
Definition: MergeBench.cpp:31
static sk_sp< SkImage > make_bitmap()
Definition: MergeBench.cpp:20

◆ onDraw()

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

Implements Benchmark.

Definition at line 71 of file MergeBench.cpp.

71 {
75 paint.setImageFilter(SkImageFilters::Merge(
78 for (int i = 0; i < loops; i++) {
79 canvas->drawRect(r, paint);
80 }
81 }
#define FILTER_WIDTH_SMALL
Definition: MergeBench.cpp:15
#define FILTER_WIDTH_LARGE
Definition: MergeBench.cpp:17
#define FILTER_HEIGHT_SMALL
Definition: MergeBench.cpp:16
#define FILTER_HEIGHT_LARGE
Definition: MergeBench.cpp:18
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
static sk_sp< SkImageFilter > Merge(sk_sp< SkImageFilter > *const filters, int count, 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
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

◆ onGetName()

const char * MergeBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 59 of file MergeBench.cpp.

59 {
60 return fIsSmall ? "merge_small" : "merge_large";
61 }

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