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 30 matching lines...) Expand all Loading... | |
41 DefaultInterval()); | 41 DefaultInterval()); |
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 // This is a hard-coded deadline adjustment, to be used in cases where | |
52 // a good estimated draw time is not known. Using 1/3 of the vsync as the | |
53 // default adjustment gives the Browser the last 1/3 of a frame to produce | |
54 // output, the Renderer Impl thread the middle 1/3 of a frame to produce ouput, | |
55 // and the Renderer Main thread the first 1/3 of a frame to produce output. | |
danakj
2013/09/17 20:26:19
nit: mention this assumes 60hz?
brianderson
2013/09/17 21:08:24
Done.
| |
51 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { | 56 base::TimeDelta BeginFrameArgs::DefaultDeadlineAdjustment() { |
52 // Using a large deadline adjustment will effectively revert BeginFrame | 57 return base::TimeDelta::FromMicroseconds(-16666 / 3); |
53 // scheduling to the hard vsync scheduling we used to have. | |
54 return base::TimeDelta::FromSeconds(-1); | |
55 } | 58 } |
56 | 59 |
57 base::TimeDelta BeginFrameArgs::DefaultInterval() { | 60 base::TimeDelta BeginFrameArgs::DefaultInterval() { |
58 return base::TimeDelta::FromMicroseconds(16666); | 61 return base::TimeDelta::FromMicroseconds(16666); |
59 } | 62 } |
60 | 63 |
61 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { | 64 base::TimeDelta BeginFrameArgs::DefaultRetroactiveBeginFramePeriod() { |
62 return base::TimeDelta::FromMicroseconds(4444); | 65 return base::TimeDelta::FromMicroseconds(4444); |
63 } | 66 } |
64 | 67 |
65 | |
66 } // namespace cc | 68 } // namespace cc |
OLD | NEW |