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

Public Member Functions

 IntersectingPolyUtilsBench (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 163 of file PolyUtilsBench.cpp.

Constructor & Destructor Documentation

◆ IntersectingPolyUtilsBench()

IntersectingPolyUtilsBench::IntersectingPolyUtilsBench ( PolyUtilsBench::Type  type)
inline

Definition at line 165 of file PolyUtilsBench.cpp.

165: INHERITED(type) {}
GLenum type

Member Function Documentation

◆ appendName()

void IntersectingPolyUtilsBench::appendName ( SkString name)
inlineoverridevirtual

Implements PolyUtilsBench.

Definition at line 167 of file PolyUtilsBench.cpp.

167 {
168 name->append("intersecting");
169 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ makePoly()

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

Implements PolyUtilsBench.

Definition at line 170 of file PolyUtilsBench.cpp.

170 {
171 // create self-intersecting star
172 const SkScalar c = SkIntToScalar(45);
173 const SkScalar r = SkIntToScalar(20);
174 const int n = 1000;
175
176 SkScalar rad = -SK_ScalarPI / 2;
177 const SkScalar drad = (n >> 1) * SK_ScalarPI * 2 / n;
178 *poly->append() = SkPoint::Make(c, c - r);
179 for (int i = 1; i < n; i++) {
180 rad += drad;
181 *poly->append() = SkPoint::Make(c + SkScalarCos(rad) * r, c + SkScalarSin(rad) * r);
182 }
183 }
#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: