Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CC_OUTPUT_BEGIN_FRAME_H_ | |
| 6 #define CC_OUTPUT_BEGIN_FRAME_H_ | |
| 7 | |
| 8 #include "base/time.h" | |
| 9 #include "cc/base/cc_export.h" | |
| 10 #include "ipc/ipc_param_traits.h" | |
|
piman
2013/06/14 22:53:46
nit: layering violation, cc doesn't depend on IPC
brianderson
2013/06/14 23:32:12
Will fix.
| |
| 11 | |
| 12 namespace cc { | |
| 13 | |
| 14 class CC_EXPORT BeginFrameArgs { | |
| 15 public: | |
| 16 // Creates an invalid set of values. | |
| 17 BeginFrameArgs(); | |
| 18 | |
| 19 // You should be able to find all instances where a BeginFrame has been | |
| 20 // created by searching for "BeginFrame::Create". | |
| 21 static BeginFrameArgs Create(base::TimeTicks frame_time, | |
| 22 base::TimeTicks deadline, | |
| 23 base::TimeDelta interval); | |
| 24 static BeginFrameArgs CreateForSynchronousCompositor(); | |
| 25 static BeginFrameArgs CreateForTesting(); | |
| 26 | |
| 27 // This is the default delta that will be used to adjust the deadline when | |
| 28 // proper draw-time estimations are not yet available. | |
| 29 static base::TimeDelta DefaultDeadlineAdjustment(); | |
| 30 static base::TimeDelta DefaultInterval(); | |
| 31 | |
| 32 base::TimeTicks frame_time() const { | |
| 33 return frame_time_; | |
| 34 } | |
| 35 | |
| 36 base::TimeTicks deadline() const { | |
| 37 return deadline_; | |
| 38 } | |
| 39 | |
| 40 base::TimeDelta interval() const { | |
| 41 return interval_; | |
| 42 } | |
| 43 | |
| 44 bool IsInvalid() const { | |
| 45 return interval_ < base::TimeDelta(); | |
| 46 } | |
| 47 | |
| 48 private: | |
| 49 friend struct IPC::ParamTraits<BeginFrameArgs>; | |
|
piman
2013/06/14 22:53:46
nit: you just want this to be a struct. You have h
brianderson
2013/06/14 23:32:12
Ok, I'll just make it a struct with public members
| |
| 50 | |
| 51 BeginFrameArgs(base::TimeTicks frame_time, | |
| 52 base::TimeTicks deadline, | |
| 53 base::TimeDelta interval); | |
| 54 | |
| 55 base::TimeTicks frame_time_; | |
| 56 base::TimeTicks deadline_; | |
| 57 base::TimeDelta interval_; | |
| 58 }; | |
| 59 | |
| 60 } // namespace cc | |
| 61 | |
| 62 #endif // CC_OUTPUT_BEGIN_FRAME_H_ | |
| OLD | NEW |