Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/delegated_frame_host.h" | 5 #include "content/browser/compositor/delegated_frame_host.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
| 10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 384 surface_factory_->Destroy(surface_id_); | 384 surface_factory_->Destroy(surface_id_); |
| 385 surface_id_ = id_allocator_->GenerateId(); | 385 surface_id_ = id_allocator_->GenerateId(); |
| 386 surface_factory_->Create(surface_id_, frame_size); | 386 surface_factory_->Create(surface_id_, frame_size); |
| 387 client_->GetLayer()->SetShowSurface(surface_id_, frame_size_in_dip); | 387 client_->GetLayer()->SetShowSurface(surface_id_, frame_size_in_dip); |
| 388 current_surface_size_ = frame_size; | 388 current_surface_size_ = frame_size; |
| 389 modified_layers = true; | 389 modified_layers = true; |
| 390 } | 390 } |
| 391 scoped_ptr<cc::CompositorFrame> compositor_frame = | 391 scoped_ptr<cc::CompositorFrame> compositor_frame = |
| 392 make_scoped_ptr(new cc::CompositorFrame()); | 392 make_scoped_ptr(new cc::CompositorFrame()); |
| 393 compositor_frame->delegated_frame_data = frame_data.Pass(); | 393 compositor_frame->delegated_frame_data = frame_data.Pass(); |
| 394 | |
| 395 std::vector<ui::LatencyInfo>::const_iterator it; | |
| 396 for (it = latency_info.begin(); it != latency_info.end(); ++it) | |
| 397 compositor_frame->metadata.latency_info.push_back(*it); | |
|
danakj
2014/09/23 19:48:27
can you use compositor_frame->metadata.latency_inf
jbauman
2014/09/23 19:57:24
Done.
| |
| 398 for (it = skipped_latency_info_list_.begin(); | |
| 399 it != skipped_latency_info_list_.end(); | |
| 400 ++it) | |
| 401 compositor_frame->metadata.latency_info.push_back(*it); | |
|
danakj
2014/09/23 19:48:27
same here?
jbauman
2014/09/23 19:57:24
Moved above the other, and used swap instead.
| |
| 402 skipped_latency_info_list_.clear(); | |
| 403 | |
| 394 base::Closure ack_callback; | 404 base::Closure ack_callback; |
| 395 if (compositor) { | 405 if (compositor) { |
| 396 ack_callback = base::Bind(&DelegatedFrameHost::SendDelegatedFrameAck, | 406 ack_callback = base::Bind(&DelegatedFrameHost::SendDelegatedFrameAck, |
| 397 AsWeakPtr(), | 407 AsWeakPtr(), |
| 398 output_surface_id); | 408 output_surface_id); |
| 399 } | 409 } |
| 400 surface_factory_->SubmitFrame( | 410 surface_factory_->SubmitFrame( |
| 401 surface_id_, compositor_frame.Pass(), ack_callback); | 411 surface_id_, compositor_frame.Pass(), ack_callback); |
| 402 } else { | 412 } else { |
| 403 if (!resource_collection_.get()) { | 413 if (!resource_collection_.get()) { |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 979 if (frame_provider_.get()) { | 989 if (frame_provider_.get()) { |
| 980 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 990 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
| 981 current_frame_size_in_dip_); | 991 current_frame_size_in_dip_); |
| 982 } | 992 } |
| 983 if (!surface_id_.is_null()) { | 993 if (!surface_id_.is_null()) { |
| 984 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 994 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
| 985 } | 995 } |
| 986 } | 996 } |
| 987 | 997 |
| 988 } // namespace content | 998 } // namespace content |
| OLD | NEW |