Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
HairlinePathBench Class Referenceabstract
Inheritance diagram for HairlinePathBench:
Benchmark SkRefCnt SkRefCntBase ConicPathBench CubicPathBench LinePathBench QuadPathBench

Public Member Functions

 HairlinePathBench (Flags flags)
 
virtual void appendName (SkString *)=0
 
virtual void makePath (SkPath *)=0
 
- 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 35 of file HairlinePathBench.cpp.

Constructor & Destructor Documentation

◆ HairlinePathBench()

HairlinePathBench::HairlinePathBench ( Flags  flags)
inline

Definition at line 37 of file HairlinePathBench.cpp.

37 : fFlags(flags) {
40 }
#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
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
FlutterSemanticsFlag flags

Member Function Documentation

◆ appendName()

virtual void HairlinePathBench::appendName ( SkString )
pure virtual

◆ makePath()

virtual void HairlinePathBench::makePath ( SkPath )
pure virtual

◆ onDraw()

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

Implements Benchmark.

Definition at line 54 of file HairlinePathBench.cpp.

54 {
55 SkPaint paint(fPaint);
56 this->setupPaint(&paint);
57
58 paint.setAntiAlias(fFlags & kAA_Flag ? true : false);
59
61 this->makePath(&path);
62 if (fFlags & kBig_Flag) {
63 const SkMatrix m = SkMatrix::Scale(3, 3);
64 path.transform(m);
65 }
66
67 for (int i = 0; i < loops; i++) {
68 for (int j = 0; j < 100; ++j) {
69 canvas->drawPath(path, paint);
70 }
71 }
72 }
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 * HairlinePathBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 46 of file HairlinePathBench.cpp.

46 {
47 fName.printf("path_hairline_%s_%s_",
48 fFlags & kBig_Flag ? "big" : "small",
49 fFlags & kAA_Flag ? "AA" : "noAA");
50 this->appendName(&fName);
51 return fName.c_str();
52 }
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: