Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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 5 of file Image_RasterFromPixmap.cpp.

5 {
6 static void releaseProc(const void* pixels, SkImages::ReleaseContext context) {
7 int* countPtr = static_cast<int*>(context);
8 *countPtr += 1;
9 }
10
11void draw(SkCanvas* canvas) {
12 SkColor color = 0;
14 int releaseCount = 0;
16 SkDebugf("before reset: %d\n", releaseCount);
17 image.reset();
18 SkDebugf("after reset: %d\n", releaseCount);
19}
20} // END FIDDLE
SkColor4f color
@ 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
sk_sp< SkImage > image
Definition examples.cpp:29
SK_API sk_sp< SkImage > RasterFromPixmap(const SkPixmap &pixmap, RasterReleaseProc rasterReleaseProc, ReleaseContext releaseContext)
void * ReleaseContext
Definition SkImage.h:50
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)