927 {
929
931 SkColor colors1[] = { 0xff000000, 0xff000000,
932 0xffffffff, 0xffffffff,
933 0xff000000, 0xff000000 };
934 SkColor colors2[] = { 0xff000000, 0xff000000,
935 0x00000000, 0x00000000,
936 0xff000000, 0xff000000 };
938 static_assert(std::size(colors1) == std::size(
pos),
"color/pos size mismatch");
939 static_assert(std::size(colors2) == std::size(
pos),
"color/pos size mismatch");
940
943
945
946 SkPoint pts1[] = { { 0, 0 }, { kTileSize, kTileSize }};
950
951 SkPoint pts2[] = { { 0, kTileSize }, { kTileSize, 0 }};
955
961 });
962
964
967 0xffffffff, 0xffffffff,
968 0xff000000, 0xff000000,
969 0xffffffff, 0xffffffff };
970 SkScalar pos[] = { 0, .25f, .25f, .5f, .5f, .75f, .75f, 1 };
971 static_assert(std::size(colors) == std::size(
pos),
"color/pos size mismatch");
972
975 colors,
pos, std::size(colors), 0,
nullptr));
978
982 });
983
985
988 SkColor colors[] = {
a,
a,
b,
b,
a,
a,
b,
b,
a,
a,
b,
b,
a,
a,
b,
b};
989 SkScalar pos[] = { 0, .125f, .125f, .25f, .25f, .375f, .375f, .5f, .5f,
990 .625f, .625f, .75f, .75f, .875f, .875f, 1};
991 static_assert(std::size(colors) == std::size(
pos),
"color/pos size mismatch");
992
995 std::size(colors), 0, nullptr);
999 std::size(colors), 0, &m);
1000
1002
1003 SkScalar radialPos[] = { 0, .02f, .02f, .04f, .04f, .08f, .08f, .16f, .16f, .31f, .31f,
1004 .62f, .62f, 1, 1, 1 };
1005 static_assert(std::size(colors) == std::size(radialPos),
1006 "color/pos size mismatch");
1007
1010 radialPos,
1011 std::size(radialPos),
1013 });
1014}
@ kExclusion
rc = s + d - two(s*d), ra = kSrcOver
static SkScalar center(float pos0, float pos1)
void drawPaint(const SkPaint &paint)
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)
static const SkMatrix & I()
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
SkCanvas * getRecordingCanvas()
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, SkFilterMode mode, const SkMatrix *localMatrix, const SkRect *tileRect) const
static void draw_circle_shader(SkCanvas *canvas, SkScalar cx, SkScalar cy, SkScalar r, sk_sp< SkShader >(*shaderFunc)())
PODArray< SkColor > colors
static constexpr SkRect MakeWH(float w, float h)