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

Unified Diff: third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp

Issue 2880533002: ImageDecodeBench packeted runs should resume decoding where it left off (Closed)
Patch Set: Remove ClearCacheExceptFrame & calls to SetData to reset and clear Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
diff --git a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
index 4ef02ef74e1dbe60c1868871e3dfae3e2aab0fa7..11742a16be9d362831a00d0c6d9890075da9d734 100644
--- a/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
+++ b/third_party/WebKit/Source/platform/testing/ImageDecodeBench.cpp
@@ -226,6 +226,7 @@ bool DecodeImageData(SharedBuffer* data,
RefPtr<SharedBuffer> packet_data = SharedBuffer::Create();
size_t position = 0;
+ size_t next_frame_to_decode = 0;
while (true) {
const char* packet;
size_t length = data->GetSomeData(packet, position);
@@ -237,9 +238,10 @@ bool DecodeImageData(SharedBuffer* data,
bool all_data_received = position == data->size();
decoder->SetData(packet_data.Get(), all_data_received);
- int frame_count = decoder->FrameCount();
- for (int i = 0; i < frame_count; ++i) {
- if (!decoder->FrameBufferAtIndex(i))
+ size_t frame_count = decoder->FrameCount();
+ for (; next_frame_to_decode < frame_count; ++next_frame_to_decode) {
+ ImageFrame* frame = decoder->FrameBufferAtIndex(next_frame_to_decode);
+ if (frame->GetStatus() != ImageFrame::kFrameComplete)
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698