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

Public Member Functions

 IceCreamPolyUtilsBench (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 214 of file PolyUtilsBench.cpp.

Constructor & Destructor Documentation

◆ IceCreamPolyUtilsBench()

IceCreamPolyUtilsBench::IceCreamPolyUtilsBench ( PolyUtilsBench::Type  type)
inline

Definition at line 216 of file PolyUtilsBench.cpp.

216: INHERITED(type) {}
GLenum type

Member Function Documentation

◆ appendName()

void IceCreamPolyUtilsBench::appendName ( SkString name)
inlineoverridevirtual

Implements PolyUtilsBench.

Definition at line 218 of file PolyUtilsBench.cpp.

218 {
219 name->append("icecream");
220 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ makePoly()

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

Implements PolyUtilsBench.

Definition at line 221 of file PolyUtilsBench.cpp.

221 {
222 // create 3/4 circle with many vertices
223 const SkScalar c = SkIntToScalar(45);
224 const SkScalar r = SkIntToScalar(20);
225 const int n = 1000;
226 SkScalar rad = 0;
227 const SkScalar drad = 3 * SK_ScalarPI / (2*n);
228 for (int i = 0; i < n; i++) {
229 *poly->append() = SkPoint::Make(c + SkScalarCos(rad) * r, c + SkScalarSin(rad) * r);
230 rad += drad;
231 }
232 // and the tip of the cone
233 *poly->append() = SkPoint::Make(90, 0);
234 }
#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: