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

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

Issue 2888043004: [cc] Add and plumb CFS::DidNotProduceFrame. (Closed)
Patch Set: address nits, rename to DidNotProduceFrame. 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::DidNotProduceFrame(const cc::BeginFrameAck& ack) {
223 DidFinishFrame(ack); 223 DidFinishFrame(ack);
224 224
225 cc::BeginFrameAck modified_ack = ack; 225 cc::BeginFrameAck modified_ack = ack;
226 if (skipped_frames_) { 226 if (skipped_frames_) {
227 // If we skipped the last frame(s), we didn't incorporate the last 227 // 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 228 // CompositorFrame's damage, so need to wait for the next one before
229 // confirming newer sequence numbers. 229 // confirming newer sequence numbers.
230 modified_ack.has_damage = false; 230 modified_ack.has_damage = false;
231 modified_ack.latest_confirmed_sequence_number = 231 modified_ack.latest_confirmed_sequence_number =
232 latest_confirmed_begin_frame_sequence_number_; 232 latest_confirmed_begin_frame_sequence_number_;
233 } 233 }
234 234
235 support_->BeginFrameDidNotSwap(modified_ack); 235 support_->DidNotProduceFrame(modified_ack);
236 } 236 }
237 237
238 bool DelegatedFrameHost::ShouldSkipFrame(const gfx::Size& size_in_dip) { 238 bool DelegatedFrameHost::ShouldSkipFrame(const gfx::Size& size_in_dip) {
239 if (!resize_lock_) 239 if (!resize_lock_)
240 return false; 240 return false;
241 // Allow a single renderer frame through even though there's a resize lock 241 // Allow a single renderer frame through even though there's a resize lock
242 // currently in place. 242 // currently in place.
243 if (allow_one_renderer_frame_during_resize_lock_) { 243 if (allow_one_renderer_frame_during_resize_lock_) {
244 allow_one_renderer_frame_during_resize_lock_ = false; 244 allow_one_renderer_frame_during_resize_lock_ = false;
245 return false; 245 return false;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 cc::ReturnedResourceArray resources; 414 cc::ReturnedResourceArray resources;
415 cc::TransferableResource::ReturnResources(frame.resource_list, &resources); 415 cc::TransferableResource::ReturnResources(frame.resource_list, &resources);
416 416
417 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(), 417 skipped_latency_info_list_.insert(skipped_latency_info_list_.end(),
418 frame.metadata.latency_info.begin(), 418 frame.metadata.latency_info.begin(),
419 frame.metadata.latency_info.end()); 419 frame.metadata.latency_info.end());
420 420
421 renderer_compositor_frame_sink_->DidReceiveCompositorFrameAck(resources); 421 renderer_compositor_frame_sink_->DidReceiveCompositorFrameAck(resources);
422 422
423 skipped_frames_ = true; 423 skipped_frames_ = true;
424 BeginFrameDidNotSwap(ack); 424 DidNotProduceFrame(ack);
425 return; 425 return;
426 } 426 }
427 427
428 // If we are allowing one renderer frame through, this would ensure the frame 428 // 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 429 // 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 430 // frame. If the renderer frame beats the UI compositor, then we don't need to
431 // allow any more, though. 431 // allow any more, though.
432 allow_one_renderer_frame_during_resize_lock_ = false; 432 allow_one_renderer_frame_during_resize_lock_ = false;
433 433
434 if (skipped_frames_) { 434 if (skipped_frames_) {
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « content/browser/renderer_host/delegated_frame_host.h ('k') | content/browser/renderer_host/render_widget_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698