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

Go to the source code of this file.

Functions

 REG_FIDDLE (Canvas_readPixels_b, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Canvas_readPixels_b  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Canvas_readPixels_b.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 canvas->clear(0x8055aaff);
8 uint32_t pixel = 0;
10 if (canvas->readPixels(info, &pixel, 4, 0, 0)) {
11 SkDebugf("pixel = %08x\n", pixel);
12 }
13 }
14}
15} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
kUnpremul_SkAlphaType
SkAlphaType
Definition: SkAlphaType.h:26
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
Definition: SkColorType.h:26
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
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)