83 {
84 SkBitmap opaqueBm, premulBm, unpremulBm;
85
87 *errorMsg = "Could not load images/mandrill_256.png.png. "
88 "Did you forget to set the resourcePath?";
90 }
93 *errorMsg = "Could not load images/yellow_rose.png. "
94 "Did you forget to set the resourcePath?";
96 }
101
102 for (const auto& rec : gRecs) {
103 auto fmt = rec.format;
int q = rec.quality;
107
108 canvas->
drawImage(opaqueImage.get(), 0.0f, 0.0f);
109 canvas->
drawImage(premulImage.get(), 0.0f, 256.0f);
110 canvas->
drawImage(unpremulImage.get(), 0.0f, 512.0f);
111
113 }
115 }
SkAssertResult(font.textToGlyphs("Hello", 5, SkTextEncoding::kUTF8, glyphs, std::size(glyphs))==count)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
bool extractSubset(SkBitmap *dst, const SkIRect &subset) const
const SkPixmap & pixmap() const
const SkImageInfo & info() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
void translate(SkScalar dx, SkScalar dy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
static sk_sp< SkData > encode_data(const SkBitmap &bitmap, SkEncodedImageFormat format)
static SkString fmt(SkColor4f c)
static constexpr SkIRect MakeWH(int32_t w, int32_t h)
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const