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

Public Member Functions

 PointsBench (SkCanvas::PointMode mode, const char *name)
 
- Public Member Functions inherited from RectBench
 RectBench (int shift, int stroke=0, bool aa=true, bool perspective=false)
 
const char * computeName (const char root[])
 
- 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

SkCanvas::PointMode fMode
 
- Public Attributes inherited from RectBench
int fShift
 
int fStroke
 
SkRect fRects [N]
 
SkColor fColors [N]
 
bool fAA
 
bool fPerspective
 

Protected Member Functions

void onDraw (int loops, SkCanvas *canvas) override
 
const char * onGetName () override
 
- Protected Member Functions inherited from RectBench
virtual void drawThisRect (SkCanvas *c, const SkRect &r, const SkPaint &p)
 
const char * onGetName () override
 
void onDelayedSetup () override
 
void onDraw (int loops, SkCanvas *canvas) override
 
void setupPaint (SkPaint *paint) 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 RectBench
enum  { W = 640 , H = 480 , N = 300 }
 
- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 

Detailed Description

Definition at line 216 of file RectBench.cpp.

Constructor & Destructor Documentation

◆ PointsBench()

PointsBench::PointsBench ( SkCanvas::PointMode  mode,
const char *  name 
)
inline

Definition at line 220 of file RectBench.cpp.

221 : RectBench(2)
222 , fMode(mode) {
223 fName = name;
224 }
SkCanvas::PointMode fMode
Definition: RectBench.cpp:218
RectBench(int shift, int stroke=0, bool aa=true, bool perspective=false)
Definition: RectBench.cpp:33
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228

Member Function Documentation

◆ onDraw()

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

Reimplemented from RectBench.

Definition at line 227 of file RectBench.cpp.

227 {
228 SkScalar gSizes[] = {
229 SkIntToScalar(7), 0
230 };
231 size_t sizes = std::size(gSizes);
232
233 if (FLAGS_strokeWidth >= 0) {
234 gSizes[0] = (SkScalar)FLAGS_strokeWidth;
235 sizes = 1;
236 }
237
239 paint.setStrokeCap(SkPaint::kRound_Cap);
240
241 for (int loop = 0; loop < loops; loop++) {
242 for (size_t i = 0; i < sizes; i++) {
243 paint.setStrokeWidth(gSizes[i]);
244 this->setupPaint(&paint);
245 canvas->drawPoints(fMode, N * 2, reinterpret_cast<SkPoint*>(fRects), paint);
246 paint.setColor(fColors[i % N]);
247 }
248 }
249 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
SkColor fColors[N]
Definition: RectBench.cpp:29
SkRect fRects[N]
Definition: RectBench.cpp:28
void setupPaint(SkPaint *paint) override
Definition: RectBench.cpp:104
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
Definition: SkCanvas.cpp:1710
@ kRound_Cap
adds circle
Definition: SkPaint.h:335
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

◆ onGetName()

const char * PointsBench::onGetName ( )
inlineoverrideprotectedvirtual

Reimplemented from RectBench.

Definition at line 250 of file RectBench.cpp.

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

Member Data Documentation

◆ fMode

SkCanvas::PointMode PointsBench::fMode

Definition at line 218 of file RectBench.cpp.


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