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

Unified Diff: remoting/test/cyclic_frame_generator.cc

Issue 2420183002: 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 side-by-side diff with in-line comments
Download patch
Index: remoting/test/cyclic_frame_generator.cc
diff --git a/remoting/test/cyclic_frame_generator.cc b/remoting/test/cyclic_frame_generator.cc
index 11c8bc57a2d8eb4d46983cb8c261a4d026713968..1056ca5193098185b809235969c0b464978cfcbc 100644
--- a/remoting/test/cyclic_frame_generator.cc
+++ b/remoting/test/cyclic_frame_generator.cc
@@ -48,6 +48,7 @@ void CyclicFrameGenerator::SetTickClock(base::TickClock* tick_clock) {
std::unique_ptr<webrtc::DesktopFrame> CyclicFrameGenerator::GenerateFrame(
webrtc::SharedMemoryFactory* shared_memory_factory) {
base::TimeTicks now = clock_->NowTicks();
+
int frame_id = (now - started_time_) / cursor_blink_period_;
int reference_frame =
((now - started_time_) / frame_cycle_period_) % reference_frames_.size();
@@ -80,20 +81,15 @@ std::unique_ptr<webrtc::DesktopFrame> CyclicFrameGenerator::GenerateFrame(
last_frame_type_ = ChangeType::NO_CHANGES;
}
- if (draw_barcode_)
- DrawBarcode(frame_id, frame_id != last_frame_id_, frame.get());
-
last_reference_frame_ = reference_frame;
last_cursor_state_ = cursor_state;
- last_frame_id_ = frame_id;
return frame;
}
CyclicFrameGenerator::ChangeInfoList CyclicFrameGenerator::GetChangeList(
- webrtc::DesktopFrame* frame) {
- CHECK(draw_barcode_);
- int frame_id = ReadBarcode(*frame);
+ base::TimeTicks timestamp) {
+ int frame_id = (timestamp - started_time_) / cursor_blink_period_;
CHECK_GE(frame_id, last_identifier_frame_);
ChangeInfoList result;
@@ -110,5 +106,11 @@ CyclicFrameGenerator::ChangeInfoList CyclicFrameGenerator::GetChangeList(
return result;
}
+protocol::InputEventTimestamps CyclicFrameGenerator::TakeLastEventTimestamps() {
+ base::TimeTicks now = clock_->NowTicks();
+ return protocol::InputEventTimestamps{.client_timestamp = now,
+ .host_timestamp = now};
+}
+
} // namespace test
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698