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/renderer_host/delegated_frame_host.h" | 5 #include "content/browser/renderer_host/delegated_frame_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 bool is_swap_ack) { | 532 bool is_swap_ack) { |
533 client_->DelegatedFrameHostSendReclaimCompositorResources( | 533 client_->DelegatedFrameHostSendReclaimCompositorResources( |
534 output_surface_id, is_swap_ack, surface_returned_resources_); | 534 output_surface_id, is_swap_ack, surface_returned_resources_); |
535 surface_returned_resources_.clear(); | 535 surface_returned_resources_.clear(); |
536 if (is_swap_ack) { | 536 if (is_swap_ack) { |
537 DCHECK_GT(pending_delegated_ack_count_, 0); | 537 DCHECK_GT(pending_delegated_ack_count_, 0); |
538 pending_delegated_ack_count_--; | 538 pending_delegated_ack_count_--; |
539 } | 539 } |
540 } | 540 } |
541 | 541 |
542 void DelegatedFrameHost::SurfaceDrawn(uint32_t output_surface_id, | 542 void DelegatedFrameHost::SurfaceDrawn(uint32_t output_surface_id) { |
543 cc::SurfaceDrawStatus drawn) { | |
544 SendReclaimCompositorResources(output_surface_id, true /* is_swap_ack */); | 543 SendReclaimCompositorResources(output_surface_id, true /* is_swap_ack */); |
545 } | 544 } |
546 | 545 |
547 void DelegatedFrameHost::ReturnResources( | 546 void DelegatedFrameHost::ReturnResources( |
548 const cc::ReturnedResourceArray& resources) { | 547 const cc::ReturnedResourceArray& resources) { |
549 if (resources.empty()) | 548 if (resources.empty()) |
550 return; | 549 return; |
551 std::copy(resources.begin(), resources.end(), | 550 std::copy(resources.begin(), resources.end(), |
552 std::back_inserter(surface_returned_resources_)); | 551 std::back_inserter(surface_returned_resources_)); |
553 if (!pending_delegated_ack_count_) { | 552 if (!pending_delegated_ack_count_) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 899 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
901 new_layer->SetShowSurface( | 900 new_layer->SetShowSurface( |
902 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 901 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
903 base::Bind(&RequireCallback, base::Unretained(manager)), | 902 base::Bind(&RequireCallback, base::Unretained(manager)), |
904 current_surface_size_, current_scale_factor_, | 903 current_surface_size_, current_scale_factor_, |
905 current_frame_size_in_dip_); | 904 current_frame_size_in_dip_); |
906 } | 905 } |
907 } | 906 } |
908 | 907 |
909 } // namespace content | 908 } // namespace content |
OLD | NEW |