30 SkDebugf(
"\nCould not decode file '%s'. Did you forget"
31 " to set the resourcePath?\n",
resource);
46 draw_image(canvas,
"images/color_wheel.png", 0, 0);
47 draw_image(canvas,
"images/color_wheel.gif", 128, 0);
48 draw_image(canvas,
"images/color_wheel.webp", 0, 128);
49 draw_image(canvas,
"images/color_wheel.jpg", 128, 128);
88 canvas->drawImageRect(pmImg, srcRect, dstRect,
93 canvas->drawImageRect(upmImg, srcRect, dstRect.
makeOffset(128, 0),
sk_sp< SkData > GetResourceAsData(const char *resource)
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
constexpr SkColor SK_ColorLTGRAY
constexpr SkColor SK_ColorWHITE
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static SkString resource(SkPDFResourceType type, int index)
@ kFast_SrcRectConstraint
sample outside bounds; faster
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static constexpr SkFontStyle Bold()
@ kAlias
no transparent pixels on glyph edges
static void draw_image(SkCanvas *canvas, const char *resource, int x, int y)
DEF_SIMPLE_GM(colorwheel, canvas, 256, 256)
constexpr SkColor4f kMagenta
constexpr SkColor4f kGreen
constexpr SkColor4f kCyan
constexpr SkColor4f kBlack
constexpr SkColor4f kBlue
constexpr SkColor4f kYellow
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
sk_sp< const SkImage > image
font
Font Metadata and Metrics.
constexpr SkRect makeOffset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
static sk_sp< SkShader > linear(sk_sp< SkShader > shader)