Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
PDFScalarBench Struct Reference
Inheritance diagram for PDFScalarBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 PDFScalarBench (const char *n, float(*f)(SkRandom *))
 
bool isSuitableFor (Backend b) override
 
const char * onGetName () override
 
void onDraw (int loops, SkCanvas *) override
 
- 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
 

Public Attributes

const char * fName
 
float(* fNextFloat )(SkRandom *)
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 
- 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 ()
 

Detailed Description

Definition at line 49 of file PDFBench.cpp.

Constructor & Destructor Documentation

◆ PDFScalarBench()

PDFScalarBench::PDFScalarBench ( const char *  n,
float(*)(SkRandom *)  f 
)
inline

Definition at line 50 of file PDFBench.cpp.

50: fName(n), fNextFloat(f) {}
float(* fNextFloat)(SkRandom *)
Definition: PDFBench.cpp:52
const char * fName
Definition: PDFBench.cpp:51

Member Function Documentation

◆ isSuitableFor()

bool PDFScalarBench::isSuitableFor ( Backend  b)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 53 of file PDFBench.cpp.

53 {
54 return b == Backend::kNonRendering;
55 }
static bool b

◆ onDraw()

void PDFScalarBench::onDraw ( int  loops,
SkCanvas  
)
inlineoverridevirtual

Implements Benchmark.

Definition at line 57 of file PDFBench.cpp.

57 {
58 SkRandom random;
60 while (loops-- > 0) {
61 auto f = fNextFloat(&random);
62 (void)SkFloatToDecimal(f, dst);
63 }
64 }
unsigned SkFloatToDecimal(float value, char output[kMaximumSkFloatToDecimalLength])
constexpr unsigned kMaximumSkFloatToDecimalLength
dst
Definition: cp.py:12

◆ onGetName()

const char * PDFScalarBench::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 56 of file PDFBench.cpp.

56{ return fName; }

Member Data Documentation

◆ fName

const char* PDFScalarBench::fName

Definition at line 51 of file PDFBench.cpp.

◆ fNextFloat

float(* PDFScalarBench::fNextFloat) (SkRandom *)

Definition at line 52 of file PDFBench.cpp.


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