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/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "cc/base/cc_export.h" | 12 #include "cc/base/cc_export.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 namespace trace_event { | 15 namespace trace_event { |
16 class ConvertableToTraceFormat; | 16 class ConvertableToTraceFormat; |
17 class TracedValue; | 17 class TracedValue; |
18 } | 18 } |
19 | |
20 // TODO(ssid): remove these aliases after the tracing clients are moved to the | |
21 // new trace_event namespace. See crbug.com/451032. ETA: March 2015 | |
22 namespace debug { | |
23 using ::base::trace_event::ConvertableToTraceFormat; | |
24 using ::base::trace_event::TracedValue; | |
25 } | 19 } |
26 } // namespace base | |
27 | 20 |
28 /** | 21 /** |
29 * In debug builds we trace the creation origin of BeginFrameArgs objects. We | 22 * In debug builds we trace the creation origin of BeginFrameArgs objects. We |
30 * reuse the tracked_objects::Location system to do that. | 23 * reuse the tracked_objects::Location system to do that. |
31 * | 24 * |
32 * However, in release builds we don't want this as it doubles the size of the | 25 * However, in release builds we don't want this as it doubles the size of the |
33 * BeginFrameArgs object. As well it adds a number of largish strings to the | 26 * BeginFrameArgs object. As well it adds a number of largish strings to the |
34 * binary. Despite the argument being unused, most compilers are unable to | 27 * binary. Despite the argument being unused, most compilers are unable to |
35 * optimise it away even when unused. Instead we use the BEGINFRAME_FROM_HERE | 28 * optimise it away even when unused. Instead we use the BEGINFRAME_FROM_HERE |
36 * macro to prevent the data even getting referenced. | 29 * macro to prevent the data even getting referenced. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 // This is the default delta that will be used to adjust the deadline when | 70 // This is the default delta that will be used to adjust the deadline when |
78 // proper draw-time estimations are not yet available. | 71 // proper draw-time estimations are not yet available. |
79 static base::TimeDelta DefaultEstimatedParentDrawTime(); | 72 static base::TimeDelta DefaultEstimatedParentDrawTime(); |
80 | 73 |
81 // This is the default interval to use to avoid sprinkling the code with | 74 // This is the default interval to use to avoid sprinkling the code with |
82 // magic numbers. | 75 // magic numbers. |
83 static base::TimeDelta DefaultInterval(); | 76 static base::TimeDelta DefaultInterval(); |
84 | 77 |
85 bool IsValid() const { return interval >= base::TimeDelta(); } | 78 bool IsValid() const { return interval >= base::TimeDelta(); } |
86 | 79 |
87 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 80 scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
88 void AsValueInto(base::debug::TracedValue* dict) const; | 81 void AsValueInto(base::trace_event::TracedValue* dict) const; |
89 | 82 |
90 base::TimeTicks frame_time; | 83 base::TimeTicks frame_time; |
91 base::TimeTicks deadline; | 84 base::TimeTicks deadline; |
92 base::TimeDelta interval; | 85 base::TimeDelta interval; |
93 BeginFrameArgsType type; | 86 BeginFrameArgsType type; |
94 | 87 |
95 private: | 88 private: |
96 BeginFrameArgs(base::TimeTicks frame_time, | 89 BeginFrameArgs(base::TimeTicks frame_time, |
97 base::TimeTicks deadline, | 90 base::TimeTicks deadline, |
98 base::TimeDelta interval, | 91 base::TimeDelta interval, |
99 BeginFrameArgsType type); | 92 BeginFrameArgsType type); |
100 }; | 93 }; |
101 | 94 |
102 } // namespace cc | 95 } // namespace cc |
103 | 96 |
104 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 97 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
OLD | NEW |