Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
PathBench Class Referenceabstract
Inheritance diagram for PathBench:
Benchmark SkRefCnt SkRefCntBase AAAConcavePathBench AAAConvexPathBench CirclePathBench LongCurvedPathBench LongLinePathBench OvalPathBench RectPathBench RotatedRectBench SawToothPathBench TrianglePathBench

Public Member Functions

 PathBench (Flags flags)
 
virtual void appendName (SkString *)=0
 
virtual void makePath (SkPath *)=0
 
virtual int complexity ()
 
- 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
 
void onDraw (int loops, SkCanvas *canvas) 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 37 of file PathBench.cpp.

Constructor & Destructor Documentation

◆ PathBench()

PathBench::PathBench ( Flags  flags)
inline

Definition at line 42 of file PathBench.cpp.

42 : fFlags(flags) {
47 }
@ kStroke_Flag
Definition: PathBench.cpp:28
#define SkIntToScalar(x)
Definition: SkScalar.h:57
void setStyle(Style style)
Definition: SkPaint.cpp:105
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
void setStrokeJoin(Join join)
Definition: SkPaint.cpp:189
@ kBevel_Join
connects outside edges
Definition: SkPaint.h:361
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
FlutterSemanticsFlag flags

Member Function Documentation

◆ appendName()

virtual void PathBench::appendName ( SkString )
pure virtual

◆ complexity()

virtual int PathBench::complexity ( )
inlinevirtual

Reimplemented in SawToothPathBench, LongCurvedPathBench, and LongLinePathBench.

Definition at line 51 of file PathBench.cpp.

51{ return 0; }

◆ makePath()

virtual void PathBench::makePath ( SkPath )
pure virtual

◆ onDraw()

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

Implements Benchmark.

Definition at line 62 of file PathBench.cpp.

62 {
63 SkPaint paint(fPaint);
64 this->setupPaint(&paint);
65
67 this->makePath(&path);
68 if (fFlags & kBig_Flag) {
69 const SkMatrix m = SkMatrix::Scale(10, 10);
70 path.transform(m);
71 }
72
73 for (int i = 0; i < loops; i++) {
74 canvas->drawPath(path, paint);
75 }
76 }
virtual void setupPaint(SkPaint *paint)
Definition: Benchmark.cpp:55
virtual void makePath(SkPath *)=0
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
static SkMatrix Scale(SkScalar sx, SkScalar sy)
Definition: SkMatrix.h:75
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ onGetName()

const char * PathBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 54 of file PathBench.cpp.

54 {
55 fName.printf("path_%s_%s_",
56 fFlags & kStroke_Flag ? "stroke" : "fill",
57 fFlags & kBig_Flag ? "big" : "small");
58 this->appendName(&fName);
59 return fName.c_str();
60 }
virtual void appendName(SkString *)=0
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534
const char * c_str() const
Definition: SkString.h:133

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