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

Issue 647023006: Qualify the return value of SkImageDecoder::decode (Closed)

Created:
6 years, 2 months ago by scroggo
Modified:
6 years, 2 months ago
Reviewers:
hal.canary, djsollen, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git/+/master
Project:
skia
Visibility:
Public.

Description

Qualify the return value of SkImageDecoder::decode Add a new enum to differentiate between a complete decode and a partial decode (with the third value being failure). Return this value from SkImageDecoder::onDecode (in all subclasses, plus SkImageDecoder_empty) and ::decode. For convenience, if the enum is treated as a boolean, success and partial success are both considered true. Note that the static helper functions (DecodeFile etc) still return true and false (for one thing, this allows us to continue to use SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in SkPicture::CreateFromStream). Also correctly report failure in SkASTCImageDecoder::onDecode when SkTextureCompressor::DecompressBufferFromFormat fails. BUG=skia:3037 BUG:b/17419670 Committed: https://skia.googlesource.com/skia/+/2a1208017dd676f94a53bbb228197c3978dbdd8a

Patch Set 1 #

Patch Set 2 : Fix a piece of code only built on Android. #

Total comments: 2

Patch Set 3 : Slight comment cleanups. #

Patch Set 4 : Compare enums to convert to boolean. #

Patch Set 5 : Fix test on Windows. #

Patch Set 6 : And fix SkipZeroesBench. #

Patch Set 7 : fix a sample #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -169 lines) Patch
M bench/SkipZeroesBench.cpp View 1 2 3 4 5 1 chunk +4 lines, -4 lines 0 comments Download
M include/core/SkImageDecoder.h View 1 2 3 chunks +17 lines, -4 lines 0 comments Download
M samplecode/SampleUnpremul.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkDecodingImageGenerator.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/images/SkImageDecoder.cpp View 1 2 3 3 chunks +8 lines, -7 lines 0 comments Download
M src/images/SkImageDecoder_astc.cpp View 9 chunks +12 lines, -11 lines 0 comments Download
M src/images/SkImageDecoder_ktx.cpp View 12 chunks +19 lines, -19 lines 0 comments Download
M src/images/SkImageDecoder_libbmp.cpp View 6 chunks +8 lines, -8 lines 0 comments Download
M src/images/SkImageDecoder_libgif.cpp View 8 chunks +10 lines, -9 lines 0 comments Download
M src/images/SkImageDecoder_libico.cpp View 9 chunks +26 lines, -17 lines 0 comments Download
M src/images/SkImageDecoder_libjpeg.cpp View 1 21 chunks +56 lines, -32 lines 0 comments Download
M src/images/SkImageDecoder_libpng.cpp View 8 chunks +11 lines, -11 lines 0 comments Download
M src/images/SkImageDecoder_libwebp.cpp View 5 chunks +21 lines, -10 lines 0 comments Download
M src/images/SkImageDecoder_pkm.cpp View 6 chunks +9 lines, -9 lines 0 comments Download
M src/images/SkImageDecoder_wbmp.cpp View 6 chunks +8 lines, -8 lines 0 comments Download
M src/images/SkScaledBitmapSampler.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ports/SkImageDecoder_CG.cpp View 4 chunks +8 lines, -8 lines 0 comments Download
M src/ports/SkImageDecoder_WIC.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M src/ports/SkImageDecoder_empty.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M tests/ImageDecodingTest.cpp View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 13 (4 generated)
scroggo
Alternate approach to https://codereview.chromium.org/658343003/
6 years, 2 months ago (2014-10-17 18:30:07 UTC) #2
reed1
lgtm https://codereview.chromium.org/647023006/diff/20001/include/core/SkImageDecoder.h File include/core/SkImageDecoder.h (right): https://codereview.chromium.org/647023006/diff/20001/include/core/SkImageDecoder.h#newcode232 include/core/SkImageDecoder.h:232: kFailure = 0, //!< Image failed to decode. ...
6 years, 2 months ago (2014-10-17 21:07:26 UTC) #3
scroggo
https://codereview.chromium.org/647023006/diff/20001/include/core/SkImageDecoder.h File include/core/SkImageDecoder.h (right): https://codereview.chromium.org/647023006/diff/20001/include/core/SkImageDecoder.h#newcode232 include/core/SkImageDecoder.h:232: kFailure = 0, //!< Image failed to decode. bitmap ...
6 years, 2 months ago (2014-10-17 21:11:44 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/647023006/40001
6 years, 2 months ago (2014-10-22 16:23:34 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: Build-Win-VS2013-x86-Debug-Trybot on client.skia.compile (http://build.chromium.org/p/client.skia.compile/builders/Build-Win-VS2013-x86-Debug-Trybot/builds/167)
6 years, 2 months ago (2014-10-22 16:27:08 UTC) #8
scroggo
On 2014/10/22 16:27:08, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 2 months ago (2014-10-22 17:30:02 UTC) #9
scroggo
On 2014/10/22 16:27:08, I haz the power (commit-bot) wrote: > Try jobs failed on following ...
6 years, 2 months ago (2014-10-22 17:30:02 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/647023006/120001
6 years, 2 months ago (2014-10-22 18:58:23 UTC) #12
commit-bot: I haz the power
6 years, 2 months ago (2014-10-22 19:07:04 UTC) #13
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as 2a1208017dd676f94a53bbb228197c3978dbdd8a

Powered by Google App Engine
This is Rietveld 408576698