35 {
36
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?";
43 }
44
45
47 auto [codecImage, _] = codec->getImage();
48
49
50
54 SkCanvas legacyCanvas(legacyBMCanvas);
55 legacyCanvas.drawImage(
image, 0.0f, 0.0f);
56 legacyCanvas.translate(
SkScalar(kSize), 0.0f);
57 legacyCanvas.drawImage(codecImage, 0.0f, 0.0f);
60
61
66 srgbCanvas.drawImage(
image, 0.0f, 0.0f);
67 srgbCanvas.translate(
SkScalar(kSize), 0.0f);
68 srgbCanvas.drawImage(codecImage, 0.0f, 0.0f);
71 }
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)
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
static SkImageInfo MakeS32(int width, int height, SkAlphaType at)
static SkImageInfo MakeN32(int width, int height, SkAlphaType at)