|
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
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
|
Total messages: 7 (2 generated)
|