6REG_FIDDLE(Canvas_accessTopRasterHandle, 256, 256,
true, 0) {
7static void DeleteCallback(
void*,
void* context) {
8 delete (
char*) context;
13 char* context =
new char[4]{
's',
'k',
'i',
'a'};
14 rec->fReleaseProc = DeleteCallback;
15 rec->fReleaseCtx = context;
16 rec->fHandle = context;
17 rec->fPixels = context;
28 std::unique_ptr<SkCanvas> c2 =
30 char* context = (
char*) c2->accessTopRasterHandle();
31 SkDebugf(
"context = %.4s\n", context);
REG_FIDDLE(Canvas_accessTopRasterHandle, 256, 256, true, 0)
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
static std::unique_ptr< SkCanvas > MakeCanvas(std::unique_ptr< SkRasterHandleAllocator >, const SkImageInfo &, const Rec *rec=nullptr, const SkSurfaceProps *props=nullptr)
virtual void updateHandle(Handle, const SkMatrix &, const SkIRect &)=0
virtual bool allocHandle(const SkImageInfo &, Rec *)=0
static SkImageInfo MakeN32Premul(int width, int height)