50 p.setColor(0x800000FF);
84 double dxdy = (double)(p1.
fX - p0.
fX) / (p1.
fY - p0.
fY);
130 return SkToInt(edges - edgesStart);
155 fPoly[0].
set(300, 40);
156 fPoly[1].
set(550, 250);
157 fPoly[2].
set(40, 450);
159 fEdgeColor[0] = 0xFFFF0000;
160 fEdgeColor[1] = 0xFF00FF00;
161 fEdgeColor[2] = 0xFF0000FF;
179 path.addPoly(fPoly, N,
true);
183 p.setAntiAlias(
true);
184 p.setColor(0xFFE0E0E0);
188 for (
int i = 0;
i < N; ++
i) {
189 const int j = (
i + 1) %
N;
190 p.setColor(fEdgeColor[
i]);
197 p.setColor(0xFF8888CC);
201 p.setColor(0xFF88CC88);
215 for (
int i = 0;
i <
N; ++
i) {
216 const int j = (
i + 1) %
N;
217 p.setColor(fEdgeColor[
i]);
256 for (
int i = 0;
i < fCount; ++
i) {
272 return dx*
dx + dy*dy <= rad*rad;
277 for (
int i = 0;
i < N; ++
i) {
284 path.addPoly(fPoly,
N,
true);
285 if (
path.contains(
x,
y)) {
296 ((
MyClick*)click)->handleMove();
static void draw_clipped_line(SkCanvas *canvas, const SkRect &bounds, SkPoint p0, SkPoint p1, const SkPaint &paint)
static int clip_line(const SkRect &bounds, SkPoint p0, SkPoint p1, SkPoint edges[])
constexpr SkColor SK_ColorRED
void swap(sk_sp< T > &a, sk_sp< T > &b)
#define SkDoubleToScalar(x)
#define SkScalarRoundToScalar(x)
constexpr int SkToInt(S x)
void handleMove() override
void handleMove() override
DragPolyClick(SkPoint poly[], int count)
void handleMove() override
DragRectClick(SkRect *rect)
virtual void handleMove()=0
void handleMove() override
void draw(SkCanvas *canvas) override
static void snap(SkPoint dst[], const SkPoint src[], int count)
Click * onFindClickHandler(SkScalar x, SkScalar y, skui::ModifierKey) override
static SkPoint snap(const SkPoint &pt)
static bool hit_test(const SkPoint &pt, SkScalar x, SkScalar y)
bool onClick(Click *click) override
static SkScalar snap(SkScalar x)
bool onClick(ClickHandlerSlide::Click *) override
void draw(SkCanvas *canvas) override
Click * onFindClickHandler(SkScalar x, SkScalar y, skui::ModifierKey) override
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
void drawPath(const SkPath &path, const SkPaint &paint)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
SK_API sk_sp< SkDocument > Make(SkWStream *dst, const SkSerialProcs *=nullptr, std::function< void(const SkPicture *)> onEndPage=nullptr)
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
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
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
static constexpr SkPoint Make(float x, float y)
void set(float x, float y)
constexpr float y() const
constexpr float x() const
constexpr SkRect makeOffset(float dx, float dy) const
constexpr float centerX() const
void offset(float dx, float dy)
constexpr float centerY() const
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)