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

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

Issue 2888043004: [cc] Add and plumb CFS::DidNotProduceFrame. (Closed)
Patch Set: remove ExternalBFS::OnDidFinishFrame and related ack tracking. Created 3 years, 7 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
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 return target_view->TransformPointToLocalCoordSpace( 212 return target_view->TransformPointToLocalCoordSpace(
213 point, cc::SurfaceId(frame_sink_id_, local_surface_id_), 213 point, cc::SurfaceId(frame_sink_id_, local_surface_id_),
214 transformed_point); 214 transformed_point);
215 } 215 }
216 216
217 void DelegatedFrameHost::SetNeedsBeginFrames(bool needs_begin_frames) { 217 void DelegatedFrameHost::SetNeedsBeginFrames(bool needs_begin_frames) {
218 needs_begin_frame_ = needs_begin_frames; 218 needs_begin_frame_ = needs_begin_frames;
219 support_->SetNeedsBeginFrame(needs_begin_frames); 219 support_->SetNeedsBeginFrame(needs_begin_frames);
220 } 220 }
221 221
222 void DelegatedFrameHost::BeginFrameDidNotSwap(const cc::BeginFrameAck& ack) { 222 void DelegatedFrameHost::BeginFrameDidNotProduceFrame(
223 const cc::BeginFrameAck& ack) {
223 DidFinishFrame(ack); 224 DidFinishFrame(ack);
224 225
225 cc::BeginFrameAck modified_ack = ack; 226 cc::BeginFrameAck modified_ack = ack;
226 if (skipped_frames_) { 227 if (skipped_frames_) {
227 // If we skipped the last frame(s), we didn't incorporate the last 228 // If we skipped the last frame(s), we didn't incorporate the last
228 // CompositorFrame's damage, so need to wait for the next one before 229 // CompositorFrame's damage, so need to wait for the next one before
229 // confirming newer sequence numbers. 230 // confirming newer sequence numbers.
230 modified_ack.has_damage = false; 231 modified_ack.has_damage = false;
231 modified_ack.latest_confirmed_sequence_number = 232 modified_ack.latest_confirmed_sequence_number =
232 latest_confirmed_begin_frame_sequence_number_; 233 latest_confirmed_begin_frame_sequence_number_;
233 } 234 }
234 235
235 support_->BeginFrameDidNotSwap(modified_ack); 236 support_->BeginFrameDidNotProduceFrame(modified_ack);
236 } 237 }
237 238
238 bool DelegatedFrameHost::ShouldSkipFrame(const gfx::Size& size_in_dip) { 239 bool DelegatedFrameHost::ShouldSkipFrame(const gfx::Size& size_in_dip) {
239 if (!resize_lock_) 240 if (!resize_lock_)
240 return false; 241 return false;
241 // Allow a single renderer frame through even though there's a resize lock 242 // Allow a single renderer frame through even though there's a resize lock
242 // currently in place. 243 // currently in place.
243 if (allow_one_renderer_frame_during_resize_lock_) { 244 if (allow_one_renderer_frame_during_resize_lock_) {
244 allow_one_renderer_frame_during_resize_lock_ = false; 245 allow_one_renderer_frame_during_resize_lock_ = false;
245 return false; 246 return false;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 cc::ReturnedResourceArray resources; 415 cc::ReturnedResourceArray resources;
415 cc::TransferableResource::ReturnResources(frame.resource_list, &resources); 416 cc::TransferableResource::ReturnResources(frame.resource_list, &resources);
416 417
417 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(), 418 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(),
418 frame.metadata.latency_info.begin(), 419 frame.metadata.latency_info.begin(),
419 frame.metadata.latency_info.end()); 420 frame.metadata.latency_info.end());
420 421
421 renderer_compositor_frame_sink_->DidReceiveCompositorFrameAck(resources); 422 renderer_compositor_frame_sink_->DidReceiveCompositorFrameAck(resources);
422 423
423 skipped_frames_ = true; 424 skipped_frames_ = true;
424 BeginFrameDidNotSwap(ack); 425 BeginFrameDidNotProduceFrame(ack);
425 return; 426 return;
426 } 427 }
427 428
428 // If we are allowing one renderer frame through, this would ensure the frame 429 // If we are allowing one renderer frame through, this would ensure the frame
429 // gets through even if we regrab the lock after the UI compositor makes one 430 // gets through even if we regrab the lock after the UI compositor makes one
430 // frame. If the renderer frame beats the UI compositor, then we don't need to 431 // frame. If the renderer frame beats the UI compositor, then we don't need to
431 // allow any more, though. 432 // allow any more, though.
432 allow_one_renderer_frame_during_resize_lock_ = false; 433 allow_one_renderer_frame_during_resize_lock_ = false;
433 434
434 if (skipped_frames_) { 435 if (skipped_frames_) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 } 863 }
863 864
864 if (!skipped_frames_) { 865 if (!skipped_frames_) {
865 latest_confirmed_begin_frame_source_id_ = ack.source_id; 866 latest_confirmed_begin_frame_source_id_ = ack.source_id;
866 latest_confirmed_begin_frame_sequence_number_ = 867 latest_confirmed_begin_frame_sequence_number_ =
867 ack.latest_confirmed_sequence_number; 868 ack.latest_confirmed_sequence_number;
868 } 869 }
869 } 870 }
870 871
871 } // namespace content 872 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698