| 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/memory/ref_counted.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // 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 |
| 44 // 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 |
| 45 // retroactively. | 45 // retroactively. |
| 46 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); | 46 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); |
| 47 | 47 |
| 48 bool IsValid() const { return interval >= base::TimeDelta(); } | 48 bool IsValid() const { return interval >= base::TimeDelta(); } |
| 49 | 49 |
| 50 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 50 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 51 void AsValueInto(base::debug::TracedValue* dict) const; | 51 void AsValueInto(base::debug::TracedValue* dict) const; |
| 52 | 52 |
| 53 bool operator==(const BeginFrameArgs& other) const { |
| 54 return (frame_time == other.frame_time & |
| 55 deadline == other.deadline && |
| 56 interval == other.interval); |
| 57 } |
| 58 |
| 59 bool operator!=(const BeginFrameArgs& other) const { |
| 60 return (frame_time != other.frame_time || |
| 61 deadline != other.deadline || |
| 62 interval != other.interval); |
| 63 } |
| 64 |
| 53 base::TimeTicks frame_time; | 65 base::TimeTicks frame_time; |
| 54 base::TimeTicks deadline; | 66 base::TimeTicks deadline; |
| 55 base::TimeDelta interval; | 67 base::TimeDelta interval; |
| 56 | 68 |
| 57 private: | 69 private: |
| 58 BeginFrameArgs(base::TimeTicks frame_time, | 70 BeginFrameArgs(base::TimeTicks frame_time, |
| 59 base::TimeTicks deadline, | 71 base::TimeTicks deadline, |
| 60 base::TimeDelta interval); | 72 base::TimeDelta interval); |
| 61 }; | 73 }; |
| 62 | 74 |
| 63 } // namespace cc | 75 } // namespace cc |
| 64 | 76 |
| 65 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 77 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
| OLD | NEW |