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

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: 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..14d42f1cdf17b6aac12ae9cb9e3d9dfe7d71af6e 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);
@@ -238,9 +239,11 @@ bool DecodeImageData(SharedBuffer* data,
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))
+ for (int i = next_frame_to_decode; i < frame_count; ++i) {
scroggo 2017/05/11 13:56:23 FWIW, starting from frame 0 doesn't re-decode thos
cblume 2017/05/11 15:45:31 Ah. I agree. Since I believe this test is aimed a
+ if (!decoder->FrameBufferAtIndex(i)) {
+ next_frame_to_decode = i;
break;
+ }
}
if (all_data_received || decoder->Failed())
« 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