|
Qualify the return value of SkImageDecoder::decode
Add a new enum to differentiate between a complete decode and a
partial decode (with the third value being failure). Return this
value from SkImageDecoder::onDecode (in all subclasses, plus
SkImageDecoder_empty) and ::decode.
For convenience, if the enum is treated as a boolean, success and
partial success are both considered true.
Note that the static helper functions (DecodeFile etc) still return
true and false (for one thing, this allows us to continue to use
SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in
SkPicture::CreateFromStream).
Also correctly report failure in SkASTCImageDecoder::onDecode when
SkTextureCompressor::DecompressBufferFromFormat fails.
BUG= skia:3037
BUG:b/17419670
Committed: https://skia.googlesource.com/skia/+/2a1208017dd676f94a53bbb228197c3978dbdd8a
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+229 lines, -169 lines) |
Patch |
|
M |
bench/SkipZeroesBench.cpp
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
|
M |
include/core/SkImageDecoder.h
|
View
|
1
2
|
3 chunks |
+17 lines, -4 lines |
0 comments
|
Download
|
|
M |
samplecode/SampleUnpremul.cpp
|
View
|
1
2
3
4
5
6
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/images/SkDecodingImageGenerator.cpp
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder.cpp
|
View
|
1
2
3
|
3 chunks |
+8 lines, -7 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_astc.cpp
|
View
|
|
9 chunks |
+12 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_ktx.cpp
|
View
|
|
12 chunks |
+19 lines, -19 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libbmp.cpp
|
View
|
|
6 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libgif.cpp
|
View
|
|
8 chunks |
+10 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libico.cpp
|
View
|
|
9 chunks |
+26 lines, -17 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libjpeg.cpp
|
View
|
1
|
21 chunks |
+56 lines, -32 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libpng.cpp
|
View
|
|
8 chunks |
+11 lines, -11 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_libwebp.cpp
|
View
|
|
5 chunks |
+21 lines, -10 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_pkm.cpp
|
View
|
|
6 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
src/images/SkImageDecoder_wbmp.cpp
|
View
|
|
6 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/images/SkScaledBitmapSampler.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
src/ports/SkImageDecoder_CG.cpp
|
View
|
|
4 chunks |
+8 lines, -8 lines |
0 comments
|
Download
|
|
M |
src/ports/SkImageDecoder_WIC.cpp
|
View
|
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
|
M |
src/ports/SkImageDecoder_empty.cpp
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
tests/ImageDecodingTest.cpp
|
View
|
1
2
3
4
|
3 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
Total messages: 13 (4 generated)
|