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 #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 5 #ifndef CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 6 #define CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
8 #include "base/time/time.h" | 9 #include "base/time/time.h" |
9 #include "base/values.h" | 10 #include "base/values.h" |
10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
11 | 12 |
| 13 namespace base { |
| 14 namespace debug { |
| 15 class ConvertableToTraceFormat; |
| 16 class TracedValue; |
| 17 } |
| 18 } |
| 19 |
12 namespace cc { | 20 namespace cc { |
13 | 21 |
14 struct CC_EXPORT BeginFrameArgs { | 22 struct CC_EXPORT BeginFrameArgs { |
15 // Creates an invalid set of values. | 23 // Creates an invalid set of values. |
16 BeginFrameArgs(); | 24 BeginFrameArgs(); |
17 | 25 |
18 // You should be able to find all instances where a BeginFrame has been | 26 // You should be able to find all instances where a BeginFrame has been |
19 // created by searching for "BeginFrameArgs::Create". | 27 // created by searching for "BeginFrameArgs::Create". |
20 static BeginFrameArgs Create(base::TimeTicks frame_time, | 28 static BeginFrameArgs Create(base::TimeTicks frame_time, |
21 base::TimeTicks deadline, | 29 base::TimeTicks deadline, |
(...skipping 10 matching lines...) Expand all Loading... |
32 static base::TimeDelta DefaultInterval(); | 40 static base::TimeDelta DefaultInterval(); |
33 | 41 |
34 // This is the default amount of time after the frame_time to retroactively | 42 // This is the default amount of time after the frame_time to retroactively |
35 // send a BeginFrame that had been skipped. This only has an effect if the | 43 // send a BeginFrame that had been skipped. This only has an effect if the |
36 // deadline has passed, since the deadline is also used to trigger BeginFrame | 44 // deadline has passed, since the deadline is also used to trigger BeginFrame |
37 // retroactively. | 45 // retroactively. |
38 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); | 46 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); |
39 | 47 |
40 bool IsValid() const { return interval >= base::TimeDelta(); } | 48 bool IsValid() const { return interval >= base::TimeDelta(); } |
41 | 49 |
42 scoped_ptr<base::Value> AsValue() const; | 50 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 51 void AsValueInto(base::debug::TracedValue* dict) const; |
43 | 52 |
44 base::TimeTicks frame_time; | 53 base::TimeTicks frame_time; |
45 base::TimeTicks deadline; | 54 base::TimeTicks deadline; |
46 base::TimeDelta interval; | 55 base::TimeDelta interval; |
47 | 56 |
48 private: | 57 private: |
49 BeginFrameArgs(base::TimeTicks frame_time, | 58 BeginFrameArgs(base::TimeTicks frame_time, |
50 base::TimeTicks deadline, | 59 base::TimeTicks deadline, |
51 base::TimeDelta interval); | 60 base::TimeDelta interval); |
52 }; | 61 }; |
53 | 62 |
54 } // namespace cc | 63 } // namespace cc |
55 | 64 |
56 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 65 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
OLD | NEW |