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" |
| 11 |
| 12 namespace cc { |
| 13 |
| 14 class CC_EXPORT BeginFrameArgs { |
| 15 public: |
| 16 // You should be able to find all instances where a BeginFrame has been |
| 17 // created by searching for "BeginFrame::Create". |
| 18 static BeginFrameArgs Create(base::TimeTicks frame_time, |
| 19 base::TimeTicks deadline, |
| 20 base::TimeDelta interval); |
| 21 static BeginFrameArgs CreateForSynchronousCompositor(); |
| 22 static BeginFrameArgs CreateForTesting(); |
| 23 static BeginFrameArgs CreateInvalid(); |
| 24 |
| 25 // This is the default delta that will be used to adjust the deadline when |
| 26 // proper draw-time estimations are not yet available. |
| 27 static base::TimeDelta DefaultDeadlineAdjustment(); |
| 28 static base::TimeDelta DefaultInterval(); |
| 29 |
| 30 base::TimeTicks frame_time() const { |
| 31 return frame_time_; |
| 32 } |
| 33 |
| 34 base::TimeTicks deadline() const { |
| 35 return deadline_; |
| 36 } |
| 37 |
| 38 base::TimeDelta interval() const { |
| 39 return interval_; |
| 40 } |
| 41 |
| 42 bool IsInvalid() const { |
| 43 return interval_ < base::TimeDelta(); |
| 44 } |
| 45 |
| 46 private: |
| 47 friend class IPC::ParamTraits<BeginFrameArgs>; |
| 48 |
| 49 BeginFrameArgs(base::TimeTicks frame_time, |
| 50 base::TimeTicks deadline, |
| 51 base::TimeDelta interval); |
| 52 |
| 53 base::TimeTicks frame_time_; |
| 54 base::TimeTicks deadline_; |
| 55 base::TimeDelta interval_; |
| 56 }; |
| 57 |
| 58 } // namespace cc |
| 59 |
| 60 #endif // CC_OUTPUT_BEGIN_FRAME_H_ |
OLD | NEW |