234 {
237 *errorMsg = decodeResult.
errorMsg.c_str();
238 return DrawResult::kFail;
239 }
240 std::unique_ptr<SkCodec> codec = std::move(decodeResult.
codec);
241
243 if (*errorMsg = validateCanvasColorTypeAndGetDecodeInfo(&decodeInfo,
246 return DrawResult::kFail;
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());
288 return DrawResult::kFail;
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,
303 dst,
304 rowBytes,
307 rowsDecoded);
308 }
309 } else {
310 *errorMsg = "Could not start incremental decode";
311 return DrawResult::kFail;
312 }
313 drawToCanvas(canvas, bitmapInfo, dst, rowBytes);
314 break;
315 }
316 default:
318 *errorMsg = "Invalid fDecodeMode";
319 return DrawResult::kFail;
320 }
321 return DrawResult::kOk;
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 static SkString SkStringPrintf()
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