Flutter Engine
The Flutter Engine
Functions
Canvas_readPixels_3.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_readPixels_3, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_readPixels_3  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Canvas_readPixels_3.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->clear(0x8055aaff);
8 bitmap.allocPixels(SkImageInfo::MakeN32Premul(1, 1));
9 canvas->readPixels(bitmap, 0, 0);
10 SkDebugf("pixel = %08x\n", bitmap.getAddr32(0, 0)[0]);
11}
12} // END FIDDLE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void clear(SkColor color)
Definition: SkCanvas.h:1199
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
Definition: SkCanvas.cpp:382
Definition: bitmap.py:1
static SkImageInfo MakeN32Premul(int width, int height)