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

Issue 22861028: Handle SkStream::rewind properly. (Closed)

Created:
7 years, 4 months ago by scroggo
Modified:
7 years, 3 months ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Handle SkStream::rewind properly. include/core/SkStream.h: Update documentation to state that rewinding a stream at the beginning should return true. This is important because our decoders fail if rewind returns false, assuming that the stream is not at the beginning. src/images/SkImageDecoder_libpng.cpp: If rewind fails, call png_error. src/images/SkImageDecoder_libwebp.cpp: If rewind fails, report an error and return false. src/images/SkImageRef.cpp: If rewind fails report an error and return false. FIXME: Need to handle flattening properly. Should I perhaps move writeStream into SkOrderedWriteBuffer? src/images/SkJpegUtility.cpp: Report a jpeg error on failure to rewind. BUG=https://b.corp.google.com/issue?id=8432093 R=bungeman@google.com, djsollen@google.com, reed@google.com Committed: https://code.google.com/p/skia/source/detail?r=10977

Patch Set 1 #

Total comments: 9

Patch Set 2 : Update comment. #

Patch Set 3 : SkDEBUGF -> SkDebugf #

Patch Set 4 : Improve comments in SkImageRef.cpp #

Patch Set 5 : New comment for rewind. #

Total comments: 1

Patch Set 6 : More fine-tuning lawyer-ese. #

Total comments: 2

Patch Set 7 : More refinement. #

Total comments: 2

Patch Set 8 : Another comment rewrite. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -9 lines) Patch
M include/core/SkStream.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -1 line 0 comments Download
M src/images/SkImageDecoder_libpng.cpp View 1 chunk +3 lines, -1 line 0 comments Download
M src/images/SkImageDecoder_libwebp.cpp View 1 2 2 chunks +9 lines, -2 lines 0 comments Download
M src/images/SkImageRef.cpp View 1 2 3 2 chunks +15 lines, -3 lines 0 comments Download
M src/images/SkJpegUtility.cpp View 2 chunks +9 lines, -2 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
scroggo
7 years, 4 months ago (2013-08-22 19:54:02 UTC) #1
djsollen
https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * Return true if the stream is already at ...
7 years, 4 months ago (2013-08-22 19:59:17 UTC) #2
bungeman-skia
https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * Return true if the stream is already at ...
7 years, 4 months ago (2013-08-22 20:19:00 UTC) #3
bungeman-skia
https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * Return true if the stream is already at ...
7 years, 4 months ago (2013-08-22 20:42:45 UTC) #4
djsollen
https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * Return true if the stream is already at ...
7 years, 4 months ago (2013-08-23 12:15:13 UTC) #5
scroggo
https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/1/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * Return true if the stream is already at ...
7 years, 4 months ago (2013-08-23 21:14:07 UTC) #6
djsollen
lgtm https://codereview.chromium.org/22861028/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22861028/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode203 src/images/SkImageDecoder_libwebp.cpp:203: SkDEBUGF(("Failed to rewind webp stream!")); On 2013/08/23 21:14:07, ...
7 years, 4 months ago (2013-08-25 17:47:19 UTC) #7
scroggo
https://codereview.chromium.org/22861028/diff/1/src/images/SkImageDecoder_libwebp.cpp File src/images/SkImageDecoder_libwebp.cpp (right): https://codereview.chromium.org/22861028/diff/1/src/images/SkImageDecoder_libwebp.cpp#newcode203 src/images/SkImageDecoder_libwebp.cpp:203: SkDEBUGF(("Failed to rewind webp stream!")); On 2013/08/25 17:47:19, djsollen ...
7 years, 3 months ago (2013-08-26 16:37:46 UTC) #8
djsollen
lgtm
7 years, 3 months ago (2013-08-26 19:17:36 UTC) #9
scroggo
New patch, new comment for rewind() https://codereview.chromium.org/22861028/diff/24001/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/24001/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * and after ...
7 years, 3 months ago (2013-08-26 20:44:31 UTC) #10
bungeman-skia
I'm language lawyared out. https://codereview.chromium.org/22861028/diff/23006/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/23006/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * is NOT at the ...
7 years, 3 months ago (2013-08-26 22:24:58 UTC) #11
scroggo
https://codereview.chromium.org/22861028/diff/23006/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/23006/include/core/SkStream.h#newcode100 include/core/SkStream.h:100: * is NOT at the beginning. On 2013/08/26 22:24:58, ...
7 years, 3 months ago (2013-08-27 19:49:26 UTC) #12
bungeman-skia
lgtm
7 years, 3 months ago (2013-08-27 19:55:17 UTC) #13
scroggo
Mike, can you do an API review?
7 years, 3 months ago (2013-08-27 19:58:34 UTC) #14
reed1
I find the comment above rewind() very lawyerly, and not "easy" to grok. https://codereview.chromium.org/22861028/diff/35001/include/core/SkStream.h File ...
7 years, 3 months ago (2013-08-27 20:00:36 UTC) #15
scroggo
https://codereview.chromium.org/22861028/diff/35001/include/core/SkStream.h File include/core/SkStream.h (right): https://codereview.chromium.org/22861028/diff/35001/include/core/SkStream.h#newcode104 include/core/SkStream.h:104: * * It is unknown whether the stream is ...
7 years, 3 months ago (2013-08-27 20:12:55 UTC) #16
scroggo
Please see the latest comment.
7 years, 3 months ago (2013-08-27 20:37:25 UTC) #17
reed1
lgtm
7 years, 3 months ago (2013-08-27 21:33:12 UTC) #18
scroggo
7 years, 3 months ago (2013-08-28 13:09:01 UTC) #19
Message was sent while issue was closed.
Committed patchset #8 manually as r10977 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698