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

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: Making the packeted test more closely mimic cache clearing and resetting data 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..9fc57c794207db0f0656bb22664ae52753ff4d17 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);
@@ -235,12 +236,14 @@ bool DecodeImageData(SharedBuffer* data,
position += length;
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) {
+ decoder->SetData(packet_data.Get(), all_data_received);
+ ImageFrame* frame = decoder->FrameBufferAtIndex(next_frame_to_decode);
+ if (frame->GetStatus() != ImageFrame::kFrameComplete)
scroggo_chromium 2017/05/15 12:48:28 I think this belongs at the end of the loop. Notic
cblume 2017/05/15 20:55:09 This is effectively done now that the SetData rese
break;
+ decoder->SetData(PassRefPtr<SegmentReader>(nullptr), false);
+ decoder->ClearCacheExceptFrame(next_frame_to_decode);
scroggo_chromium 2017/05/15 12:48:28 I'm ambivalent about adding ClearCacheExceptFrame
cblume 2017/05/15 17:39:11 I agree with you. This runs the risk of becoming o
scroggo_chromium 2017/05/15 18:09:22 Where is the integration test? FWIW, I added the
}
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