37 const char*
path =
"images/mandrill_512_q075.jpg";
40 *errorMsg =
"Couldn't load images/mandrill_512_q075.jpg. "
41 "Did you forget to set the resource path?";
47 auto [codecImage, _] = codec->getImage();
54 SkCanvas legacyCanvas(legacyBMCanvas);
57 legacyCanvas.
drawImage(codecImage, 0.0f, 0.0f);
68 srgbCanvas.
drawImage(codecImage, 0.0f, 0.0f);
74 inline static constexpr int kSize = 512;
81DEF_GM(
return new BitmapImageGM; )
std::unique_ptr< SkStreamAsset > GetResourceAsStream(const char *resource, bool useFileStream)
@ kOpaque_SkAlphaType
pixel is opaque
void allocPixels(const SkImageInfo &info, size_t rowBytes)
sk_sp< SkImage > asImage() const
void translate(SkScalar dx, SkScalar dy)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
static std::unique_ptr< SkCodec > MakeFromStream(std::unique_ptr< SkStream >, SkSpan< const SkCodecs::Decoder > decoders, Result *=nullptr, SkPngChunkReader *=nullptr, SelectionPolicy selectionPolicy=SelectionPolicy::kPreferStillImage)
SkISize getISize() override
SkString getName() const override
DrawResult onDraw(SkCanvas *canvas, SkString *errorMsg) override
GM(SkColor backgroundColor=SK_ColorWHITE)
sk_sp< const SkImage > image
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_GM(return F(C(clipbox), 0.0f, 0.0f, {})) DEF_GM(return F(C(clipbox)
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)