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

Side by Side Diff: media/gpu/video_decode_accelerator_unittest.cc

Issue 2518463002: vda_unittest: Verify the visible rectangle of returned picture. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // The bulk of this file is support code; sorry about that. Here's an overview 5 // The bulk of this file is support code; sorry about that. Here's an overview
6 // to hopefully help readers of this code: 6 // to hopefully help readers of this code:
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or
8 // Win/EGL. 8 // Win/EGL.
9 // - ClientState is an enum for the state of the decode client used by the test. 9 // - ClientState is an enum for the state of the decode client used by the test.
10 // - ClientStateNotification is a barrier abstraction that allows the test code 10 // - ClientStateNotification is a barrier abstraction that allows the test code
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
719 LOG_ASSERT(1U == active_textures_.erase(picture_buffer_id)); 719 LOG_ASSERT(1U == active_textures_.erase(picture_buffer_id));
720 } 720 }
721 721
722 void GLRenderingVDAClient::PictureReady(const Picture& picture) { 722 void GLRenderingVDAClient::PictureReady(const Picture& picture) {
723 // We shouldn't be getting pictures delivered after Reset has completed. 723 // We shouldn't be getting pictures delivered after Reset has completed.
724 LOG_ASSERT(state_ < CS_RESET); 724 LOG_ASSERT(state_ < CS_RESET);
725 725
726 if (decoder_deleted()) 726 if (decoder_deleted())
727 return; 727 return;
728 728
729 gfx::Rect visible_rect = picture.visible_rect();
730 EXPECT_TRUE(visible_rect.IsEmpty() || visible_rect == gfx::Rect(frame_size_));
731
729 base::TimeTicks now = base::TimeTicks::Now(); 732 base::TimeTicks now = base::TimeTicks::Now();
730 733
731 frame_delivery_times_.push_back(now); 734 frame_delivery_times_.push_back(now);
732 735
733 // Save the decode time of this picture. 736 // Save the decode time of this picture.
734 std::map<int, base::TimeTicks>::iterator it = 737 std::map<int, base::TimeTicks>::iterator it =
735 decode_start_time_.find(picture.bitstream_buffer_id()); 738 decode_start_time_.find(picture.bitstream_buffer_id());
736 ASSERT_NE(decode_start_time_.end(), it); 739 ASSERT_NE(decode_start_time_.end(), it);
737 decode_time_.push_back(now - it->second); 740 decode_time_.push_back(now - it->second);
738 decode_start_time_.erase(it); 741 decode_start_time_.erase(it);
(...skipping 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after
1804 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 1807 media::DXVAVideoDecodeAccelerator::PreSandboxInitialization();
1805 #endif 1808 #endif
1806 1809
1807 media::g_env = 1810 media::g_env =
1808 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( 1811 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>(
1809 testing::AddGlobalTestEnvironment( 1812 testing::AddGlobalTestEnvironment(
1810 new media::VideoDecodeAcceleratorTestEnvironment())); 1813 new media::VideoDecodeAcceleratorTestEnvironment()));
1811 1814
1812 return RUN_ALL_TESTS(); 1815 return RUN_ALL_TESTS();
1813 } 1816 }
OLDNEW
« 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