DescriptionAdd timing SkCodec to nanobench.
CodecBench:
Add new class for timing using SkCodec.
DecodingBench:
Include creating a decoder inside the loop. This is to have a better
comparison against SkCodec. SkCodec's factory function does not
necessarily read the same amount as SkImageDecoder's, so in order to
have a meaningful comparison, read the entire stream from the
beginning. Also for comparison, create a new SkStream from the
SkData each time.
Add a debugging check to make sure we have an SkImageDecoder.
Add include guards.
nanobench.cpp:
Decode using SkCodec.
When decoding using SkImageDecoder, exclude benches where we decoded
to a different color type than requested. SkImageDecoder may decide to
decode to a different type, in which case the name is misleading.
TODOs:
Now that we ignore color types that do not match the desired
color type, we should add Index8. This also means calling the more
complex version of getPixels so CodecBench can support kIndex8.
BUG=skia:3257
Committed: https://skia.googlesource.com/skia/+/60869a42a133942f852dd0f1696444c2a5c9ad83
Patch Set 1 #
Total comments: 18
Patch Set 2 : Move allocation outside of the loop. #
Total comments: 4
Patch Set 3 : Use SkData in CodecBench instead of SkStream. #Patch Set 4 : Use SkData in DecodingBench as well. #Patch Set 5 : Do not leak fData. #Patch Set 6 : CodecBench decodes to fColorType, as intended. #
Messages
Total messages: 22 (6 generated)
|