OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CCFrameRateCounter_h | 5 #ifndef CCFrameRateCounter_h |
6 #define CCFrameRateCounter_h | 6 #define CCFrameRateCounter_h |
7 | 7 |
8 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
9 | 9 |
10 #include <wtf/Noncopyable.h> | 10 #include <wtf/Noncopyable.h> |
11 #include <wtf/PassOwnPtr.h> | 11 #include <wtf/PassOwnPtr.h> |
12 | 12 |
13 namespace WebCore { | 13 namespace cc { |
14 | 14 |
15 // This class maintains a history of timestamps, and provides functionality to | 15 // This class maintains a history of timestamps, and provides functionality to |
16 // intelligently compute average frames per second (and standard deviation). | 16 // intelligently compute average frames per second (and standard deviation). |
17 class CCFrameRateCounter { | 17 class CCFrameRateCounter { |
18 WTF_MAKE_NONCOPYABLE(CCFrameRateCounter); | 18 WTF_MAKE_NONCOPYABLE(CCFrameRateCounter); |
19 public: | 19 public: |
20 static PassOwnPtr<CCFrameRateCounter> create() | 20 static PassOwnPtr<CCFrameRateCounter> create() |
21 { | 21 { |
22 return adoptPtr(new CCFrameRateCounter()); | 22 return adoptPtr(new CCFrameRateCounter()); |
23 } | 23 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 static const double kDroppedFrameTime; | 57 static const double kDroppedFrameTime; |
58 | 58 |
59 static const int kTimeStampHistorySize = 120; | 59 static const int kTimeStampHistorySize = 120; |
60 | 60 |
61 int m_currentFrameNumber; | 61 int m_currentFrameNumber; |
62 double m_timeStampHistory[kTimeStampHistorySize]; | 62 double m_timeStampHistory[kTimeStampHistorySize]; |
63 | 63 |
64 int m_droppedFrameCount; | 64 int m_droppedFrameCount; |
65 }; | 65 }; |
66 | 66 |
67 } // namespace WebCore | 67 } // namespace cc |
68 | 68 |
69 #endif // USE(ACCELERATED_COMPOSITING) | 69 #endif // USE(ACCELERATED_COMPOSITING) |
70 | 70 |
71 #endif | 71 #endif |
OLD | NEW |