| 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 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 if (resources.empty()) | 537 if (resources.empty()) |
| 538 return; | 538 return; |
| 539 std::copy(resources.begin(), resources.end(), | 539 std::copy(resources.begin(), resources.end(), |
| 540 std::back_inserter(surface_returned_resources_)); | 540 std::back_inserter(surface_returned_resources_)); |
| 541 if (!pending_delegated_ack_count_) | 541 if (!pending_delegated_ack_count_) |
| 542 SendReturnedDelegatedResources(last_output_surface_id_); | 542 SendReturnedDelegatedResources(last_output_surface_id_); |
| 543 } | 543 } |
| 544 | 544 |
| 545 void DelegatedFrameHost::WillDrawSurface(cc::SurfaceId id, | 545 void DelegatedFrameHost::WillDrawSurface(cc::SurfaceId id, |
| 546 const gfx::Rect& damage_rect) { | 546 const gfx::Rect& damage_rect) { |
| 547 if (id != surface_id_) | 547 // Frame subscribers are only interested in changes to the target surface, so |
| 548 // do not attempt capture if |damage_rect| is empty. This prevents the draws |
| 549 // of parent surfaces from triggering extra frame captures, which can affect |
| 550 // smoothness. |
| 551 if (id != surface_id_ || damage_rect.IsEmpty()) |
| 548 return; | 552 return; |
| 549 AttemptFrameSubscriberCapture(damage_rect); | 553 AttemptFrameSubscriberCapture(damage_rect); |
| 550 } | 554 } |
| 551 | 555 |
| 552 void DelegatedFrameHost::SetBeginFrameSource( | 556 void DelegatedFrameHost::SetBeginFrameSource( |
| 553 cc::BeginFrameSource* begin_frame_source) { | 557 cc::BeginFrameSource* begin_frame_source) { |
| 554 client_->SetBeginFrameSource(begin_frame_source); | 558 client_->SetBeginFrameSource(begin_frame_source); |
| 555 } | 559 } |
| 556 | 560 |
| 557 void DelegatedFrameHost::EvictDelegatedFrame() { | 561 void DelegatedFrameHost::EvictDelegatedFrame() { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 885 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
| 882 new_layer->SetShowSurface( | 886 new_layer->SetShowSurface( |
| 883 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 887 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
| 884 base::Bind(&RequireCallback, base::Unretained(manager)), | 888 base::Bind(&RequireCallback, base::Unretained(manager)), |
| 885 current_surface_size_, current_scale_factor_, | 889 current_surface_size_, current_scale_factor_, |
| 886 current_frame_size_in_dip_); | 890 current_frame_size_in_dip_); |
| 887 } | 891 } |
| 888 } | 892 } |
| 889 | 893 |
| 890 } // namespace content | 894 } // namespace content |
| OLD | NEW |