Flutter Engine
The Flutter Engine
Classes | Functions
conicpaths.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRect.h"
#include "include/core/SkScalar.h"
#include "include/core/SkSize.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/private/base/SkTArray.h"
#include "src/base/SkFloatBits.h"

Go to the source code of this file.

Classes

class  ConicPathsGM
 

Functions

 DEF_SIMPLE_GM (arccirclegap, canvas, 250, 250)
 
 DEF_SIMPLE_GM (largecircle, canvas, 250, 250)
 
 DEF_SIMPLE_GM (largeovals, canvas, 250, 250)
 
 DEF_SIMPLE_GM (crbug_640176, canvas, 250, 250)
 

Function Documentation

◆ DEF_SIMPLE_GM() [1/4]

DEF_SIMPLE_GM ( arccirclegap  ,
canvas  ,
250  ,
250   
)

Definition at line 148 of file conicpaths.cpp.

148 {
149 canvas->translate(50, 100);
150 SkPoint c = { 1052.5390625f, 506.8760978034711f };
151 SkScalar radius = 1096.702150363923f;
153 paint.setAntiAlias(true);
154 paint.setStroke(true);
155 canvas->drawCircle(c, radius, paint);
156 SkPath path = SkPathBuilder().moveTo(288.88884710654133f, -280.26680862609f)
157 .arcTo({0, 0}, {-39.00216443306411f, 400.6058925796476f}, radius)
158 .detach();
159 paint.setColor(0xff007f00);
160 canvas->drawPath(path, paint);
161}
SkPathBuilder & arcTo(const SkRect &oval, SkScalar startAngleDeg, SkScalar sweepAngleDeg, bool forceMoveTo)
SkPathBuilder & moveTo(SkPoint pt)
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ DEF_SIMPLE_GM() [2/4]

DEF_SIMPLE_GM ( crbug_640176  ,
canvas  ,
250  ,
250   
)

Definition at line 204 of file conicpaths.cpp.

204 {
206 path.moveTo(SkBits2Float(0x00000000), SkBits2Float(0x00000000)); // 0, 0
207 path.lineTo(SkBits2Float(0x42cfd89a), SkBits2Float(0xc2700000)); // 103.923f, -60
208 path.lineTo(SkBits2Float(0x42cfd899), SkBits2Float(0xc2700006)); // 103.923f, -60
209 path.conicTo(SkBits2Float(0x42f00000), SkBits2Float(0xc2009d9c),
210 SkBits2Float(0x42f00001), SkBits2Float(0x00000000),
211 SkBits2Float(0x3f7746ea)); // 120, -32.1539f, 120, 0, 0.965926f
212
214 paint.setAntiAlias(true);
215 canvas->translate(125, 125);
216 canvas->drawPath(path.detach(), paint);
217}
static float SkBits2Float(uint32_t bits)
Definition: SkFloatBits.h:48

◆ DEF_SIMPLE_GM() [3/4]

DEF_SIMPLE_GM ( largecircle  ,
canvas  ,
250  ,
250   
)

Definition at line 164 of file conicpaths.cpp.

164 {
165 canvas->translate(50, 100);
166 SkPoint c = { 1052.5390625f, 506.8760978034711f };
167 SkScalar radius = 1096.702150363923f;
169 paint.setAntiAlias(true);
170 paint.setStroke(true);
171 canvas->drawCircle(c, radius, paint);
172}

◆ DEF_SIMPLE_GM() [4/4]

DEF_SIMPLE_GM ( largeovals  ,
canvas  ,
250  ,
250   
)

Definition at line 175 of file conicpaths.cpp.

175 {
176 // Test EllipseOp
177 SkRect r = SkRect::MakeXYWH(-520, -520, 5000, 4000);
179 paint.setAntiAlias(true);
180 paint.setStroke(true);
181 paint.setStrokeWidth(100);
182 canvas->drawOval(r, paint);
183 r.offset(-15, -15);
184 paint.setColor(SK_ColorDKGRAY);
185 // we use stroke and fill to avoid falling into the SimpleFill path
187 paint.setStrokeWidth(1);
188 canvas->drawOval(r, paint);
189
190 // Test DIEllipseOp
191 canvas->rotate(1.0f);
192 r.offset(55, 55);
193 paint.setColor(SK_ColorGRAY);
194 paint.setStroke(true);
195 paint.setStrokeWidth(100);
196 canvas->drawOval(r, paint);
197 r.offset(-15, -15);
198 paint.setColor(SK_ColorLTGRAY);
200 paint.setStrokeWidth(1);
201 canvas->drawOval(r, paint);
202}
constexpr SkColor SK_ColorLTGRAY
Definition: SkColor.h:118
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
constexpr SkColor SK_ColorDKGRAY
Definition: SkColor.h:108
@ kStrokeAndFill_Style
sets to stroke and fill geometry
Definition: SkPaint.h:195
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659
void offset(float dx, float dy)
Definition: SkRect.h:1016