338 {
340 if (setjmp(jmp)) {
341 return false;
342 }
343
344 if (fSrcYUVA) {
345
346 for (
int i = 0;
i < numRows;
i++) {
349 jpeg_write_scanlines(fEncoderMgr->cinfo(), &jpegSrcRow, 1);
350 }
351 } else {
353 const size_t jpegSrcBytes = fEncoderMgr->cinfo()->input_components *
fSrc.
width();
355 for (
int i = 0;
i < numRows;
i++) {
356 JSAMPLE* jpegSrcRow = (JSAMPLE*)(const_cast<void*>(srcRow));
357 if (fEncoderMgr->proc()) {
360 (const char*)srcRow,
362 fEncoderMgr->cinfo()->input_components);
365 SkTAddOffset<const void>(jpegSrcRow, jpegSrcBytes));
366 } else {
367
368
370 SkTAddOffset<const void>(jpegSrcRow, jpegSrcBytes));
371 }
372
373 jpeg_write_scanlines(fEncoderMgr->cinfo(), &jpegSrcRow, 1);
374 srcRow = SkTAddOffset<const void>(srcRow,
fSrc.
rowBytes());
375 }
376 }
377
380 jpeg_finish_compress(fEncoderMgr->cinfo());
381 }
382
383 return true;
384}
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
static void yuva_copy_row(const SkYUVAPixmaps &src, int row, uint8_t *dst)
static void sk_msan_assert_initialized(const void *begin, const void *end)
skia_private::AutoTMalloc< uint8_t > fStorage
SkColorType colorType() const
const void * addr() const