8REG_FIDDLE(Bitmap_allocN32Pixels, 256, 256,
false, 0) {
11 bitmap.allocN32Pixels(64, 64);
13 std::default_random_engine rng;
14 const auto randUint = [&rng](uint32_t
min, uint32_t
max) -> uint32_t {
15 return std::uniform_int_distribution<uint32_t>(
min,
max)(rng);
18 for (
int y = 0;
y < 256;
y += 64) {
19 for (
int x = 0;
x < 256;
x += 64) {
21 uint32_t
w = randUint(4, 32);
22 uint32_t cx = randUint(0, 64 -
w);
23 uint32_t
h = randUint(4, 32);
24 uint32_t cy = randUint(0, 64 -
h);
REG_FIDDLE(Bitmap_allocN32Pixels, 256, 256, false, 0)
constexpr SkColor SK_ColorTRANSPARENT
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static float max(float r, float g, float b)
static float min(float r, float g, float b)
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)