5REG_FIDDLE(Canvas_drawImageRect_4, 256, 64,
false, 0) {
11 (
void*) pixels,
sizeof(pixels[0]));
15 for (
auto alpha : { 50, 100, 150, 255 } ) {
16 paint.setAlpha(alpha);
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorWHITE
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void translate(SkScalar dx, SkScalar dy)
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void scale(SkScalar sx, SkScalar sy)
#define REG_FIDDLE(NAME, W, H, TEXT, I)
static SkImageInfo MakeN32Premul(int width, int height)
static constexpr SkRect MakeWH(float w, float h)