18#define BG_COLOR 0xFFDDDDDD
39 paint->setPathEffect(compose);
43 paint->setStrokeWidth(0);
47 paint->setStrokeWidth(0);
52 paint->setStrokeWidth(12);
57 SkScalar inter[] = { 20, 10, 10, 10 };
58 paint->setStrokeWidth(12);
63static const int gXY[] = {
644, 0, 0, -4, 8, -4, 12, 0, 8, 4, 0, 4
92 paint->setPathEffect(
nullptr);
117 paint.setAntiAlias(
true);
122 path.lineTo(70, 120);
123 path.lineTo(120, 30);
124 path.lineTo(170, 80);
125 path.lineTo(240, 50);
137 SkRect r = { 0, 0, 250, 120 };
203 center0, (pts[1].fX - pts[0].fX) / 2,
220 paint.setAntiAlias(
true);
221 paint.setDither(
true);
266 ~Rec() {
delete[] fVerts;
delete[] fTexs; }
275 rec->fVerts =
new SkPoint[rec->fCount];
277 for (
int i = 0;
i < n;
i++) {
279 for (
int j = 0; j < 3; j++) {
285static void make_fan(Rec* rec,
int texWidth,
int texHeight) {
292 rec->fVerts =
new SkPoint[rec->fCount];
293 rec->fTexs =
new SkPoint[rec->fCount];
300 for (
int i = 0;
i < n;
i++) {
304 v[
i+1].
set(cos, sin);
305 t[
i+1].
set(
i*tx/n, ty);
313 m.mapPoints(v, rec->fCount);
316static void make_strip(Rec* rec,
int texWidth,
int texHeight) {
322 rec->fCount = 2 * (n + 1);
323 rec->fVerts =
new SkPoint[rec->fCount];
324 rec->fTexs =
new SkPoint[rec->fCount];
329 for (
int i = 0;
i < n;
i++) {
333 v[
i*2 + 0].
set(cos/2, sin/2);
334 v[
i*2 + 1].
set(cos, sin);
336 t[
i*2 + 0].
set(tx *
i / n, ty);
337 t[
i*2 + 1].
set(tx *
i / n, 0);
342 t[2*n + 0].
set(tx, ty);
343 t[2*n + 1].
set(tx, 0);
348 m.mapPoints(v, rec->fCount);
363 paint.setDither(
true);
367 fRecs[
i].fVerts, fRecs[
i].fTexs,
nullptr);
370 paint.setShader(
nullptr);
375 paint.setShader(fShader0);
380 paint.setShader(fShader1);
421 str.
printf(
"/skimages/slide_%zu.png",
i);
427 gProc[fIndex](canvas);
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
sk_sp< T > sk_ref_sp(T *obj)
#define SkScalarSin(radians)
#define SkScalarAve(a, b)
#define SkScalarCos(radians)
static SkScalar SkScalarInterp(SkScalar A, SkScalar B, SkScalar t)
static void scale(SkPath *path, SkScalar scale)
static void fill_pe(SkPaint *paint)
sk_sp< SkShader >(* GradMaker)(const SkPoint pts[2], const GradData &, SkTileMode)
static const GradData gGradData[]
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const GradData &data, SkTileMode tm)
static void one_d_pe(SkPaint *paint)
static sk_sp< SkShader > MakeRadial(const SkPoint pts[2], const GradData &data, SkTileMode tm)
void(* PE_Proc)(SkPaint *)
static const SlideProc gProc[]
static sk_sp< SkShader > Make2Conical(const SkPoint pts[2], const GradData &data, SkTileMode tm)
static void hair_pe(SkPaint *paint)
static const GradMaker gGradMakers[]
static void tile_pe(SkPaint *paint)
static void mesh_slide(SkCanvas *canvas)
static sk_sp< SkShader > MakeSweep(const SkPoint pts[2], const GradData &data, SkTileMode tm)
static const SkScalar gPos2[]
static void stroke_pe(SkPaint *paint)
static void discrete_pe(SkPaint *paint)
void(* SlideProc)(SkCanvas *)
static void compose_pe(SkPaint *paint)
static void dash_pe(SkPaint *paint)
static sk_sp< SkShader > make_shader0(SkIPoint *size)
static sk_sp< SkPathEffect > MakeTileEffect()
static void make_strip(Rec *rec, int texWidth, int texHeight)
static const PE_Proc gPE2[]
static void gradient_slide(SkCanvas *canvas)
static const SkScalar gPos1[]
static void make_fan(Rec *rec, int texWidth, int texHeight)
static const SkScalar gPos0[]
static sk_sp< SkShader > make_shader1(const SkIPoint &size)
static void make_tris(Rec *rec)
static const SkColor gColors[]
static void patheffect_slide(SkCanvas *canvas)
static const PE_Proc gPE[]
static void hair2_pe(SkPaint *paint)
static SkScalar center(float pos0, float pos1)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
void allocN32Pixels(int width, int height, bool isOpaque=false)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawColor(SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(SkScalar radius)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
static sk_sp< SkPathEffect > Make(SkScalar segLength, SkScalar dev, uint32_t seedAssist=0)
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kStroke_Style
set to stroke geometry
@ kFill_Style
set to fill geometry
static sk_sp< SkPathEffect > Make(const SkPath &path, SkScalar advance, SkScalar phase, Style)
static sk_sp< SkPathEffect > Make(const SkMatrix &matrix, const SkPath &path)
static sk_sp< SkPathEffect > MakeCompose(sk_sp< SkPathEffect > outer, sk_sp< SkPathEffect > inner)
void printf(const char format[],...) SK_PRINTF_LIKE(2
const char * c_str() const
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
@ kTriangleStrip_VertexMode
@ kTriangleFan_VertexMode
void load(SkScalar w, SkScalar h) override
void draw(SkCanvas *canvas) override
bool onClick(ClickHandlerSlide::Click *) override
Click * onFindClickHandler(SkScalar x, SkScalar y, skui::ModifierKey) override
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
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
SkSamplingOptions(SkFilterMode::kLinear))
SkVertices::VertexMode fMode
void set(float x, float y)
void inset(float dx, float dy)
std::shared_ptr< const fml::Mapping > data