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

Go to the source code of this file.

Functions

 REG_FIDDLE (Pixmap_writable_addr64, 256, 40, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Pixmap_writable_addr64  ,
256  ,
40  ,
false  ,
 
)

Definition at line 4 of file Pixmap_writable_addr64.cpp.

4 {
5void draw(SkCanvas* canvas) {
7 uint64_t storage[9];
8 SkPixmap pixmap(info, storage, 3 * sizeof(uint64_t));
9 SkColor4f c4 { 1, 0.45f, 0.25f, 0.65f };
10 pixmap.erase(c4);
12 canvas->scale(10, 10);
13 bitmap.installPixels(pixmap);
14 canvas->drawImage(bitmap.asImage(), 0, 0);
15 *pixmap.writable_addr64(1, 1) |= 0x00ff000000000000LL;
16 bitmap.installPixels(pixmap);
17 canvas->drawImage(bitmap.asImage(), 10, 0);
18}
19} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
Definition: SkColorType.h:38
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
Definition: bitmap.py:1
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)