Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 1900313002: DelegatedFrameHost: Prevent FrameSubscriber captures if damage_rect is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698