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

Issue 930283002: Add SkCodec, including PNG implementation. (Closed)

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

Description

Add SkCodec, including PNG implementation. DM: Add a flag to use SkCodec instead of SkImageDecoder. SkCodec: Base class for codecs, allowing creation from an SkStream or an SkData. An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image. TODO: Add scanline iterator SkPngCodec: New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng. TODO: Handle other destination colortypes TODO: Substitute the transpose color TODO: Allow silencing warnings TODO: Use RGB instead of filler? TODO: sRGB SkSwizzler: Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling. TODO: Implement other swizzles. Requires a gclient sync to pull down libpng. BUG=skia:3257 Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49 (and then reverted) Committed: https://skia.googlesource.com/skia/+/f24f2247c25b842327e12c70e44efe4cc1b28dfa

Patch Set 1 #

Patch Set 2 : Now it compiles #

Patch Set 3 : Continued work. SkSwizzler is simplified SkScaledBitmapSampler. More png. #

Patch Set 4 : Compile fixes, presubmit fixes. #

Patch Set 5 : Various fixes #

Patch Set 6 : Now reads all of http://www.schaik.com/pngsuite/pngsuite.html without crashing. #

Patch Set 7 : Various fixes. #

Patch Set 8 : Passes all of pngSuite. #

Patch Set 9 : Various fixes #

Patch Set 10 : Handle rewinding. #

Total comments: 21

Patch Set 11 : Respond to Derek's comments on patch set 10 #

Patch Set 12 : Make SkPngCodec work on Mac! #

Total comments: 8

Patch Set 13 : Fix warning; return a value. #

Patch Set 14 : Respond to comments, fix stuff #

Patch Set 15 : Use the tagged commit. #

Patch Set 16 : Use 'copy' instead of 'cp' on windows. #

Total comments: 1

Patch Set 17 : Use python instead of copy (testing on windows) #

Patch Set 18 : On Android, make SkCodec build mainline libpng. #

Total comments: 2

Patch Set 19 : Separate target for libpng_static. #

Patch Set 20 : Patch Set 17 modulo small change to copy_file. #

Patch Set 21 : Hacky fix for iOS. #

Total comments: 1

Patch Set 22 : Do not build SkPngCodec on windows. #

Patch Set 23 : Restore Windows now that we're building zlib there. #

Patch Set 24 : Remove extraneous patch file. #

Total comments: 2

Patch Set 25 : Make generation its own target. #

Patch Set 26 : Check in prebuilt file directly #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1468 lines, -13 lines) Patch
M DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +5 lines, -3 lines 0 comments Download
M dm/DMSrcSink.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 3 chunks +32 lines, -3 lines 0 comments Download
A gyp/codec.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 19 22 1 chunk +29 lines, -0 lines 0 comments Download
M gyp/common_variables.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +6 lines, -5 lines 0 comments Download
M gyp/libpng.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 3 chunks +14 lines, -2 lines 0 comments Download
M gyp/skia_lib.gyp View 1 1 chunk +1 line, -0 lines 0 comments Download
A include/codec/SkCodec.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +92 lines, -0 lines 0 comments Download
A src/codec/SkCodec.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 22 1 chunk +50 lines, -0 lines 0 comments Download
A src/codec/SkCodec_libpng.h View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download
A src/codec/SkCodec_libpng.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +492 lines, -0 lines 0 comments Download
A src/codec/SkSwizzler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +94 lines, -0 lines 0 comments Download
A src/codec/SkSwizzler.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +221 lines, -0 lines 0 comments Download
A third_party/libpng/LICENSE View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +172 lines, -0 lines 0 comments Download
A third_party/libpng/README.google View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +16 lines, -0 lines 0 comments Download
A third_party/libpng/pnglibconf.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +210 lines, -0 lines 0 comments Download

Messages

Total messages: 37 (7 generated)
scroggo
PTAL There's still a lot of work to be done, but it at least works ...
5 years, 10 months ago (2015-02-25 14:17:02 UTC) #2
reed1
5 years, 10 months ago (2015-02-25 15:37:23 UTC) #4
djsollen
https://codereview.chromium.org/930283002/diff/180001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/930283002/diff/180001/dm/DMSrcSink.cpp#newcode66 dm/DMSrcSink.cpp:66: SkAutoLockPixels alp(bitmap); aren't the pixels locked during allocPixels if ...
5 years, 10 months ago (2015-02-25 16:02:20 UTC) #5
reed1
api lgtm I will try to add the getScaledSize call to SkImageGenerator, at which time ...
5 years, 10 months ago (2015-02-25 16:20:50 UTC) #6
scroggo
https://codereview.chromium.org/930283002/diff/180001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/930283002/diff/180001/dm/DMSrcSink.cpp#newcode66 dm/DMSrcSink.cpp:66: SkAutoLockPixels alp(bitmap); On 2015/02/25 16:02:19, djsollen wrote: > aren't ...
5 years, 10 months ago (2015-02-25 18:00:55 UTC) #7
scroggo
On 2015/02/25 14:17:02, scroggo wrote: > (One exception: it doesn't currently build on Mac. I'd ...
5 years, 10 months ago (2015-02-25 20:29:21 UTC) #8
djsollen
https://codereview.chromium.org/930283002/diff/180001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/930283002/diff/180001/include/codec/SkCodec.h#newcode85 include/codec/SkCodec.h:85: bool couldRewindIfNeeded(); On 2015/02/25 18:00:54, scroggo wrote: > On ...
5 years, 10 months ago (2015-02-25 20:52:15 UTC) #9
scroggo
https://codereview.chromium.org/930283002/diff/180001/include/codec/SkCodec.h File include/codec/SkCodec.h (right): https://codereview.chromium.org/930283002/diff/180001/include/codec/SkCodec.h#newcode85 include/codec/SkCodec.h:85: bool couldRewindIfNeeded(); On 2015/02/25 20:52:15, djsollen wrote: > On ...
5 years, 10 months ago (2015-02-25 21:33:52 UTC) #10
scroggo
https://codereview.chromium.org/930283002/diff/300001/gyp/libpng.gyp File gyp/libpng.gyp (right): https://codereview.chromium.org/930283002/diff/300001/gyp/libpng.gyp#newcode55 gyp/libpng.gyp:55: 'action': ['<(skia_copy)', '<(prebuilt)', '<(generated)'], This did not work on ...
5 years, 10 months ago (2015-02-26 00:58:00 UTC) #11
scroggo
mtklein@, My PNG decoder depends on libpng, which I'm trying to build as a static ...
5 years, 10 months ago (2015-02-26 16:05:20 UTC) #13
mtklein
On 2015/02/26 16:05:20, scroggo wrote: > mtklein@, > > My PNG decoder depends on libpng, ...
5 years, 10 months ago (2015-02-26 16:40:13 UTC) #14
scroggo
https://codereview.chromium.org/930283002/diff/180001/gyp/codec.gyp File gyp/codec.gyp (right): https://codereview.chromium.org/930283002/diff/180001/gyp/codec.gyp#newcode50 gyp/codec.gyp:50: 'android_deps.gyp:png', On 2015/02/25 18:00:54, scroggo wrote: > On 2015/02/25 ...
5 years, 10 months ago (2015-02-26 17:45:36 UTC) #15
scroggo
On 2015/02/26 17:45:36, scroggo wrote: > https://codereview.chromium.org/930283002/diff/180001/gyp/codec.gyp > File gyp/codec.gyp (right): > > https://codereview.chromium.org/930283002/diff/180001/gyp/codec.gyp#newcode50 > ...
5 years, 10 months ago (2015-02-26 18:08:28 UTC) #16
scroggo
On 2015/02/26 djsollen wrote: > On 2015/02/26 18:08:28, scroggo wrote: >> I didn't run into ...
5 years, 10 months ago (2015-02-26 18:45:43 UTC) #17
scroggo
On 2015/02/26 18:45:43, scroggo wrote: > On 2015/02/26 djsollen wrote: > > On 2015/02/26 18:08:28, ...
5 years, 10 months ago (2015-02-26 19:45:45 UTC) #18
scroggo
https://codereview.chromium.org/930283002/diff/400001/gyp/libpng.gyp File gyp/libpng.gyp (right): https://codereview.chromium.org/930283002/diff/400001/gyp/libpng.gyp#newcode41 gyp/libpng.gyp:41: 'PNG_ARM_NEON_OPT=0', Does someone who knows NEON better than I ...
5 years, 10 months ago (2015-02-26 20:34:21 UTC) #19
mtklein
https://codereview.chromium.org/930283002/diff/340001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/930283002/diff/340001/dm/DMSrcSink.cpp#newcode52 dm/DMSrcSink.cpp:52: SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); You might want to split off a ...
5 years, 10 months ago (2015-02-26 20:41:14 UTC) #20
scroggo
https://codereview.chromium.org/930283002/diff/340001/dm/DMSrcSink.cpp File dm/DMSrcSink.cpp (right): https://codereview.chromium.org/930283002/diff/340001/dm/DMSrcSink.cpp#newcode52 dm/DMSrcSink.cpp:52: SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(encoded)); On 2015/02/26 20:41:13, mtklein wrote: > You ...
5 years, 10 months ago (2015-02-26 21:00:12 UTC) #21
scroggo
On 2015/02/26 16:40:13, mtklein wrote: > On 2015/02/26 16:05:20, scroggo wrote: > > mtklein@, > ...
5 years, 10 months ago (2015-02-26 22:55:34 UTC) #22
mtklein
> If we cannot use miniz, I think we have the following options: I'm in ...
5 years, 10 months ago (2015-02-26 23:17:18 UTC) #23
scroggo
On 2015/02/26 23:17:18, mtklein wrote: > > If we cannot use miniz, I think we ...
5 years, 10 months ago (2015-02-26 23:23:41 UTC) #24
scroggo
On 2015/02/26 23:23:41, scroggo wrote: > On 2015/02/26 23:17:18, mtklein wrote: > > > If ...
5 years, 9 months ago (2015-03-02 17:01:30 UTC) #25
djsollen
lgtm https://codereview.chromium.org/930283002/diff/460001/DEPS File DEPS (right): https://codereview.chromium.org/930283002/diff/460001/DEPS#newcode21 DEPS:21: "third_party/externals/libpng" : "git://git.code.sf.net/p/libpng/code@070a616b8275277e18ef8ee91e2ca23f7bdc67d5", FYI...you can use the tag ...
5 years, 9 months ago (2015-03-02 20:08:42 UTC) #26
scroggo
https://codereview.chromium.org/930283002/diff/460001/DEPS File DEPS (right): https://codereview.chromium.org/930283002/diff/460001/DEPS#newcode21 DEPS:21: "third_party/externals/libpng" : "git://git.code.sf.net/p/libpng/code@070a616b8275277e18ef8ee91e2ca23f7bdc67d5", On 2015/03/02 20:08:42, djsollen wrote: > ...
5 years, 9 months ago (2015-03-02 20:09:58 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/930283002/460001
5 years, 9 months ago (2015-03-02 20:11:41 UTC) #30
commit-bot: I haz the power
Committed patchset #24 (id:460001) as https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49
5 years, 9 months ago (2015-03-02 20:23:53 UTC) #31
scroggo
A revert of this CL (patchset #24 id:460001) has been created in https://codereview.chromium.org/972743003/ by scroggo@google.com. ...
5 years, 9 months ago (2015-03-02 20:29:08 UTC) #32
scroggo
On 2015/03/02 20:29:08, scroggo wrote: > A revert of this CL (patchset #24 id:460001) has ...
5 years, 9 months ago (2015-03-03 16:50:44 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/930283002/500001
5 years, 9 months ago (2015-03-03 16:52:31 UTC) #36
commit-bot: I haz the power
5 years, 9 months ago (2015-03-03 16:59:24 UTC) #37
Message was sent while issue was closed.
Committed patchset #26 (id:500001) as
https://skia.googlesource.com/skia/+/f24f2247c25b842327e12c70e44efe4cc1b28dfa

Powered by Google App Engine
This is Rietveld 408576698