#include "tools/fiddle/examples.h"
#include <climits>
#include <random>
Go to the source code of this file.
|
| REG_FIDDLE (Bitmap_allocN32Pixels, 256, 256, false, 0) |
|
◆ REG_FIDDLE()
REG_FIDDLE |
( |
Bitmap_allocN32Pixels |
, |
|
|
256 |
, |
|
|
256 |
, |
|
|
false |
, |
|
|
0 |
|
|
) |
| |
Definition at line 8 of file Bitmap_allocN32Pixels.cpp.
8 {
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);
16 };
17
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);
27 }
28 }
29}
30}
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)