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

Go to the source code of this file.

Functions

 REG_FIDDLE (Bitmap_notifyPixelsChanged, 256, 20, false, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Bitmap_notifyPixelsChanged  ,
256  ,
20  ,
false  ,
 
)

Definition at line 4 of file Bitmap_notifyPixelsChanged.cpp.

4 {
5void draw(SkCanvas* canvas) {
8 bitmap.allocPixels();
9 bitmap.eraseColor(SK_ColorRED);
10 canvas->scale(16, 16);
11 canvas->drawImage(bitmap.asImage(), 0, 0);
13 canvas->drawImage(bitmap.asImage(), 2, 0);
14 bitmap.notifyPixelsChanged();
16 canvas->drawImage(bitmap.asImage(), 4, 0);
17}
18} // END FIDDLE
@ kOpaque_SkAlphaType
pixel is opaque
Definition: SkAlphaType.h:28
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
Definition: SkColorType.h:24
SK_API SkPMColor SkPreMultiplyColor(SkColor c)
Definition: SkColor.cpp:21
uint32_t SkPMColor
Definition: SkColor.h:205
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition: SkColor.h:131
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)