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

Go to the source code of this file.

Functions

 REG_FIDDLE (inlinepixmapconstructor, 256, 256, true, 3)
 

Function Documentation

◆ REG_FIDDLE()

REG_FIDDLE ( inlinepixmapconstructor  ,
256  ,
256  ,
true  ,
 
)

Definition at line 4 of file inlinepixmapconstructor.cpp.

4 {
5void draw(SkCanvas* canvas) {
6 SkDebugf("image alpha only = %s\n", image->isAlphaOnly() ? "true" : "false");
7 SkPMColor pmColors = 0;
9 SkImages::RasterFromPixmapCopy({SkImageInfo::MakeA8(1, 1), (uint8_t*)&pmColors, 1});
10 SkDebugf("copy alpha only = %s\n", copy->isAlphaOnly() ? "true" : "false");
11}
12} // END FIDDLE
uint32_t SkPMColor
Definition SkColor.h:205
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
bool isAlphaOnly() const
Definition SkImage.cpp:239
sk_sp< SkImage > image
Definition examples.cpp:29
SK_API sk_sp< SkImage > RasterFromPixmapCopy(const SkPixmap &pixmap)
Definition copy.py:1
static SkImageInfo MakeA8(int width, int height)