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

Protected Member Functions

const char * onGetName () override
 
bool isSuitableFor (Backend backend) override
 
void onPerCanvasPreDraw (SkCanvas *) override
 
void onPerCanvasPostDraw (SkCanvas *) 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
}
 
- 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
 

Detailed Description

Definition at line 19 of file JSONBench.cpp.

Member Function Documentation

◆ isSuitableFor()

bool JsonBench::isSuitableFor ( Backend  backend)
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 25 of file JSONBench.cpp.

const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 38 of file JSONBench.cpp.

38 {
39 if (!fData) return;
40
41 for (int i = 0; i < loops; i++) {
42 skjson::DOM dom(static_cast<const char*>(fData->data()), fData->size());
43 if (dom.root().is<skjson::NullValue>()) {
44 SkDebugf("!! Parsing failed.\n");
45 return;
46 }
47 }
48 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
const void * data() const
Definition: SkData.h:37
size_t size() const
Definition: SkData.h:30
Definition: dom.py:1

◆ onGetName()

const char * JsonBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 23 of file JSONBench.cpp.

23{ return "json_skjson"; }

◆ onPerCanvasPostDraw()

void JsonBench::onPerCanvasPostDraw ( SkCanvas )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 34 of file JSONBench.cpp.

34 {
35 fData = nullptr;
36 }

◆ onPerCanvasPreDraw()

void JsonBench::onPerCanvasPreDraw ( SkCanvas )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 27 of file JSONBench.cpp.

27 {
29 if (!fData) {
30 SkDebugf("!! Could not open bench file: %s\n", kBenchFile);
31 }
32 }
static constexpr const char * kBenchFile
Definition: JSONBench.cpp:16
static sk_sp< SkData > MakeFromFileName(const char path[])
Definition: SkData.cpp:148

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