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

Public Member Functions

 PictureNestingRecording (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

bool isSuitableFor (Backend backend) override
 
void onDraw (int loops, SkCanvas *) 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 108 of file PictureNestingBench.cpp.

Constructor & Destructor Documentation

◆ PictureNestingRecording()

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

Definition at line 110 of file PictureNestingBench.cpp.

111 : INHERITED("recording", maxLevel, maxPictureLevel) {
112 }

Member Function Documentation

◆ isSuitableFor()

bool PictureNestingRecording::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 115 of file PictureNestingBench.cpp.

115 {
117 }
const char * backend

◆ onDraw()

void PictureNestingRecording::onDraw ( int  loops,
SkCanvas  
)
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 119 of file PictureNestingBench.cpp.

119 {
120 SkISize canvasSize = onGetSize();
121 SkPictureRecorder recorder;
122
123 for (int i = 0; i < loops; i++) {
124 SkCanvas* c = recorder.beginRecording(SkIntToScalar(canvasSize.width()),
125 SkIntToScalar(canvasSize.height()));
126 this->doDraw(c);
127 (void)recorder.finishRecordingAsPicture();
128 }
129 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
virtual SkISize onGetSize()
Definition: Benchmark.cpp:59
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

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