Flutter Engine
The Flutter Engine
Static Public Attributes | Protected Member Functions | List of all members
TableBench Class Reference
Inheritance diagram for TableBench:
Benchmark SkRefCnt SkRefCntBase

Static Public Attributes

static const int kNumRows = 48
 
static const int kNumCols = 32
 

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
}
 
- 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
 

Detailed Description

Definition at line 26 of file TableBench.cpp.

Member Function Documentation

◆ onDraw()

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

Implements Benchmark.

Definition at line 36 of file TableBench.cpp.

36 {
37 SkPaint cellPaint;
38 cellPaint.setColor(0xFFFFFFF);
39
40 SkPaint borderPaint;
41 borderPaint.setColor(0xFFCCCCCC);
42
43 for (int i = 0; i < loops; ++i) {
44 for (int row = 0; row < kNumRows; ++row) {
45 for (int col = 0; col < kNumCols; ++col) {
47 row * kCellHeight,
48 (col+1) * kCellWidth,
49 (row+1) * kCellHeight);
50 canvas->drawRect(cell, cellPaint);
51
52 SkRect bottom = SkRect::MakeLTRB(col * kCellWidth,
54 (col+1) * kCellWidth,
55 (row+1) * kCellHeight);
56 canvas->drawRect(bottom, borderPaint);
57
59 row * kCellHeight,
60 (col+1) * kCellWidth,
61 (row+1) * kCellHeight);
62 canvas->drawRect(right, borderPaint);
63 }
64 }
65 }
66 }
static bool right(const SkPoint &p0, const SkPoint &p1)
#define SK_Scalar1
Definition: SkScalar.h:18
static const SkScalar kCellHeight
Definition: TableBench.cpp:13
static const SkScalar kCellWidth
Definition: TableBench.cpp:12
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void setColor(SkColor color)
Definition: SkPaint.cpp:119
static const int kNumRows
Definition: TableBench.cpp:28
static const int kNumCols
Definition: TableBench.cpp:29
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

◆ onGetName()

const char * TableBench::onGetName ( )
inlineoverrideprotectedvirtual

Implements Benchmark.

Definition at line 32 of file TableBench.cpp.

32 {
33 return "tablebench";
34 }

Member Data Documentation

◆ kNumCols

const int TableBench::kNumCols = 32
static

Definition at line 29 of file TableBench.cpp.

◆ kNumRows

const int TableBench::kNumRows = 48
static

Definition at line 28 of file TableBench.cpp.


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