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

Issue 1288483002: Consolidate SkCodec functions for handling rewind (Closed)

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

Description

Consolidate SkCodec functions for handling rewind Previously, many of our codec implementations followed the same pattern (often in a function named handleRewind): switch (this->rewindIfNeeded()) { case CouldNotRewind: return CouldNotRewind; case NoRewindNecessary: // keep going break; case Rewound: <re-read header etc> break; } In this CL, remove the enum, and put the piece that happens in the Rewound case into a virtual function, onRewind. rewindIfNeeded now contains the common pieces from various functions named handleRewind. In SkBmpCodec, add a function that returns whether the BMP is in ICO, so it can have a common implementation for onRewind. BUG=skia:3257 Committed: https://skia.googlesource.com/skia/+/b427db1d457a083f2652756a453fbb91bc6a7447

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+93 lines, -132 lines) Patch
M include/codec/SkCodec.h View 1 chunk +14 lines, -13 lines 0 comments Download
M src/codec/SkBmpCodec.h View 1 chunk +10 lines, -2 lines 2 comments Download
M src/codec/SkBmpCodec.cpp View 1 chunk +2 lines, -13 lines 0 comments Download
M src/codec/SkBmpMaskCodec.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkBmpRLECodec.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkBmpStandardCodec.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/codec/SkBmpStandardCodec.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/codec/SkCodec.cpp View 1 chunk +8 lines, -4 lines 0 comments Download
M src/codec/SkCodec_libgif.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/codec/SkCodec_libgif.cpp View 2 chunks +12 lines, -10 lines 0 comments Download
M src/codec/SkCodec_libpng.h View 2 chunks +1 line, -2 lines 0 comments Download
M src/codec/SkCodec_libpng.cpp View 5 chunks +20 lines, -29 lines 0 comments Download
M src/codec/SkCodec_wbmp.h View 1 chunk +1 line, -6 lines 0 comments Download
M src/codec/SkCodec_wbmp.cpp View 3 chunks +4 lines, -12 lines 0 comments Download
M src/codec/SkJpegCodec.h View 2 chunks +2 lines, -5 lines 0 comments Download
M src/codec/SkJpegCodec.cpp View 3 chunks +9 lines, -23 lines 0 comments Download
M src/codec/SkWebpCodec.cpp View 1 chunk +2 lines, -10 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
scroggo_chromium
Derek, I need your approval for the API change. Feel free to look at the ...
5 years, 4 months ago (2015-08-11 16:29:42 UTC) #2
djsollen
api lgtm
5 years, 4 months ago (2015-08-11 19:27:50 UTC) #3
msarett
lgtm Thanks for doing this! I know we've been talking about needing to clean this ...
5 years, 4 months ago (2015-08-12 13:38:46 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1288483002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1288483002/1
5 years, 4 months ago (2015-08-12 14:16:48 UTC) #6
commit-bot: I haz the power
5 years, 4 months ago (2015-08-12 14:24:16 UTC) #7
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://skia.googlesource.com/skia/+/b427db1d457a083f2652756a453fbb91bc6a7447

Powered by Google App Engine
This is Rietveld 408576698