| 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..707d58bbc5830f0e936c0aa8256514135e667099
|
| --- /dev/null
|
| +++ b/cc/output/begin_frame_args.cc
|
| @@ -0,0 +1,44 @@
|
| +// 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() {}
|
| +
|
| +BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time,
|
| + base::TimeTicks deadline,
|
| + base::TimeDelta interval)
|
| + : frame_time_(frame_time), deadline_(deadline), interval_(interval)
|
| +{}
|
| +
|
| +BeginFrameArgs::~BeginFrameArgs() {}
|
| +
|
| +BeginFrameArgs BeginFrameArgs::CreateBeginFrame(base::TimeTicks frame_time,
|
| + base::TimeTicks deadline,
|
| + base::TimeDelta interval) {
|
| + return BeginFrameArgs(frame_time, deadline, interval);
|
| +}
|
| +
|
| +BeginFrameArgs BeginFrameArgs::CreateBeginFrameForSynchronousCompositor() {
|
| + // 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(),
|
| + base::TimeDelta::FromMicroseconds(16666));
|
| +}
|
| +
|
| +BeginFrameArgs BeginFrameArgs::CreateBeginFrameForTesting() {
|
| + base::TimeTicks now = base::TimeTicks::Now();
|
| + return BeginFrameArgs(now,
|
| + now + base::TimeDelta::FromMicroseconds(8888),
|
| + base::TimeDelta::FromMicroseconds(16666));
|
| +}
|
| +
|
| +base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() {
|
| + return base::TimeDelta::FromMicroseconds(-8888);
|
| +}
|
| +
|
| +} // namespace cc
|
|
|