51 float matrix[20] = { 1, 0, 0, 0, 0,
54 0, 0, 0, 1, 32.0f/255 };
93 gradientCircleSource, noopCropped, &bigRect));
100 noopCropped, &bigRect));
110 auto canvas = surf->getCanvas();
111 canvas->clear(0xFFFF0000);
116 for (
int y = 8;
y < 48;
y += 16) {
117 for (
int x = 8;
x < 48;
x += 16) {
127 return surf->makeImageSnapshot();
136 canvas->
clear(0x00000000);
145 return surface->makeImageSnapshot();
151 paint.setImageFilter(std::move(filter));
static sk_sp< SkImage > make_checkerboard(int width, int height)
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkColorFilter > Matrix(const SkColorMatrix &)
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< SkImageFilter > PointLitDiffuse(const SkPoint3 &location, SkColor lightColor, SkScalar surfaceScale, SkScalar kd, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > ColorFilter(sk_sp< SkColorFilter > cf, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DropShadow(SkScalar dx, SkScalar dy, SkScalar sigmaX, SkScalar sigmaY, SkColor color, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Erode(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > DisplacementMap(SkColorChannel xChannelSelector, SkColorChannel yChannelSelector, SkScalar scale, sk_sp< SkImageFilter > displacement, sk_sp< SkImageFilter > color, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Image(sk_sp< SkImage > image, const SkRect &srcRect, const SkRect &dstRect, const SkSamplingOptions &sampling)
static sk_sp< SkImageFilter > Offset(SkScalar dx, SkScalar dy, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
static sk_sp< SkImageFilter > Dilate(SkScalar radiusX, SkScalar radiusY, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
void setStyle(Style style)
void setColor(SkColor color)
@ kStroke_Style
set to stroke geometry
static float min(float r, float g, float b)
static sk_sp< SkImage > make_gradient_circle(int width, int height)
DEF_SIMPLE_GM(imagefilterscropexpand, canvas, 730, 650)
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< const SkImage > image
PODArray< SkColor > colors
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
void outset(int32_t dx, int32_t dy)
static SkImageInfo MakeN32Premul(int width, int height)
static SkPoint3 Make(SkScalar x, SkScalar y, SkScalar z)
static constexpr SkPoint Make(float x, float y)
static SkRect Make(const SkISize &size)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
void roundOut(SkIRect *dst) const
static constexpr SkRect MakeWH(float w, float h)
static void checkerboard(SkCanvas *canvas, SkColor c1, SkColor c2, int size)