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

Side by Side Diff: cc/scheduler/scheduler.cc

Issue 2691453002: [cc] Track observer status in ExternalBeginFrameSource. (Closed)
Patch Set: Fix comments. Created 3 years, 10 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 | « cc/scheduler/begin_frame_source_unittest.cc ('k') | cc/surfaces/direct_compositor_frame_sink.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/scheduler/scheduler.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 // BeginFrame is the mechanism that tells us that now is a good time to start 254 // BeginFrame is the mechanism that tells us that now is a good time to start
255 // making a frame. Usually this means that user input for the frame is complete. 255 // making a frame. Usually this means that user input for the frame is complete.
256 // If the scheduler is busy, we queue the BeginFrame to be handled later as 256 // If the scheduler is busy, we queue the BeginFrame to be handled later as
257 // a BeginRetroFrame. 257 // a BeginRetroFrame.
258 bool Scheduler::OnBeginFrameDerivedImpl(const BeginFrameArgs& args) { 258 bool Scheduler::OnBeginFrameDerivedImpl(const BeginFrameArgs& args) {
259 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue()); 259 TRACE_EVENT1("cc,benchmark", "Scheduler::BeginFrame", "args", args.AsValue());
260 260
261 if (!state_machine_.BeginFrameNeeded()) { 261 if (!state_machine_.BeginFrameNeeded()) {
262 TRACE_EVENT_INSTANT0("cc", "Scheduler::BeginFrameDropped", 262 TRACE_EVENT_INSTANT0("cc", "Scheduler::BeginFrameDropped",
263 TRACE_EVENT_SCOPE_THREAD); 263 TRACE_EVENT_SCOPE_THREAD);
264 // TODO(eseckler): Determine and set correct |ack.latest_confirmed_frame|.
265 BeginFrameAck ack(args.source_id, args.sequence_number,
266 args.sequence_number, 0, false);
267 begin_frame_source_->DidFinishFrame(this, ack);
264 return false; 268 return false;
265 } 269 }
266 270
267 // Trace this begin frame time through the Chrome stack 271 // Trace this begin frame time through the Chrome stack
268 TRACE_EVENT_FLOW_BEGIN0( 272 TRACE_EVENT_FLOW_BEGIN0(
269 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs", 273 TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.frames"), "BeginFrameArgs",
270 args.frame_time.ToInternalValue()); 274 args.frame_time.ToInternalValue());
271 275
272 if (settings_.using_synchronous_renderer_compositor) { 276 if (settings_.using_synchronous_renderer_compositor) {
273 BeginImplFrameSynchronous(args); 277 BeginImplFrameSynchronous(args);
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 771 }
768 772
769 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 773 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
770 return (state_machine_.begin_main_frame_state() == 774 return (state_machine_.begin_main_frame_state() ==
771 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 775 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
772 state_machine_.begin_main_frame_state() == 776 state_machine_.begin_main_frame_state() ==
773 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 777 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
774 } 778 }
775 779
776 } // namespace cc 780 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/begin_frame_source_unittest.cc ('k') | cc/surfaces/direct_compositor_frame_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698