Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 2202763002: Fix SkJpegCodec::onSkipScanlines when TURBO_HAS_SKIP is not defined (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/codec/SkJpegCodec.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index 2eea46bb2bb07caa64fc0c6cbc2a396769064e5f..8096a29f49866ebd21a0bc1234ea8e0215b68d19 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -353,6 +353,10 @@ bool SkJpegCodec::onRewind() {
fStorage.reset();
fColorXform.reset(nullptr);
+#if !defined(TURBO_HAS_SKIP)
+ fSkipStorage.reset();
+#endif
+
return true;
}
@@ -788,13 +792,14 @@ bool SkJpegCodec::onSkipScanlines(int count) {
#ifdef TURBO_HAS_SKIP
return (uint32_t) count == jpeg_skip_scanlines(fDecoderMgr->dinfo(), count);
#else
- if (!fSwizzleSrcRow) {
- fStorage.reset(get_row_bytes(fDecoderMgr->dinfo()));
- fSwizzleSrcRow = fStorage.get();
+ uint8_t* ptr = fSkipStorage.get();
+ if (!ptr) {
+ fSkipStorage.reset(get_row_bytes(fDecoderMgr->dinfo()));
+ ptr = fSkipStorage.get();
}
for (int y = 0; y < count; y++) {
- if (1 != jpeg_read_scanlines(fDecoderMgr->dinfo(), &fSwizzleSrcRow, 1)) {
+ if (1 != jpeg_read_scanlines(fDecoderMgr->dinfo(), &ptr, 1)) {
return false;
}
}
« no previous file with comments | « src/codec/SkJpegCodec.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698