Chromium Code Reviews| Index: cc/surfaces/surface.cc |
| diff --git a/cc/surfaces/surface.cc b/cc/surfaces/surface.cc |
| index 0e08ec4f5461c849b14bd8585c6a56476868900c..cec1e932f597eda5dd37159da164318a7e38f613 100644 |
| --- a/cc/surfaces/surface.cc |
| +++ b/cc/surfaces/surface.cc |
| @@ -33,6 +33,7 @@ Surface::~Surface() { |
| void Surface::QueueFrame(scoped_ptr<CompositorFrame> frame, |
| const base::Closure& callback) { |
| + TakeLatencyInfo(&frame->metadata.latency_info); |
| scoped_ptr<CompositorFrame> previous_frame = current_frame_.Pass(); |
| current_frame_ = frame.Pass(); |
| factory_->ReceiveFromChild( |
| @@ -60,6 +61,15 @@ const CompositorFrame* Surface::GetEligibleFrame() { |
| return current_frame_.get(); |
| } |
| +void Surface::TakeLatencyInfo(std::vector<ui::LatencyInfo>* latency_info) { |
| + if (!current_frame_) |
| + return; |
| + std::copy(current_frame_->metadata.latency_info.begin(), |
|
jamesr
2014/09/02 19:04:28
if we expect the dest to be empty (which i think i
|
| + current_frame_->metadata.latency_info.end(), |
| + std::back_inserter(*latency_info)); |
| + current_frame_->metadata.latency_info.clear(); |
| +} |
| + |
| void Surface::RunDrawCallbacks() { |
| if (!draw_callback_.is_null()) { |
| base::Closure callback = draw_callback_; |