Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
DeserializePictureBench Class Reference

#include <RecordingBench.h>

Inheritance diagram for DeserializePictureBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 DeserializePictureBench (const char *name, sk_sp< SkData > encodedPicture)
 
- 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
 
bool isSuitableFor (Backend) override
 
SkISize onGetSize () override
 
void onDraw (int loops, SkCanvas *) 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 43 of file RecordingBench.h.

Constructor & Destructor Documentation

◆ DeserializePictureBench()

DeserializePictureBench::DeserializePictureBench ( const char *  name,
sk_sp< SkData encodedPicture 
)

Definition at line 54 of file RecordingBench.cpp.

55 : fName(name)
56 , fEncodedPicture(std::move(data))
57{}
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

Member Function Documentation

◆ isSuitableFor()

bool DeserializePictureBench::isSuitableFor ( Backend  backend)
overrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 63 of file RecordingBench.cpp.

63 {
65}
const char * backend

◆ onDraw()

void DeserializePictureBench::onDraw ( int  loops,
SkCanvas  
)
overrideprotectedvirtual

Implements Benchmark.

Definition at line 71 of file RecordingBench.cpp.

71 {
72 for (int i = 0; i < loops; ++i) {
73 SkPicture::MakeFromData(fEncodedPicture.get());
74 }
75}
static sk_sp< SkPicture > MakeFromData(const SkData *data, const SkDeserialProcs *procs=nullptr)
Definition: SkPicture.cpp:160
T * get() const
Definition: SkRefCnt.h:303

◆ onGetName()

const char * DeserializePictureBench::onGetName ( )
overrideprotectedvirtual

Implements Benchmark.

Definition at line 59 of file RecordingBench.cpp.

59 {
60 return fName.c_str();
61}
const char * c_str() const
Definition: SkString.h:133

◆ onGetSize()

SkISize DeserializePictureBench::onGetSize ( )
overrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 67 of file RecordingBench.cpp.

67 {
68 return SkISize::Make(128, 128);
69}
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

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