OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/output/begin_frame_args.h" | 5 #include "cc/output/begin_frame_args.h" |
6 | 6 |
7 namespace cc { | 7 namespace cc { |
8 | 8 |
9 BeginFrameArgs::BeginFrameArgs() | 9 BeginFrameArgs::BeginFrameArgs() |
10 : frame_time(base::TimeTicks()), | 10 : frame_time(base::TimeTicks()), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 } | 42 } |
43 | 43 |
44 BeginFrameArgs BeginFrameArgs::CreateExpiredForTesting() { | 44 BeginFrameArgs BeginFrameArgs::CreateExpiredForTesting() { |
45 base::TimeTicks now = base::TimeTicks::Now(); | 45 base::TimeTicks now = base::TimeTicks::Now(); |
46 return BeginFrameArgs(now, | 46 return BeginFrameArgs(now, |
47 now - DefaultInterval(), | 47 now - DefaultInterval(), |
48 DefaultInterval()); | 48 DefaultInterval()); |
49 } | 49 } |
50 | 50 |
51 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { | 51 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { |
52 // Using a large deadline adjustment will effectively revert BeginFrame | 52 return base::TimeDelta::FromMicroseconds(-16666/3); |
53 // scheduling to the hard vsync scheduling we used to have. | |
54 return base::TimeDelta::FromSeconds(-1); | |
55 } | 53 } |
56 | 54 |
57 base::TimeDelta BeginFrameArgs::DefaultInterval() { | 55 base::TimeDelta BeginFrameArgs::DefaultInterval() { |
58 return base::TimeDelta::FromMicroseconds(16666); | 56 return base::TimeDelta::FromMicroseconds(16666); |
59 } | 57 } |
60 | 58 |
61 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { | 59 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { |
62 return base::TimeDelta::FromMicroseconds(4444); | 60 return base::TimeDelta::FromMicroseconds(4444); |
63 } | 61 } |
64 | 62 |
65 | 63 |
| 64 void BeginFrameArgs::AdjustDeadline(base::TimeDelta delta) { |
| 65 #if defined(OS_ANDROID) |
| 66 deadline += delta; |
| 67 #else |
| 68 deadline += delta; |
| 69 // deadline = base::TimeTicks(); |
| 70 #endif |
| 71 } |
| 72 |
| 73 |
66 } // namespace cc | 74 } // namespace cc |
OLD | NEW |