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

Public Member Functions

 PictureNestingPlayback (int maxLevel, int maxPictureLevel)
 
- Public Member Functions inherited from PictureNesting
 PictureNesting (const char *name, int maxLevel, int maxPictureLevel)
 
- 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 onDelayedSetup () override
 
void onDraw (int loops, SkCanvas *canvas) override
 
- Protected Member Functions inherited from PictureNesting
const char * onGetName () override
 
void doDraw (SkCanvas *canvas)
 
int sierpinsky (SkCanvas *canvas, int lvl, const SkPaint &paint)
 
- 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 PictureNesting
int fMaxLevel
 
int fMaxPictureLevel
 

Detailed Description

Definition at line 135 of file PictureNestingBench.cpp.

Constructor & Destructor Documentation

◆ PictureNestingPlayback()

PictureNestingPlayback::PictureNestingPlayback ( int  maxLevel,
int  maxPictureLevel 
)
inline

Definition at line 137 of file PictureNestingBench.cpp.

138 : INHERITED("playback", maxLevel, maxPictureLevel) {
139 }

Member Function Documentation

◆ onDelayedSetup()

void PictureNestingPlayback::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 141 of file PictureNestingBench.cpp.

141 {
143
144 SkISize canvasSize = onGetSize();
145 SkPictureRecorder recorder;
146 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.width()),
147 SkIntToScalar(canvasSize.height()));
148
149 this->doDraw(c);
150 fPicture = recorder.finishRecordingAsPicture();
151 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
virtual SkISize onGetSize()
Definition: Benchmark.cpp:59
virtual void onDelayedSetup()
Definition: Benchmark.h:101
void doDraw(SkCanvas *canvas)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
Definition: SkSize.h:16
constexpr int32_t width() const
Definition: SkSize.h:36
constexpr int32_t height() const
Definition: SkSize.h:37

◆ onDraw()

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

Implements Benchmark.

Definition at line 153 of file PictureNestingBench.cpp.

153 {
154 for (int i = 0; i < loops; i++) {
155 canvas->drawPicture(fPicture);
156 }
157 }
void drawPicture(const SkPicture *picture)
Definition: SkCanvas.h:1961

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