234 {
237 *errorMsg = decodeResult.
errorMsg.c_str();
239 }
240 std::unique_ptr<SkCodec> codec = std::move(decodeResult.
codec);
241
243 if (*errorMsg = validateCanvasColorTypeAndGetDecodeInfo(&decodeInfo,
247 }
248
251
253 const size_t rowBytes =
size.width() * bpp;
256
259 memset(pixels.get(), 0,
size.height() * rowBytes);
261 }
262
263
264
265
266
267
269
273 }
274
275 switch (fDecodeMode) {
278 switch (codec->getPixels(decodeInfo, pixels.get(), rowBytes, &
options)) {
280
281
284 break;
285 default:
286
287 *errorMsg =
SkStringPrintf(
"Couldn't getPixels %s.", fPath.c_str());
289 }
290
291 drawToCanvas(canvas, bitmapInfo, pixels.get(), rowBytes);
292 break;
293 }
295 void*
dst = pixels.get();
298 codec->startIncrementalDecode(decodeInfo,
dst, rowBytes, &
options)) {
299 int rowsDecoded;
300 auto result = codec->incrementalDecode(&rowsDecoded);
302 codec->fillIncompleteImage(decodeInfo,
304 rowBytes,
307 rowsDecoded);
308 }
309 } else {
310 *errorMsg = "Could not start incremental decode";
312 }
313 drawToCanvas(canvas, bitmapInfo,
dst, rowBytes);
314 break;
315 }
316 default:
318 *errorMsg = "Invalid fDecodeMode";
320 }
322 }
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
SkImageInfo imageInfo() const
static sk_sp< SkColorSpace > MakeSRGB()
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
size_t computeByteSize(size_t rowBytes) const
SkImageInfo makeDimensions(SkISize newSize) const
int bytesPerPixel() const
SkImageInfo makeColorSpace(sk_sp< SkColorSpace > cs) const
SkColorType colorType() const
SkImageInfo makeColorType(SkColorType newColorType) const