Go to the source code of this file.
|
| REG_FIDDLE (Image_readPixels_2, 256, 256, false, 3) |
|
◆ REG_FIDDLE()
REG_FIDDLE |
( |
Image_readPixels_2 |
, |
|
|
256 |
, |
|
|
256 |
, |
|
|
false |
, |
|
|
3 |
|
|
) |
| |
Definition at line 4 of file Image_readPixels_2.cpp.
4 {
6 std::vector<int32_t> srcPixels;
11 for (
int y = 0;
y < 4; ++
y) {
12 for (
int x = 0;
x < 4; ++
x) {
14 &srcPixels.front() +
x *
image->
height() * quarterWidth +
15 y * quarterWidth, rowBytes);
17 }
18 }
19 canvas->
scale(.5f, .5f);
22 &srcPixels.front(), rowBytes);
24}
25}
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
void scale(SkScalar sx, SkScalar sy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
bool readPixels(GrDirectContext *context, const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint cachingHint=kAllow_CachingHint) const
sk_sp< const SkImage > image
static SkImageInfo MakeN32Premul(int width, int height)