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

Unified Diff: tests/CodecPartialTest.cpp

Issue 2447863002: Report repetition count in SkCodec (Closed)
Patch Set: Return a bool, with multiple out parameters Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/CodecPartialTest.cpp
diff --git a/tests/CodecPartialTest.cpp b/tests/CodecPartialTest.cpp
index 22d4e7b594dec186e8543899a31c86cb0c7d5ae2..ff91c642e2d8bec0b71dc6ed91ec16e5fa219db9 100644
--- a/tests/CodecPartialTest.cpp
+++ b/tests/CodecPartialTest.cpp
@@ -216,7 +216,15 @@ DEF_TEST(Codec_partialAnim, r) {
// getFrameInfo lets us do this, since it tells the number of frames
// not considering whether they are complete.
// FIXME: Should we use a different Result?
- if (fullCodec->getFrameInfo().size() > i) {
+ const size_t frameCount = [&fullCodec]() -> size_t {
+ std::vector<SkCodec::FrameInfo> frameInfos;
+ if (!fullCodec->getFrameInfo(&frameInfos, nullptr)) {
+ return 0;
+ }
+ return frameInfos.size();
+ }();
+
+ if (frameCount > i) {
// This is a partial frame.
frames.push_back(frame);
}
« include/codec/SkCodec.h ('K') | « tests/CodecAnimTest.cpp ('k') | tests/CodecTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698