31 {
35
38
39 const SkPoint pt = { wScalar / 2, hScalar / 2 };
40
41 const SkScalar radius = 4 * std::max(wScalar, hScalar);
42
47
55
60 for (int i = 0; i < 4; ++i) {
62 pt, radius,
64 std::size(colors),
66 0, &mat));
68 rect.inset(wScalar / 8, hScalar / 8);
70 }
71 return surface->makeImageSnapshot();
72}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorGREEN
void drawRect(const SkRect &rect, const SkPaint &paint)
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)
SkMatrix & postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
static const SkMatrix & I()
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)