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

Side by Side Diff: remoting/test/scroll_frame_generator.cc

Issue 2431513003: Revert of Don't use barcodes in ProtocolPerfTests (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « remoting/test/scroll_frame_generator.h ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "remoting/test/scroll_frame_generator.h" 5 #include "remoting/test/scroll_frame_generator.h"
6 6
7 #include "remoting/test/frame_generator_util.h" 7 #include "remoting/test/frame_generator_util.h"
8 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" 8 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
9 9
10 namespace remoting { 10 namespace remoting {
(...skipping 23 matching lines...) Expand all
34 webrtc::DesktopRect::MakeLTRB( 34 webrtc::DesktopRect::MakeLTRB(
35 0, 0, base_frame_->size().width(), top_height)); 35 0, 0, base_frame_->size().width(), top_height));
36 result->CopyPixelsFrom( 36 result->CopyPixelsFrom(
37 *base_frame_, webrtc::DesktopVector(0, 0), 37 *base_frame_, webrtc::DesktopVector(0, 0),
38 webrtc::DesktopRect::MakeLTRB(0, top_height, base_frame_->size().width(), 38 webrtc::DesktopRect::MakeLTRB(0, top_height, base_frame_->size().width(),
39 base_frame_->size().height())); 39 base_frame_->size().height()));
40 40
41 result->mutable_updated_region()->SetRect( 41 result->mutable_updated_region()->SetRect(
42 webrtc::DesktopRect::MakeSize(result->size())); 42 webrtc::DesktopRect::MakeSize(result->size()));
43 43
44 ++last_frame_id_;
45 frame_timestamp_[last_frame_id_] = now;
46 DrawBarcode(last_frame_id_, true, result.get());
47
44 return result; 48 return result;
45 } 49 }
46 50
47 protocol::InputEventTimestamps ScrollFrameGenerator::TakeLastEventTimestamps() { 51 base::TimeDelta ScrollFrameGenerator::GetFrameLatency(
48 base::TimeTicks now = base::TimeTicks::Now(); 52 const webrtc::DesktopFrame& frame) {
49 return protocol::InputEventTimestamps{now, now}; 53 int frame_id = ReadBarcode(frame);
54 if (!frame_timestamp_.count(frame_id))
55 LOG(FATAL) << "Unknown frame_id.";
56 return base::TimeTicks::Now() - frame_timestamp_[frame_id];
50 } 57 }
51 58
52 } // namespace test 59 } // namespace test
53 } // namespace remoting 60 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/scroll_frame_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698