Flutter Engine
The Flutter Engine
Functions
crbug_1086705.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (crbug_1086705, canvas, 200, 200)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( crbug_1086705  ,
canvas  ,
200  ,
200   
)

Definition at line 17 of file crbug_1086705.cpp.

17 {
20 paint.setStrokeWidth(5.f);
21 paint.setAntiAlias(true);
22
23 SkPoint circleVertices[700];
24 for (int i = 0; i < 700; ++i) {
25 SkScalar angleRads = 2 * SK_ScalarPI * i / 700.f;
26 circleVertices[i] = {100.f + 2.f * SkScalarCos(angleRads),
27 100.f + 2.f * SkScalarSin(angleRads)};
28 }
29
30 SkPathBuilder circle;
31 circle.moveTo(circleVertices[0]);
32 for (int i = 1; i < 700; ++i) {
33 circle.lineTo(circleVertices[i]);
34 }
35 circle.close();
36
37 canvas->drawPath(circle.detach(), paint);
38}
#define SkScalarSin(radians)
Definition: SkScalar.h:45
#define SkScalarCos(radians)
Definition: SkScalar.h:46
#define SK_ScalarPI
Definition: SkScalar.h:21
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
SkPathBuilder & close()
SkPathBuilder & lineTo(SkPoint pt)
SkPathBuilder & moveTo(SkPoint pt)
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12