| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_FRAME_RATE_CONTROLLER_H_ | 5 #ifndef CC_FRAME_RATE_CONTROLLER_H_ |
| 6 #define CC_FRAME_RATE_CONTROLLER_H_ | 6 #define CC_FRAME_RATE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // If the rendering pipeline crashes, call didAbortAllPendingFrames. | 50 // If the rendering pipeline crashes, call didAbortAllPendingFrames. |
| 51 void didBeginFrame(); | 51 void didBeginFrame(); |
| 52 void didFinishFrame(); | 52 void didFinishFrame(); |
| 53 void didAbortAllPendingFrames(); | 53 void didAbortAllPendingFrames(); |
| 54 void setMaxFramesPending(int); // 0 for unlimited. | 54 void setMaxFramesPending(int); // 0 for unlimited. |
| 55 int maxFramesPending() const { return m_maxFramesPending; } | 55 int maxFramesPending() const { return m_maxFramesPending; } |
| 56 | 56 |
| 57 // This returns null for unthrottled frame-rate. | 57 // This returns null for unthrottled frame-rate. |
| 58 base::TimeTicks nextTickTime(); | 58 base::TimeTicks nextTickTime(); |
| 59 | 59 |
| 60 // This returns now for unthrottled frame-rate. |
| 61 base::TimeTicks lastTickTime(); |
| 62 |
| 60 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv
al); | 63 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv
al); |
| 61 void setSwapBuffersCompleteSupported(bool); | 64 void setSwapBuffersCompleteSupported(bool); |
| 62 | 65 |
| 63 protected: | 66 protected: |
| 64 friend class FrameRateControllerTimeSourceAdapter; | 67 friend class FrameRateControllerTimeSourceAdapter; |
| 65 void onTimerTick(); | 68 void onTimerTick(); |
| 66 | 69 |
| 67 void postManualTick(); | 70 void postManualTick(); |
| 68 void manualTick(); | 71 void manualTick(); |
| 69 | 72 |
| 70 FrameRateControllerClient* m_client; | 73 FrameRateControllerClient* m_client; |
| 71 int m_numFramesPending; | 74 int m_numFramesPending; |
| 72 int m_maxFramesPending; | 75 int m_maxFramesPending; |
| 73 scoped_refptr<TimeSource> m_timeSource; | 76 scoped_refptr<TimeSource> m_timeSource; |
| 74 scoped_ptr<FrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter; | 77 scoped_ptr<FrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter; |
| 75 bool m_active; | 78 bool m_active; |
| 76 bool m_swapBuffersCompleteSupported; | 79 bool m_swapBuffersCompleteSupported; |
| 77 | 80 |
| 78 // Members for unthrottled frame-rate. | 81 // Members for unthrottled frame-rate. |
| 79 bool m_isTimeSourceThrottling; | 82 bool m_isTimeSourceThrottling; |
| 80 base::WeakPtrFactory<FrameRateController> m_weakFactory; | 83 base::WeakPtrFactory<FrameRateController> m_weakFactory; |
| 81 Thread* m_thread; | 84 Thread* m_thread; |
| 82 | 85 |
| 83 DISALLOW_COPY_AND_ASSIGN(FrameRateController); | 86 DISALLOW_COPY_AND_ASSIGN(FrameRateController); |
| 84 }; | 87 }; |
| 85 | 88 |
| 86 } // namespace cc | 89 } // namespace cc |
| 87 | 90 |
| 88 #endif // CC_FRAME_RATE_CONTROLLER_H_ | 91 #endif // CC_FRAME_RATE_CONTROLLER_H_ |
| OLD | NEW |