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 compositor_frame->metadata.latency_info.swap(skipped_latency_info_list_); |
| 396 compositor_frame->metadata.latency_info.insert( |
| 397 compositor_frame->metadata.latency_info.end(), |
| 398 latency_info.begin(), |
| 399 latency_info.end()); |
| 400 |
394 base::Closure ack_callback; | 401 base::Closure ack_callback; |
395 if (compositor) { | 402 if (compositor) { |
396 ack_callback = base::Bind(&DelegatedFrameHost::SendDelegatedFrameAck, | 403 ack_callback = base::Bind(&DelegatedFrameHost::SendDelegatedFrameAck, |
397 AsWeakPtr(), | 404 AsWeakPtr(), |
398 output_surface_id); | 405 output_surface_id); |
399 } | 406 } |
400 surface_factory_->SubmitFrame( | 407 surface_factory_->SubmitFrame( |
401 surface_id_, compositor_frame.Pass(), ack_callback); | 408 surface_id_, compositor_frame.Pass(), ack_callback); |
402 } else { | 409 } else { |
403 if (!resource_collection_.get()) { | 410 if (!resource_collection_.get()) { |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
979 if (frame_provider_.get()) { | 986 if (frame_provider_.get()) { |
980 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 987 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
981 current_frame_size_in_dip_); | 988 current_frame_size_in_dip_); |
982 } | 989 } |
983 if (!surface_id_.is_null()) { | 990 if (!surface_id_.is_null()) { |
984 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 991 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
985 } | 992 } |
986 } | 993 } |
987 | 994 |
988 } // namespace content | 995 } // namespace content |
OLD | NEW |