Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "cc/output/begin_frame_args.h" | |
| 6 | |
| 7 namespace cc { | |
| 8 | |
| 9 BeginFrameArgs::BeginFrameArgs() | |
| 10 : frame_time_(base::TimeTicks()), | |
| 11 deadline_(base::TimeTicks()), | |
| 12 interval_(base::TimeDelta::FromMicroseconds(-1)) | |
| 13 { | |
| 14 } | |
| 15 | |
| 16 BeginFrameArgs::BeginFrameArgs(base::TimeTicks frame_time, | |
| 17 base::TimeTicks deadline, | |
| 18 base::TimeDelta interval) | |
| 19 : frame_time_(frame_time), | |
| 20 deadline_(deadline), | |
| 21 interval_(interval) | |
| 22 {} | |
| 23 | |
| 24 BeginFrameArgs BeginFrameArgs::Create(base::TimeTicks frame_time, | |
| 25 base::TimeTicks deadline, | |
| 26 base::TimeDelta interval) { | |
| 27 return BeginFrameArgs(frame_time, deadline, interval); | |
| 28 } | |
| 29 | |
| 30 BeginFrameArgs BeginFrameArgs::CreateForSynchronousCompositor() { | |
| 31 // For WebView/SynchronousCompositor, we always want to draw immediately, | |
| 32 // so we set the deadline to 0 and guess that the interval is 16 milliseconds. | |
| 33 return BeginFrameArgs(base::TimeTicks::Now(), | |
| 34 base::TimeTicks(), | |
| 35 DefaultInterval()); | |
| 36 } | |
| 37 | |
| 38 BeginFrameArgs BeginFrameArgs::CreateForTesting() { | |
| 39 base::TimeTicks now = base::TimeTicks::Now(); | |
| 40 return BeginFrameArgs(now, | |
| 41 now + (DefaultInterval() / 2), | |
| 42 DefaultInterval()); | |
| 43 } | |
| 44 | |
| 45 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { | |
| 46 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
| |
| 47 } | |
| 48 | |
| 49 base::TimeDelta BeginFrameArgs::DefaultInterval() { | |
| 50 return base::TimeDelta::FromMicroseconds(16666); | |
| 51 } | |
| 52 | |
| 53 } // namespace cc | |
| OLD | NEW |