Flutter Engine
The Flutter Engine
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
PictureCentricBench Class Reference

#include <RecordingBench.h>

Inheritance diagram for PictureCentricBench:
Benchmark SkRefCnt SkRefCntBase RecordingBench

Public Member Functions

 PictureCentricBench (const char *name, const SkPicture *)
 
- 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 Types

using INHERITED = Benchmark
 

Protected Member Functions

const char * onGetName () override
 
bool isSuitableFor (Backend) override
 
SkISize onGetSize () 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 ()
 

Protected Attributes

sk_sp< const SkPicturefSrc
 
SkString fName
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 14 of file RecordingBench.h.

Member Typedef Documentation

◆ INHERITED

Definition at line 27 of file RecordingBench.h.

Constructor & Destructor Documentation

◆ PictureCentricBench()

PictureCentricBench::PictureCentricBench ( const char *  name,
const SkPicture pic 
)

Definition at line 14 of file RecordingBench.cpp.

14 : fName(name) {
15 // Flatten the source picture in case it's trivially nested (useless for timing).
17 pic->playback(rec.beginRecording(pic->cullRect(), nullptr /*,
18 SkPictureRecorder::kPlaybackDrawPicture_RecordFlag*/));
20}
sk_sp< const SkPicture > fSrc
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
virtual SkRect cullRect() const =0
virtual void playback(SkCanvas *canvas, AbortCallback *callback=nullptr) const =0
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

Member Function Documentation

◆ isSuitableFor()

bool PictureCentricBench::isSuitableFor ( Backend  backend)
overrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 26 of file RecordingBench.cpp.

26 {
28}
const char * backend

◆ onGetName()

const char * PictureCentricBench::onGetName ( )
overrideprotectedvirtual

Implements Benchmark.

Definition at line 22 of file RecordingBench.cpp.

22 {
23 return fName.c_str();
24}
const char * c_str() const
Definition: SkString.h:133

◆ onGetSize()

SkISize PictureCentricBench::onGetSize ( )
overrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 30 of file RecordingBench.cpp.

30 {
33}
#define SkScalarCeilToInt(x)
Definition: SkScalar.h:36
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20
constexpr float height() const
Definition: SkRect.h:769
constexpr float width() const
Definition: SkRect.h:762

Member Data Documentation

◆ fName

SkString PictureCentricBench::fName
protected

Definition at line 25 of file RecordingBench.h.

◆ fSrc

sk_sp<const SkPicture> PictureCentricBench::fSrc
protected

Definition at line 24 of file RecordingBench.h.


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