25 float angleStep = 360.0f / n, angle = 0.0f;
27 angle = angleStep/2.0f;
30 for (
int i = 0;
i < n; ++
i) {
109 { -47.55f, -15.45f },
110 { -40.45f, -29.39f },
111 { -29.39f, -40.45f },
112 { -15.45f, -47.55f },
126 { -72.55f, -15.45f },
127 { -65.45f, -29.39f },
128 { -54.39f, -40.45f },
129 { -40.45f, -47.55f },
178 if (fDoStrokeAndFill) {
179 return SkString(
"convex-lineonly-paths-stroke-and-fill");
181 return SkString(
"convex-lineonly-paths");
187 std::unique_ptr<SkPoint[]>
data(
nullptr);
210 width = kMaxPathHeight/5;
220 width = kMaxPathHeight/5;
233 data = std::make_unique<SkPoint[]>(numPts);
243 for (
int i = 1;
i < numPts; ++
i) {
248 for (
int i = numPts-2;
i >= 0; --
i) {
277 if (
offset->fX+
path.getBounds().width() > kGMWidth) {
279 offset->fY += kMaxPathHeight;
280 if (fDoStrokeAndFill) {
281 offset->fX += kStrokeWidth / 2.0f;
282 offset->fY += kStrokeWidth / 2.0f;
287 if (fDoStrokeAndFill) {
288 offset->fX += kStrokeWidth;
294 const float scales[] = { 1.0f, 0.75f, 0.5f, 0.25f, 0.1f, 0.01f, 0.001f };
300 paint.setAntiAlias(
true);
304 if (fDoStrokeAndFill) {
306 paint.setStrokeJoin(joins[
i%3]);
312 canvas->
scale(scales[
i], scales[
i]);
322 if (fDoStrokeAndFill) {
323 offset.fX += kStrokeWidth / 2.0f;
324 offset.fY += kStrokeWidth / 2.0f;
327 for (
int i = 0;
i < kNumPaths; ++
i) {
335 p.setAntiAlias(
true);
336 if (fDoStrokeAndFill) {
343 {60.8522949f, 364.671021f},
344 {59.4380493f, 364.671021f},
345 {385.414276f, 690.647217f},
346 {386.121399f, 689.940125f},
378 {1184.96f, 982.557f},
379 {1183.71f, 982.865f},
380 {1180.99f, 982.734f},
382 {1176.35f, 979.367f},
383 {1178.94f, 938.854f},
384 {1181.35f, 936.038f},
385 {1183.96f, 934.117f},
386 {1186.67f, 933.195f},
387 {1189.36f, 933.342f},
392 m.setAll(0.0893210843f, 0, 79.1197586f, 0, 0.0893210843f, 300, 0, 0, 1);
400 inline static constexpr int kStrokeWidth = 10;
401 inline static constexpr int kNumPaths = 20;
402 inline static constexpr int kMaxPathHeight = 100;
403 inline static constexpr int kGMWidth = 512;
404 inline static constexpr int kGMHeight = 512;
406 bool fDoStrokeAndFill;
408 using INHERITED =
GM;
413DEF_GM(
return new ConvexLineOnlyPathsGM(
false);)
414DEF_GM(
return new ConvexLineOnlyPathsGM(
true);)
static const int points[]
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
#define SkDegreesToRadians(degrees)
#define SkScalarSin(radians)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkScalarCos(radians)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
@ kStrokeAndFill_Style
sets to stroke and fill geometry
@ kMiter_Join
extends to miter limit
@ kBevel_Join
connects outside edges
static SkPathFirstDirection AsFirstDirection(SkPathDirection dir)
static SkPathFirstDirection ComputeFirstDirection(const SkPath &)
static SkPath Polygon(const SkPoint pts[], int count, bool isClosed, SkPathFillType=SkPathFillType::kWinding, bool isVolatile=false)
SkISize getISize() override
bool runAsBench() const override
static SkPath GetPath(int index, SkPathDirection dir)
void drawPath(SkCanvas *canvas, int index, SkPoint *offset)
void onDraw(SkCanvas *canvas) override
ConvexLineOnlyPathsGM(bool doStrokeAndFill)
SkString getName() const override
GM(SkColor backgroundColor=SK_ColorWHITE)
static void create_ngon(int n, SkPoint *pts, SkScalar width, SkScalar height)
const SkPoint * gPoints[]
const SkPoint gPoints10[]
Optional< SkRect > bounds
PODArray< SkColor > colors
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
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkISize Make(int32_t w, int32_t h)
std::shared_ptr< const fml::Mapping > data