Index: cc/frame_rate_counter.h |
diff --git a/cc/frame_rate_counter.h b/cc/frame_rate_counter.h |
index 3196c28008b4920d0a0d241c4e4a3ac950e0fa40..eb337c3e16c7267f4004476ff199736235578239 100644 |
--- a/cc/frame_rate_counter.h |
+++ b/cc/frame_rate_counter.h |
@@ -5,6 +5,7 @@ |
#ifndef CCFrameRateCounter_h |
#define CCFrameRateCounter_h |
+#include "CCRenderingStats.h" |
#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
#include "base/time.h" |
@@ -17,9 +18,11 @@ class CCFrameRateCounter { |
public: |
static scoped_ptr<CCFrameRateCounter> create(); |
+ void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval); |
+ |
void markBeginningOfFrame(base::TimeTicks timestamp); |
void markEndOfFrame(); |
- int currentFrameNumber() const { return m_currentFrameNumber; } |
+ int64_t currentFrameNumber() const { return m_currentFrameNumber; } |
void getAverageFPSAndStandardDeviation(double& averageFPS, double& standardDeviation) const; |
int timeStampHistorySize() const { return kTimeStampHistorySize; } |
@@ -31,7 +34,7 @@ public: |
// true if the given frame interval is too fast or too slow, based on constant thresholds. |
bool isBadFrameInterval(base::TimeDelta intervalBetweenConsecutiveFrames) const; |
- int droppedFrameCount() const { return m_droppedFrameCount; } |
+ void renderingStats(CCRenderingStats* stats) const; |
private: |
CCFrameRateCounter(); |
@@ -39,24 +42,24 @@ private: |
base::TimeDelta frameInterval(int frameNumber) const; |
int frameIndex(int frameNumber) const; |
bool isBadFrame(int frameNumber) const; |
- |
- // Two thresholds (measured in seconds) that describe what is considered to be a "no-op frame" that should not be counted. |
- // - if the frame is too fast, then given our compositor implementation, the frame probably was a no-op and did not draw. |
- // - if the frame is too slow, then there is probably not animating content, so we should not pollute the average. |
- static const double kFrameTooFast; |
- static const double kFrameTooSlow; |
- |
- // If a frame takes longer than this threshold (measured in seconds) then we |
- // (naively) assume that it missed a screen refresh; that is, we dropped a frame. |
- // FIXME: Determine this threshold based on monitor refresh rate, crbug.com/138642. |
- static const double kDroppedFrameTime; |
+ int64_t currentVsyncCount(base::TimeTicks now) const; |
static const int kTimeStampHistorySize = 120; |
- int m_currentFrameNumber; |
base::TimeTicks m_timeStampHistory[kTimeStampHistorySize]; |
- int m_droppedFrameCount; |
+ // Two thresholds (measured in seconds) that describe what is considered to be a "no-op frame" that should not be counted. |
+ // - if the frame is too fast, then given our compositor implementation, the frame probably was a no-op and did not draw. |
+ // - if the frame is too slow, then there is probably not animating content, so we should not pollute the average. |
+ double m_frameTooFastSeconds; |
+ double m_frameTooSlowSeconds; |
+ |
+ int64_t m_vsyncCount; |
+ int64_t m_currentFrameNumber; |
+ bool m_active; |
+ base::TimeTicks m_activeTimestamp; |
+ base::TimeTicks m_intervalChangedTime; |
+ base::TimeDelta m_interval; |
DISALLOW_COPY_AND_ASSIGN(CCFrameRateCounter); |
}; |