Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
Bitmap_setPixelRef.cpp File Reference
#include "tools/fiddle/examples.h"

Go to the source code of this file.

Functions

 REG_FIDDLE (Bitmap_setPixelRef, 256, 140, false, 5)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Bitmap_setPixelRef  ,
256  ,
140  ,
false  ,
 
)

Definition at line 5 of file Bitmap_setPixelRef.cpp.

5 {
6void draw(SkCanvas* canvas) {
10 bitmap.setPixelRef(sk_ref_sp(source.pixelRef()), 5, 5);
11 canvas->drawImage(bitmap.asImage(), 10, 10);
12}
13} // END FIDDLE
@ kOpaque_SkAlphaType
pixel is opaque
Definition SkAlphaType.h:28
@ kGray_8_SkColorType
pixel with grayscale level in 8-bit byte
Definition SkColorType.h:35
sk_sp< T > sk_ref_sp(T *obj)
Definition SkRefCnt.h:381
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
SkPixelRef * pixelRef() const
Definition SkBitmap.h:720
int width() const
Definition SkBitmap.h:149
size_t rowBytes() const
Definition SkBitmap.h:238
int height() const
Definition SkBitmap.h:158
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
SkBitmap source
Definition examples.cpp:28
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)