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

Issue 1212593003: Destroy SkScanlineDecoder in the SkCodec subclass destructors (Closed)

Created:
5 years, 5 months ago by msarett
Modified:
5 years, 5 months ago
Reviewers:
scroggo, emmaleer, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

In the case of subset decodes, we will often not decode to the bottom of the image. In our code before this patch, this would result in cleanup code in onFinish() never being called. We can allow subclasses to take ownership of the SkScanlineDecoder in order to make sure that it is finished/deleted before deleting the decode manager. BUG=skia: Committed: https://skia.googlesource.com/skia/+/c0e80c139e15496a8a96eec7848689b6f0e7bcc1

Patch Set 1 #

Total comments: 6

Patch Set 2 : Fixes and a test #

Total comments: 4

Patch Set 3 : Detachable SkScanlineDecoder #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -42 lines) Patch
M include/codec/SkCodec.h View 1 2 1 chunk +20 lines, -3 lines 0 comments Download
M include/codec/SkScanlineDecoder.h View 1 2 4 chunks +16 lines, -20 lines 2 comments Download
M src/codec/SkCodec_libpng.cpp View 1 2 5 chunks +13 lines, -9 lines 0 comments Download
M src/codec/SkJpegCodec.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M src/codec/SkJpegCodec.cpp View 1 2 3 chunks +26 lines, -10 lines 2 comments Download
M tests/CodexTest.cpp View 1 2 1 chunk +4 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (3 generated)
msarett
5 years, 5 months ago (2015-06-29 21:17:16 UTC) #2
reed1
https://codereview.chromium.org/1212593003/diff/1/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/1212593003/diff/1/include/codec/SkCodec.h#newcode182 include/codec/SkCodec.h:182: * Get method for the scanline decoder nit: lets ...
5 years, 5 months ago (2015-06-29 21:21:49 UTC) #3
scroggo
Please add tests. (If it is convenient, you can add them to tests/CodexTest.cpp, or you ...
5 years, 5 months ago (2015-06-29 21:33:22 UTC) #4
msarett
The test I added makes sure that we return an error when a regular decode ...
5 years, 5 months ago (2015-06-29 21:59:43 UTC) #5
scroggo
https://codereview.chromium.org/1212593003/diff/20001/include/codec/SkScanlineDecoder.h File include/codec/SkScanlineDecoder.h (right): https://codereview.chromium.org/1212593003/diff/20001/include/codec/SkScanlineDecoder.h#newcode21 include/codec/SkScanlineDecoder.h:21: this->onFinish(); I almost missed this: you shouldn't call a ...
5 years, 5 months ago (2015-06-30 13:47:38 UTC) #6
scroggo
https://codereview.chromium.org/1212593003/diff/20001/src/codec/SkCodec_libpng.cpp File src/codec/SkCodec_libpng.cpp (right): https://codereview.chromium.org/1212593003/diff/20001/src/codec/SkCodec_libpng.cpp#newcode520 src/codec/SkCodec_libpng.cpp:520: return kInvalidInput; This is intended to mean that the ...
5 years, 5 months ago (2015-06-30 14:50:17 UTC) #7
msarett
This CL has changed quite a bit due to problems that came up in the ...
5 years, 5 months ago (2015-06-30 20:43:05 UTC) #9
scroggo
lgtm You'll still need mike's approval for API change. https://codereview.chromium.org/1212593003/diff/60001/include/codec/SkScanlineDecoder.h File include/codec/SkScanlineDecoder.h (right): https://codereview.chromium.org/1212593003/diff/60001/include/codec/SkScanlineDecoder.h#newcode32 include/codec/SkScanlineDecoder.h:32: ...
5 years, 5 months ago (2015-06-30 20:59:58 UTC) #10
msarett
https://codereview.chromium.org/1212593003/diff/60001/include/codec/SkScanlineDecoder.h File include/codec/SkScanlineDecoder.h (right): https://codereview.chromium.org/1212593003/diff/60001/include/codec/SkScanlineDecoder.h#newcode32 include/codec/SkScanlineDecoder.h:32: virtual ~SkScanlineDecoder() {} On 2015/06/30 20:59:58, scroggo wrote: > ...
5 years, 5 months ago (2015-06-30 21:33:00 UTC) #11
reed1
api lgtm I have broader questions, but not specific to this CL
5 years, 5 months ago (2015-07-01 13:37:34 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1212593003/60001
5 years, 5 months ago (2015-07-01 13:43:42 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:60001) as https://skia.googlesource.com/skia/+/c0e80c139e15496a8a96eec7848689b6f0e7bcc1
5 years, 5 months ago (2015-07-01 13:50:40 UTC) #15
scroggo
5 years, 5 months ago (2015-07-01 14:08:44 UTC) #16
Message was sent while issue was closed.
LGTM as is

Powered by Google App Engine
This is Rietveld 408576698