272 {
276
277 SkRect r = { -20, -20, img->
width() + 20.0f, img->height() + 20.0f };
278 canvas->translate(45, 45);
279
282
284 },
286
288 },
290
292 },
295 const SkPoint pts[] = {{ 0, 0 }, {img->width()*1.0f, img->height()*1.0f }};
297 const int count = std::size(colors);
299 },
303 const int count = std::size(colors);
305 img->width()*0.5f, colors,
pos,
count, tx));
306 },
307 };
308
309 const struct XY {
312 } pairs[] = {
317 };
318 for (const auto& p : pairs) {
320 canvas->save();
321 for (const auto& proc : shader_procs) {
322 canvas->save();
323
324
325 canvas->rotate(4);
326 canvas->drawRect(r, bgpaint);
328 canvas->drawRect(r,
paint);
329 canvas->restore();
330 canvas->translate(0, r.
height() + 20);
331 }
332 canvas->restore();
333 canvas->translate(r.
width() + 10, 0);
334 }
335}
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
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)
void setColor(SkColor color)
PODArray< SkColor > colors
static constexpr SkCubicResampler Mitchell()
constexpr float height() const
constexpr float width() const