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

Unified Diff: cc/output/begin_frame_args.cc

Issue 16863005: cc: Add BeginFrameArgs (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc12
Patch Set: Fix android compile 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
Index: cc/output/begin_frame_args.cc
diff --git a/cc/output/begin_frame_args.cc b/cc/output/begin_frame_args.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4daf3de4cea050935408b634ea81b049e5feb33d
--- /dev/null
+++ b/cc/output/begin_frame_args.cc
@@ -0,0 +1,53 @@
+// 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.
+
+#include "cc/output/begin_frame_args.h"
+
+namespace cc {
+
+BeginFrameArgs::BeginFrameArgs()
+ : frame_time_(base::TimeTicks()),
+ deadline_(base::TimeTicks()),
+ interval_(base::TimeDelta::FromMicroseconds(-1))
+{
+}
+
+BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
+ base::TimeTicks deadline,
+ base::TimeDelta interval)
+ : frame_time_(frame_time),
+ deadline_(deadline),
+ interval_(interval)
+{}
+
+BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time,
+ base::TimeTicks deadline,
+ base::TimeDelta interval) {
+ return BeginFrameArgs(frame_time, deadline, interval);
+}
+
+BeginFrameArgs BeginFrameArgs::CreateForSynchronousCompositor() {
+ // For WebView/SynchronousCompositor, we always want to draw immediately,
+ // so we set the deadline to 0 and guess that the interval is 16 milliseconds.
+ return BeginFrameArgs(base::TimeTicks::Now(),
+ base::TimeTicks(),
+ DefaultInterval());
+}
+
+BeginFrameArgs BeginFrameArgs::CreateForTesting() {
+ base::TimeTicks now = base::TimeTicks::Now();
+ return BeginFrameArgs(now,
+ now + (DefaultInterval() / 2),
+ DefaultInterval());
+}
+
+base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() {
+ return base::TimeDelta::FromMicroseconds(-8888);
piman 2013/06/14 22:53:46 Can you explain to me what this means, and why it'
brianderson 2013/06/14 23:32:12 I will add a comment for what this is used for. F
+}
+
+base::TimeDelta BeginFrameArgs::DefaultInterval() {
+ return base::TimeDelta::FromMicroseconds(16666);
+}
+
+} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698