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

Go to the source code of this file.

Functions

 REG_FIDDLE (Pixmap_erase_3, 256, 50, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Pixmap_erase_3  ,
256  ,
50  ,
false  ,
 
)

Definition at line 4 of file Pixmap_erase_3.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 uint32_t storage[2];
8 SkPixmap pixmap(info, storage, info.minRowBytes());
9 SkIRect topPixelBounds = {0, 0, 1, 1};
10 pixmap.erase({ 0.65f, 0.45f, 0.25f, 1 }, &topPixelBounds);
11 SkIRect bottomPixelBounds = {0, 1, 1, 2};
12 pixmap.erase({ 0.25f, 0.65f, 0.45f, 1 }, &bottomPixelBounds);
14 canvas->scale(20, 20);
15 bitmap.installPixels(pixmap);
16 canvas->drawImage(image, 0, 0);
17}
18} // END FIDDLE
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
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
sk_sp< const SkImage > image
Definition: SkRecords.h:269
Definition: bitmap.py:1
Definition: SkRect.h:32
static SkImageInfo MakeN32Premul(int width, int height)