Chromium Code Reviews| 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" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 76 // send a BeginFrame that had been skipped. This only has an effect if the | 76 // send a BeginFrame that had been skipped. This only has an effect if the |
| 77 // deadline has passed, since the deadline is also used to trigger BeginFrame | 77 // deadline has passed, since the deadline is also used to trigger BeginFrame |
| 78 // retroactively. | 78 // retroactively. |
| 79 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); | 79 static base::TimeDelta DefaultRetroactiveBeginFramePeriod(); |
| 80 | 80 |
| 81 bool IsValid() const { return interval >= base::TimeDelta(); } | 81 bool IsValid() const { return interval >= base::TimeDelta(); } |
| 82 | 82 |
| 83 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 83 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 84 void AsValueInto(base::debug::TracedValue* dict) const; | 84 void AsValueInto(base::debug::TracedValue* dict) const; |
| 85 | 85 |
| 86 bool operator==(const BeginFrameArgs& other) const { | |
| 87 return (frame_time == other.frame_time && deadline == other.deadline && | |
| 88 interval == other.interval); | |
|
brianderson
2014/12/09 03:00:31
Probably should include "type" in the checks here.
simonhong
2014/12/09 17:09:27
Done.
| |
| 89 } | |
| 90 bool operator!=(const BeginFrameArgs& other) const { | |
| 91 return (frame_time != other.frame_time || deadline != other.deadline || | |
| 92 interval != other.interval); | |
| 93 } | |
| 94 | |
| 86 base::TimeTicks frame_time; | 95 base::TimeTicks frame_time; |
| 87 base::TimeTicks deadline; | 96 base::TimeTicks deadline; |
| 88 base::TimeDelta interval; | 97 base::TimeDelta interval; |
| 89 BeginFrameArgsType type; | 98 BeginFrameArgsType type; |
| 90 | 99 |
| 91 private: | 100 private: |
| 92 BeginFrameArgs(base::TimeTicks frame_time, | 101 BeginFrameArgs(base::TimeTicks frame_time, |
| 93 base::TimeTicks deadline, | 102 base::TimeTicks deadline, |
| 94 base::TimeDelta interval, | 103 base::TimeDelta interval, |
| 95 BeginFrameArgsType type); | 104 BeginFrameArgsType type); |
| 96 }; | 105 }; |
| 97 | 106 |
| 98 } // namespace cc | 107 } // namespace cc |
| 99 | 108 |
| 100 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ | 109 #endif // CC_OUTPUT_BEGIN_FRAME_ARGS_H_ |
| OLD | NEW |