Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
skgpu::ganesh::PathTessellateBenchmark Class Referenceabstract
Inheritance diagram for skgpu::ganesh::PathTessellateBenchmark:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 PathTessellateBenchmark (const char *subName, const SkPath &p, const SkMatrix &m)
 
const char * onGetName () override
 
bool isSuitableFor (Backend backend) final
 
- 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

void onDelayedSetup () override
 
void onDraw (int loops, SkCanvas *) final
 
virtual void runBench ()=0
 
- 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 ()
 

Protected Attributes

SkString fName
 
std::unique_ptr< GrMockOpTargetfTarget
 
const SkPath fPath
 
const SkMatrix fMatrix
 

Additional Inherited Members

- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 89 of file TessellateBench.cpp.

Constructor & Destructor Documentation

◆ PathTessellateBenchmark()

skgpu::ganesh::PathTessellateBenchmark::PathTessellateBenchmark ( const char *  subName,
const SkPath p,
const SkMatrix m 
)
inline

Definition at line 91 of file TessellateBench.cpp.

Member Function Documentation

◆ isSuitableFor()

bool skgpu::ganesh::PathTessellateBenchmark::isSuitableFor ( Backend  backend)
inlinefinalvirtual

Reimplemented from Benchmark.

Definition at line 97 of file TessellateBench.cpp.

const char * backend

◆ onDelayedSetup()

void skgpu::ganesh::PathTessellateBenchmark::onDelayedSetup ( )
inlineoverrideprotectedvirtual

Reimplemented from Benchmark.

Definition at line 100 of file TessellateBench.cpp.

100 {
101 fTarget = std::make_unique<GrMockOpTarget>(make_mock_context());
102 }
std::unique_ptr< GrMockOpTarget > fTarget
static sk_sp< GrDirectContext > make_mock_context()

◆ onDraw()

void skgpu::ganesh::PathTessellateBenchmark::onDraw ( int  loops,
SkCanvas  
)
inlinefinalprotectedvirtual

Implements Benchmark.

Definition at line 104 of file TessellateBench.cpp.

104 {
105 if (!fTarget->mockContext()) {
106 SkDebugf("ERROR: could not create mock context.");
107 return;
108 }
109 for (int i = 0; i < loops; ++i) {
110 this->runBench();
111 fTarget->resetAllocator();
112 }
113 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1

◆ onGetName()

const char * skgpu::ganesh::PathTessellateBenchmark::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 96 of file TessellateBench.cpp.

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

◆ runBench()

virtual void skgpu::ganesh::PathTessellateBenchmark::runBench ( )
protectedpure virtual

Member Data Documentation

◆ fMatrix

const SkMatrix skgpu::ganesh::PathTessellateBenchmark::fMatrix
protected

Definition at line 120 of file TessellateBench.cpp.

◆ fName

SkString skgpu::ganesh::PathTessellateBenchmark::fName
protected

Definition at line 117 of file TessellateBench.cpp.

◆ fPath

const SkPath skgpu::ganesh::PathTessellateBenchmark::fPath
protected

Definition at line 119 of file TessellateBench.cpp.

◆ fTarget

std::unique_ptr<GrMockOpTarget> skgpu::ganesh::PathTessellateBenchmark::fTarget
protected

Definition at line 118 of file TessellateBench.cpp.


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