Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
PatchUtilsBench Class Reference
Inheritance diagram for PatchUtilsBench:
Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 PatchUtilsBench (bool linearInterp)
 
const char * onGetName () override
 
bool isSuitableFor (Backend backend) override
 
void onDraw (int loops, SkCanvas *) override
 
- Public Member Functions inherited from Benchmark
 Benchmark ()
 
const char * getName ()
 
const char * getUniqueName ()
 
SkISize getSize ()
 
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
 

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 * onGetUniqueName ()
 
virtual void onDelayedSetup ()
 
virtual void onPerCanvasPreDraw (SkCanvas *)
 
virtual void onPerCanvasPostDraw (SkCanvas *)
 
virtual void onPreDraw (SkCanvas *)
 
virtual void onPostDraw (SkCanvas *)
 
virtual SkISize onGetSize ()
 

Detailed Description

Definition at line 331 of file PatchBench.cpp.

Constructor & Destructor Documentation

◆ PatchUtilsBench()

PatchUtilsBench::PatchUtilsBench ( bool  linearInterp)
inline

Definition at line 335 of file PatchBench.cpp.

335 : fLinearInterp(linearInterp) {
336 fName.printf("patchutils_%s", linearInterp ? "linear" : "legacy");
337 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition SkString.cpp:534

Member Function Documentation

◆ isSuitableFor()

bool PatchUtilsBench::isSuitableFor ( Backend  backend)
inlineoverridevirtual

Reimplemented from Benchmark.

Definition at line 341 of file PatchBench.cpp.

341 {
343 }
const char * backend

◆ onDraw()

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

Implements Benchmark.

Definition at line 345 of file PatchBench.cpp.

345 {
346 const SkColor colors[] = { 0xFF000000, 0xFF00FF00, 0xFF0000FF, 0xFFFF0000 };
347 const SkPoint pts[] = {
348 { 0, 0 }, { 10, 0 }, { 20, 0 }, { 30, 0 },
349 { 30,10}, { 30,20 }, { 30,30 }, { 20,30 },
350 { 10,30}, { 0, 30 }, { 0, 20 }, { 0, 10 },
351 };
352 const SkPoint tex[] = {
353 { 0, 0 }, { 10, 0 }, { 10, 10 }, { 0, 10 },
354 };
355
356 auto cs = fLinearInterp ? SkColorSpace::MakeSRGBLinear() : nullptr;
357 for (int i = 0; i < 100*loops; ++i) {
358 SkPatchUtils::MakeVertices(pts, colors, tex, 20, 20, cs.get());
359 }
360 }
uint32_t SkColor
Definition SkColor.h:37
static sk_sp< SkColorSpace > MakeSRGBLinear()
static sk_sp< SkVertices > MakeVertices(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], int lodX, int lodY, SkColorSpace *colorSpace=nullptr)
PODArray< SkColor > colors
Definition SkRecords.h:276

◆ onGetName()

const char * PatchUtilsBench::onGetName ( )
inlineoverridevirtual

Implements Benchmark.

Definition at line 339 of file PatchBench.cpp.

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

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