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

Unified Diff: cc/output/begin_frame_args.h

Issue 17391006: cc: Add BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/cc.gyp ('k') | cc/output/begin_frame_args.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/begin_frame_args.h
diff --git a/cc/output/begin_frame_args.h b/cc/output/begin_frame_args.h
new file mode 100644
index 0000000000000000000000000000000000000000..48c3716ab51751eb88379bd09f865af2ffe663e7
--- /dev/null
+++ b/cc/output/begin_frame_args.h
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_OUTPUT_BEGIN_FRAME_H_
+#define CC_OUTPUT_BEGIN_FRAME_H_
+
+#include "base/time.h"
+#include "cc/base/cc_export.h"
+
+namespace cc {
+
+struct CC_EXPORT BeginFrameArgs {
+ // Creates an invalid set of values.
+ BeginFrameArgs();
+
+ // You should be able to find all instances where a BeginFrame has been
+ // created by searching for "BeginFrameArgs::Create".
+ static BeginFrameArgs Create(base::TimeTicks frame_time,
+ base::TimeTicks deadline,
+ base::TimeDelta interval);
+ static BeginFrameArgs CreateForSynchronousCompositor();
+ static BeginFrameArgs CreateForTesting();
+
+ // This is the default delta that will be used to adjust the deadline when
+ // proper draw-time estimations are not yet available.
+ static base::TimeDelta DefaultDeadlineAdjustment();
+
+ // This is the default interval to use to avoid sprinkling the code with
+ // magic numbers.
+ static base::TimeDelta DefaultInterval();
+
+ bool IsInvalid() const {
+ return interval < base::TimeDelta();
+ }
+
+ base::TimeTicks frame_time;
+ base::TimeTicks deadline;
+ base::TimeDelta interval;
+
+ private:
+ BeginFrameArgs(base::TimeTicks frame_time,
+ base::TimeTicks deadline,
+ base::TimeDelta interval);
+};
+
+} // namespace cc
+
+#endif // CC_OUTPUT_BEGIN_FRAME_H_
« no previous file with comments | « cc/cc.gyp ('k') | cc/output/begin_frame_args.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698