Flutter Engine
The Flutter Engine
|
Public Types | |
enum | { NX = 5 , NY = 5 , NUM_DRAWS = NX * NY } |
Public Types inherited from Benchmark | |
enum class | Backend { kNonRendering , kRaster , kGanesh , kGraphite , kPDF , kHWUI } |
Public Member Functions | |
AlternatingColorPatternBench (ColorPattern pattern1, ColorPattern pattern2, DrawType drawType) | |
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 | |
sk_sp< SkShader > | fBmShader |
SkPath | fPaths [NUM_DRAWS] |
SkRect | fRects [NUM_DRAWS] |
SkColor | fColors [NUM_DRAWS] |
sk_sp< SkShader > | fShaders [NUM_DRAWS] |
SkString | fName |
ColorPatternData | fPattern1 |
ColorPatternData | fPattern2 |
DrawType | fDrawType |
SkBitmap | fBmp |
Protected Member Functions | |
const char * | onGetName () override |
void | onDelayedSetup () 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 () |
This bench draws a grid of either rects or filled paths, with two alternating color patterns. This color patterns are passed in as enums to the class. The options are: 1) solid white color 2) solid blue color 3) opaque bitmap 4) partial alpha bitmap The same color pattern can be set for both arguments to create a uniform pattern on all draws.
The bench is used to test a few things. First it can test any optimizations made for a specific color pattern (for example drawing an opaque bitmap versus one with partial alpha). Also it can be used to test the cost of program switching and/or GrDrawOp combining when alternating between different patterns when on the gpu.
Definition at line 77 of file AlternatingColorPatternBench.cpp.
anonymous enum |
Enumerator | |
---|---|
NX | |
NY | |
NUM_DRAWS |
Definition at line 79 of file AlternatingColorPatternBench.cpp.
|
inline |
Definition at line 98 of file AlternatingColorPatternBench.cpp.
|
inlineoverrideprotectedvirtual |
Reimplemented from Benchmark.
Definition at line 112 of file AlternatingColorPatternBench.cpp.
|
inlineoverrideprotectedvirtual |
Implements Benchmark.
Definition at line 145 of file AlternatingColorPatternBench.cpp.
|
inlineoverrideprotectedvirtual |
SkBitmap AlternatingColorPatternBench::fBmp |
Definition at line 95 of file AlternatingColorPatternBench.cpp.
Definition at line 84 of file AlternatingColorPatternBench.cpp.
Definition at line 88 of file AlternatingColorPatternBench.cpp.
DrawType AlternatingColorPatternBench::fDrawType |
Definition at line 94 of file AlternatingColorPatternBench.cpp.
SkString AlternatingColorPatternBench::fName |
Definition at line 91 of file AlternatingColorPatternBench.cpp.
Definition at line 86 of file AlternatingColorPatternBench.cpp.
ColorPatternData AlternatingColorPatternBench::fPattern1 |
Definition at line 92 of file AlternatingColorPatternBench.cpp.
ColorPatternData AlternatingColorPatternBench::fPattern2 |
Definition at line 93 of file AlternatingColorPatternBench.cpp.
Definition at line 87 of file AlternatingColorPatternBench.cpp.
Definition at line 89 of file AlternatingColorPatternBench.cpp.