84 SkBitmap opaqueBm, premulBm, unpremulBm;
87 *errorMsg =
"Could not load images/mandrill_256.png.png. "
88 "Did you forget to set the resourcePath?";
93 *errorMsg =
"Could not load images/yellow_rose.png. "
94 "Did you forget to set the resourcePath?";
102 for (
const auto& rec : gRecs) {
103 auto fmt = rec.format;
int q = rec.quality;
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);
118 using INHERITED =
GM;
121DEF_GM(
return new EncodePlatformGM; )
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_sp< SkData > detachAsData()
GM(SkColor backgroundColor=SK_ColorWHITE)
uint32_t uint32_t * format
SK_API sk_sp< SkImage > DeferredFromEncodedData(sk_sp< SkData > encoded, std::optional< SkAlphaType > alphaType=std::nullopt)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
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)
static constexpr SkISize Make(int32_t w, int32_t h)
SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const