| Index: cc/scheduler/scheduler_state_machine.h
|
| diff --git a/cc/scheduler/scheduler_state_machine.h b/cc/scheduler/scheduler_state_machine.h
|
| index 975c32e097d7a54fca6d167c107ea1cc1a470872..2ad99993d683fa73be950a2eab41b1937fbdc4dd 100644
|
| --- a/cc/scheduler/scheduler_state_machine.h
|
| +++ b/cc/scheduler/scheduler_state_machine.h
|
| @@ -5,12 +5,13 @@
|
| #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
|
| #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_
|
|
|
| +#include <stdint.h>
|
| +
|
| #include <memory>
|
| #include <string>
|
|
|
| #include "base/macros.h"
|
| #include "cc/base/cc_export.h"
|
| -#include "cc/output/begin_frame_args.h"
|
| #include "cc/scheduler/commit_earlyout_reason.h"
|
| #include "cc/scheduler/draw_result.h"
|
| #include "cc/scheduler/scheduler_settings.h"
|
| @@ -146,10 +147,16 @@ class CC_EXPORT SchedulerStateMachine {
|
| // to make progress.
|
| bool BeginFrameNeeded() const;
|
|
|
| + // Indicates that the Scheduler has received a BeginFrame that did not require
|
| + // a BeginImplFrame, because the Scheduler stopped observing BeginFrames.
|
| + // Updates the sequence and freshness numbers for the dropped BeginFrame.
|
| + void OnBeginFrameDroppedNotObserving(uint32_t source_id,
|
| + uint64_t sequence_number);
|
| +
|
| // Indicates that the system has entered and left a BeginImplFrame callback.
|
| // The scheduler will not draw more than once in a given BeginImplFrame
|
| // callback nor send more than one BeginMainFrame message.
|
| - void OnBeginImplFrame();
|
| + void OnBeginImplFrame(uint32_t source_id, uint64_t sequence_number);
|
| // Indicates that the scheduler has entered the draw phase. The scheduler
|
| // will not draw more than once in a single draw phase.
|
| // TODO(sunnyps): Rename OnBeginImplFrameDeadline to OnDraw or similar.
|
| @@ -282,6 +289,11 @@ class CC_EXPORT SchedulerStateMachine {
|
| return previous_pending_tree_was_impl_side_;
|
| }
|
|
|
| + uint32_t begin_frame_source_id() const { return begin_frame_source_id_; }
|
| + uint64_t last_begin_frame_sequence_number_compositor_frame_was_fresh() const {
|
| + return last_begin_frame_sequence_number_compositor_frame_was_fresh_;
|
| + }
|
| +
|
| protected:
|
| bool BeginFrameRequiredForAction() const;
|
| bool BeginFrameNeededForVideo() const;
|
| @@ -308,6 +320,10 @@ class CC_EXPORT SchedulerStateMachine {
|
| void WillPerformImplSideInvalidationInternal();
|
| void DidDrawInternal(DrawResult draw_result);
|
|
|
| + void UpdateBeginFrameSequenceNumbersForBeginFrame(uint32_t source_id,
|
| + uint64_t sequence_number);
|
| + void UpdateBeginFrameSequenceNumbersForBeginFrameDeadline();
|
| +
|
| const SchedulerSettings settings_;
|
|
|
| CompositorFrameSinkState compositor_frame_sink_state_;
|
| @@ -315,6 +331,17 @@ class CC_EXPORT SchedulerStateMachine {
|
| BeginMainFrameState begin_main_frame_state_;
|
| ForcedRedrawOnTimeoutState forced_redraw_state_;
|
|
|
| + // These fields are used to track the freshness of pending updates in the
|
| + // commit/activate/draw pipeline. The Scheduler uses the CompositorFrame's
|
| + // freshness to fill the |latest_confirmed_sequence_number| field in
|
| + // BeginFrameAcks.
|
| + uint32_t begin_frame_source_id_;
|
| + uint64_t begin_frame_sequence_number_;
|
| + uint64_t last_begin_frame_sequence_number_begin_main_frame_sent_;
|
| + uint64_t last_begin_frame_sequence_number_pending_tree_was_fresh_;
|
| + uint64_t last_begin_frame_sequence_number_active_tree_was_fresh_;
|
| + uint64_t last_begin_frame_sequence_number_compositor_frame_was_fresh_;
|
| +
|
| // These are used for tracing only.
|
| int commit_count_;
|
| int current_frame_number_;
|
|
|