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

Unified Diff: cc/output/begin_frame_args.cc

Issue 2527283003: cc: Introduce BeginFrame sequence numbers and acknowledgements.
Patch Set: Address Brian's comments. Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/begin_frame_args_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/begin_frame_args.cc
diff --git a/cc/output/begin_frame_args.cc b/cc/output/begin_frame_args.cc
index 7ef2c4842ac4b30610a7acd9dd416f5f5270fc8a..7b4e31d721a6715159145fdc5c9d729f3f8a21c9 100644
--- a/cc/output/begin_frame_args.cc
+++ b/cc/output/begin_frame_args.cc
@@ -24,26 +24,37 @@ const char* BeginFrameArgs::TypeToString(BeginFrameArgsType type) {
return "???";
}
+const uint64_t BeginFrameArgs::kInvalidFrameNumber = 0;
+const uint64_t BeginFrameArgs::kStartingFrameNumber = 1;
+
BeginFrameArgs::BeginFrameArgs()
- : frame_time(base::TimeTicks()),
+ : source_id(0),
+ sequence_number(kInvalidFrameNumber),
+ frame_time(base::TimeTicks()),
deadline(base::TimeTicks()),
interval(base::TimeDelta::FromMicroseconds(-1)),
type(BeginFrameArgs::INVALID),
- on_critical_path(true) {
-}
+ on_critical_path(true) {}
-BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
+BeginFrameArgs::BeginFrameArgs(uint64_t source_id,
+ uint64_t sequence_number,
+ base::TimeTicks frame_time,
base::TimeTicks deadline,
base::TimeDelta interval,
BeginFrameArgs::BeginFrameArgsType type)
- : frame_time(frame_time),
+ : source_id(source_id),
+ sequence_number(sequence_number),
+ frame_time(frame_time),
deadline(deadline),
interval(interval),
type(type),
on_critical_path(true) {
+ DCHECK_LT(kInvalidFrameNumber, sequence_number);
}
BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location,
+ uint64_t source_id,
+ uint64_t sequence_number,
base::TimeTicks frame_time,
base::TimeTicks deadline,
base::TimeDelta interval,
@@ -51,9 +62,11 @@ BeginFrameArgs BeginFrameArgs::Create(BeginFrameArgs::CreationLocation location,
DCHECK_NE(type, BeginFrameArgs::INVALID);
DCHECK_NE(type, BeginFrameArgs::BEGIN_FRAME_ARGS_TYPE_MAX);
#ifdef NDEBUG
- return BeginFrameArgs(frame_time, deadline, interval, type);
+ return BeginFrameArgs(source_id, sequence_number, frame_time, deadline,
+ interval, type);
#else
- BeginFrameArgs args = BeginFrameArgs(frame_time, deadline, interval, type);
+ BeginFrameArgs args(source_id, sequence_number, frame_time, deadline,
+ interval, type);
args.created_from = location;
return args;
#endif
@@ -70,6 +83,8 @@ BeginFrameArgs::AsValue() const {
void BeginFrameArgs::AsValueInto(base::trace_event::TracedValue* state) const {
state->SetString("type", "BeginFrameArgs");
state->SetString("subtype", TypeToString(type));
+ state->SetInteger("source_id", source_id);
+ state->SetInteger("sequence_number", sequence_number);
state->SetDouble("frame_time_us", frame_time.ToInternalValue());
state->SetDouble("deadline_us", deadline.ToInternalValue());
state->SetDouble("interval_us", interval.InMicroseconds());
@@ -93,4 +108,24 @@ base::TimeDelta BeginFrameArgs::DefaultInterval() {
return base::TimeDelta::FromMicroseconds(16666);
}
+BeginFrameAck::BeginFrameAck()
+ : source_id(0),
+ sequence_number(BeginFrameArgs::kInvalidFrameNumber),
+ latest_confirmed_frame(BeginFrameArgs::kInvalidFrameNumber),
+ remaining_frames(0),
+ has_damage(false) {}
+
+BeginFrameAck::BeginFrameAck(uint64_t source_id,
+ uint64_t sequence_number,
+ uint64_t latest_confirmed_frame,
+ uint32_t remaining_frames,
+ bool has_damage)
+ : source_id(source_id),
+ sequence_number(sequence_number),
+ latest_confirmed_frame(latest_confirmed_frame),
+ remaining_frames(remaining_frames),
+ has_damage(has_damage) {
+ DCHECK_LT(BeginFrameArgs::kInvalidFrameNumber, sequence_number);
+}
+
} // namespace cc
« no previous file with comments | « cc/output/begin_frame_args.h ('k') | cc/output/begin_frame_args_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698