Chromium Code Reviews| Index: cc/output/begin_frame_args.h |
| diff --git a/cc/output/begin_frame_args.h b/cc/output/begin_frame_args.h |
| index 78ddce99ddfcde3c4508f1d706d4b1eb205ff89f..b1cd51d7f48ecb154150c21b58dcfdccd1d9312e 100644 |
| --- a/cc/output/begin_frame_args.h |
| +++ b/cc/output/begin_frame_args.h |
| @@ -5,6 +5,8 @@ |
| #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
| #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
| +#include <stdint.h> |
| + |
| #include <memory> |
| #include "base/location.h" |
| @@ -49,6 +51,9 @@ struct CC_EXPORT BeginFrameArgs { |
| }; |
| static const char* TypeToString(BeginFrameArgsType type); |
| + static const uint64_t kInvalidFrameNumber; |
| + static const uint64_t kStartingFrameNumber; |
| + |
| // Creates an invalid set of values. |
| BeginFrameArgs(); |
| @@ -63,6 +68,8 @@ struct CC_EXPORT BeginFrameArgs { |
| // created by searching for "BeginFrameArgs::Create". |
| // The location argument should **always** be BEGINFRAME_FROM_HERE macro. |
| static BeginFrameArgs Create(CreationLocation location, |
| + uint64_t source_id, |
| + uint64_t sequence_number, |
| base::TimeTicks frame_time, |
| base::TimeTicks deadline, |
| base::TimeDelta interval, |
| @@ -81,6 +88,8 @@ struct CC_EXPORT BeginFrameArgs { |
| std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
| void AsValueInto(base::trace_event::TracedValue* dict) const; |
| + uint64_t source_id; |
| + uint64_t sequence_number; |
| base::TimeTicks frame_time; |
| base::TimeTicks deadline; |
| base::TimeDelta interval; |
| @@ -88,12 +97,62 @@ struct CC_EXPORT BeginFrameArgs { |
| bool on_critical_path; |
| private: |
| - BeginFrameArgs(base::TimeTicks frame_time, |
| + BeginFrameArgs(uint64_t source_id, |
| + uint64_t sequence_number, |
| + base::TimeTicks frame_time, |
| base::TimeTicks deadline, |
| base::TimeDelta interval, |
| BeginFrameArgsType type); |
| }; |
| +// Sent by a BeginFrameObserver as acknowledgment of completing a BeginFrame. |
| +struct CC_EXPORT BeginFrameAck { |
| + BeginFrameAck(); |
| + BeginFrameAck(uint64_t source_id, |
| + uint64_t sequence_number, |
| + uint64_t latest_confirmed_frame, |
| + uint32_t remaining_frames, |
| + bool has_damages); |
| + |
| + // Source identifier of the BeginFrame that is acknowledged. |
|
brianderson
2016/12/09 01:08:11
In this comment, can you explain why the source_id
Eric Seckler
2016/12/09 16:47:16
Done. Also added a comment to BeginFrameArgs.
|
| + uint64_t source_id; |
| + |
| + // Sequence number of the BeginFrame that is acknowledged. |
| + uint64_t sequence_number; |
| + |
| + // Sequence number of the latest BeginFrame that was positively acknowledged |
| + // (confirmed) by the observer. |
| + // |
| + // There are two scenarios for a positive acknowledgment: |
| + // a) All of the observer's pending updates led to successful damages (e.g. a |
| + // CompositorFrame or a damaged surface). |
| + // b) The observer did not have any updates and thus did not need to |
| + // produce damages. |
| + // A negative acknowledgment, in contrast, describes a situation in which the |
| + // observer had pending updates, but was unable to successfully produce |
| + // corresponding damages for all its updates in time. |
| + // |
| + // As a result, |latest_confirmed_frame| describes the "staleness" of the last |
| + // damages that were produced by the observer. Note that even if |
| + // |has_damages == true|, the damages produced as a result of the acknowledged |
| + // BeginFrame may be stale (|latest_confirmed_frame < sequence_number|). In |
| + // such a case, the damages that were produced may contain updates from |
| + // previous BeginFrames or only part of this BeginFrame's updates. |
| + // |
| + // Observers aggregate the |latest_confirmed_frame| of their children: The |
| + // compositor Scheduler indicates the latest BeginFrame that both impl and |
| + // main thread confirmed. Likewise, the DisplayScheduler indicates the minimum |
| + // |latest_confirmed_frame| that all its BeginFrameObservers acknowledged. |
| + uint64_t latest_confirmed_frame; |
| + |
| + // Number of BeginFrames queued at the observer at time of acknowledgment. |
| + uint32_t remaining_frames; |
| + |
| + // |true| if the observer has produced damages (e.g. sent a CompositorFrame or |
| + // damaged a surface) as part of responding to the BeginFrame. |
| + bool has_damages; |
| +}; |
| + |
| } // namespace cc |
| #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |