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

Go to the source code of this file.

Functions

 REG_FIDDLE (Image_RasterFromPixmap, 256, 256, true, 0)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( Image_RasterFromPixmap  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file Image_RasterFromPixmap.cpp.

4 {
5 static void releaseProc(const void* pixels, SkImages::ReleaseContext context) {
6 int* countPtr = static_cast<int*>(context);
7 *countPtr += 1;
8 }
9
10void draw(SkCanvas* canvas) {
11 SkColor color = 0;
13 int releaseCount = 0;
15 SkDebugf("before reset: %d\n", releaseCount);
16 image.reset();
17 SkDebugf("after reset: %d\n", releaseCount);
18}
19} // END FIDDLE
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
Definition: SkAlphaType.h:29
uint32_t SkColor
Definition: SkColor.h:37
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void releaseProc(const void *ptr, void *context)
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void reset(T *ptr=nullptr)
Definition: SkRefCnt.h:310
DlColor color
SK_API sk_sp< SkImage > RasterFromPixmap(const SkPixmap &pixmap, RasterReleaseProc rasterReleaseProc, ReleaseContext releaseContext)
void * ReleaseContext
Definition: SkImage.h:50
sk_sp< const SkImage > image
Definition: SkRecords.h:269
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)