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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
499 } | 499 } |
500 | 500 |
501 void DelegatedFrameHost::ReclaimResources( | 501 void DelegatedFrameHost::ReclaimResources( |
502 const cc::ReturnedResourceArray& resources) { | 502 const cc::ReturnedResourceArray& resources) { |
503 renderer_compositor_frame_sink_->ReclaimResources(resources); | 503 renderer_compositor_frame_sink_->ReclaimResources(resources); |
504 } | 504 } |
505 | 505 |
506 void DelegatedFrameHost::WillDrawSurface(const cc::LocalSurfaceId& id, | 506 void DelegatedFrameHost::WillDrawSurface(const cc::LocalSurfaceId& id, |
507 const gfx::Rect& damage_rect) { | 507 const gfx::Rect& damage_rect) { |
508 // Frame subscribers are only interested in changes to the target surface, so | 508 // Frame subscribers are only interested in changes to the target surface, so |
509 // do not attempt capture if |damage_rect| is empty. This prevents the draws | 509 // do not attempt capture if |damage_rect| is empty. This prevents the draws |
danakj
2017/04/20 17:56:45
This comment no longer works
Alex Z.
2017/04/20 18:10:21
Done.
| |
510 // of parent surfaces from triggering extra frame captures, which can affect | 510 // of parent surfaces from triggering extra frame captures, which can affect |
511 // smoothness. | 511 // smoothness. |
512 if (id != local_surface_id_ || damage_rect.IsEmpty()) | 512 if (id != local_surface_id_) |
513 return; | 513 return; |
514 AttemptFrameSubscriberCapture(damage_rect); | 514 AttemptFrameSubscriberCapture(damage_rect); |
515 } | 515 } |
516 | 516 |
517 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) { | 517 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) { |
518 client_->OnBeginFrame(args); | 518 client_->OnBeginFrame(args); |
519 } | 519 } |
520 | 520 |
521 void DelegatedFrameHost::EvictDelegatedFrame() { | 521 void DelegatedFrameHost::EvictDelegatedFrame() { |
522 if (!has_frame_) | 522 if (!has_frame_) |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
862 } | 862 } |
863 | 863 |
864 if (!skipped_frames_) { | 864 if (!skipped_frames_) { |
865 latest_confirmed_begin_frame_source_id_ = ack.source_id; | 865 latest_confirmed_begin_frame_source_id_ = ack.source_id; |
866 latest_confirmed_begin_frame_sequence_number_ = | 866 latest_confirmed_begin_frame_sequence_number_ = |
867 ack.latest_confirmed_sequence_number; | 867 ack.latest_confirmed_sequence_number; |
868 } | 868 } |
869 } | 869 } |
870 | 870 |
871 } // namespace content | 871 } // namespace content |
OLD | NEW |