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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 if (resources.empty()) | 506 if (resources.empty()) |
507 return; | 507 return; |
508 std::copy(resources.begin(), | 508 std::copy(resources.begin(), |
509 resources.end(), | 509 resources.end(), |
510 std::back_inserter(surface_returned_resources_)); | 510 std::back_inserter(surface_returned_resources_)); |
511 if (!pending_delegated_ack_count_) | 511 if (!pending_delegated_ack_count_) |
512 SendReturnedDelegatedResources(last_output_surface_id_); | 512 SendReturnedDelegatedResources(last_output_surface_id_); |
513 } | 513 } |
514 | 514 |
515 void DelegatedFrameHost::EvictDelegatedFrame() { | 515 void DelegatedFrameHost::EvictDelegatedFrame() { |
516 client_->GetLayer()->SetShowPaintedContent(); | 516 client_->GetLayer()->SetShowSolidColorContent(); |
517 frame_provider_ = NULL; | 517 frame_provider_ = NULL; |
518 if (!surface_id_.is_null()) { | 518 if (!surface_id_.is_null()) { |
519 surface_factory_->Destroy(surface_id_); | 519 surface_factory_->Destroy(surface_id_); |
520 surface_id_ = cc::SurfaceId(); | 520 surface_id_ = cc::SurfaceId(); |
521 } | 521 } |
522 delegated_frame_evictor_->DiscardedFrame(); | 522 delegated_frame_evictor_->DiscardedFrame(); |
523 } | 523 } |
524 | 524 |
525 // static | 525 // static |
526 void DelegatedFrameHost::CopyFromCompositingSurfaceHasResult( | 526 void DelegatedFrameHost::CopyFromCompositingSurfaceHasResult( |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 if (frame_provider_.get()) { | 982 if (frame_provider_.get()) { |
983 new_layer->SetShowDelegatedContent(frame_provider_.get(), | 983 new_layer->SetShowDelegatedContent(frame_provider_.get(), |
984 current_frame_size_in_dip_); | 984 current_frame_size_in_dip_); |
985 } | 985 } |
986 if (!surface_id_.is_null()) { | 986 if (!surface_id_.is_null()) { |
987 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); | 987 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); |
988 } | 988 } |
989 } | 989 } |
990 | 990 |
991 } // namespace content | 991 } // namespace content |
OLD | NEW |