Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
NotchPolyUtilsBench Class Reference
Inheritance diagram for NotchPolyUtilsBench:
PolyUtilsBench Benchmark SkRefCnt SkRefCntBase

Public Member Functions

 NotchPolyUtilsBench (PolyUtilsBench::Type type)
 
void appendName (SkString *name) override
 
void makePoly (SkTDArray< SkPoint > *poly) override
 
- Public Member Functions inherited from PolyUtilsBench
 PolyUtilsBench (Type type)
 
virtual void appendName (SkString *)=0
 
virtual void makePoly (SkTDArray< SkPoint > *poly)=0
 
virtual int complexity ()
 
- 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
 

Additional Inherited Members

- Public Types inherited from PolyUtilsBench
enum class  Type {
  kConvexCheck , kSimpleCheck , kInsetConvex , kOffsetSimple ,
  kTessellateSimple
}
 
- Public Types inherited from Benchmark
enum class  Backend {
  kNonRendering , kRaster , kGanesh , kGraphite ,
  kPDF , kHWUI
}
 
- Protected Member Functions inherited from PolyUtilsBench
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 ()
 

Detailed Description

Definition at line 189 of file PolyUtilsBench.cpp.

Constructor & Destructor Documentation

◆ NotchPolyUtilsBench()

NotchPolyUtilsBench::NotchPolyUtilsBench ( PolyUtilsBench::Type  type)
inline

Definition at line 191 of file PolyUtilsBench.cpp.

191: INHERITED(type) {}
GLenum type

Member Function Documentation

◆ appendName()

void NotchPolyUtilsBench::appendName ( SkString name)
inlineoverridevirtual

Implements PolyUtilsBench.

Definition at line 193 of file PolyUtilsBench.cpp.

193 {
194 name->append("notch");
195 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ makePoly()

void NotchPolyUtilsBench::makePoly ( SkTDArray< SkPoint > *  poly)
inlineoverridevirtual

Implements PolyUtilsBench.

Definition at line 196 of file PolyUtilsBench.cpp.

196 {
197 // create 3/4 circle with many vertices
198 const SkScalar c = SkIntToScalar(45);
199 const SkScalar r = SkIntToScalar(20);
200 const int n = 1000;
201 SkScalar rad = 0;
202 const SkScalar drad = 3 * SK_ScalarPI / (2*n);
203 for (int i = 0; i < n; i++) {
204 *poly->append() = SkPoint::Make(c + SkScalarCos(rad) * r, c + SkScalarSin(rad) * r);
205 rad += drad;
206 }
207 // and the mouth
208 *poly->append() = SkPoint::Make(45, 45);
209 }
#define SkScalarSin(radians)
Definition: SkScalar.h:45
#define SkIntToScalar(x)
Definition: SkScalar.h:57
#define SkScalarCos(radians)
Definition: SkScalar.h:46
#define SK_ScalarPI
Definition: SkScalar.h:21
T * append()
Definition: SkTDArray.h:191
float SkScalar
Definition: extension.cpp:12
static constexpr SkPoint Make(float x, float y)
Definition: SkPoint_impl.h:173

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