Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
issue640176.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(issue640176, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
6 SkPaint p;
7 p.setColor(SK_ColorRED);
8 p.setAntiAlias(true);
9 float startAngle = -0.5235985, endAngle = -2.439e-4, radius = 120;
10
11 canvas->translate(radius, radius);
12 SkPath path;
13 path.moveTo(0, 0);
14 path.lineTo(radius * cos(startAngle), radius * sin(startAngle));
15 SkRect oval = {-radius, -radius, radius, radius};
16 path.arcTo(oval, startAngle * 180 / 3.14159265359,
17 (endAngle - startAngle) * 180 / 3.14159265359, false);
18 canvas->drawPath(path, p);
19
20 p.setStyle(SkPaint::kStroke_Style);
21 p.setColor(SK_ColorGREEN);
22 canvas->drawPath(path, p);
23}
24} // END FIDDLE
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60