Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Unified Diff: cc/CCFrameRateCounter.h

Issue 11122003: [cc] Rename all cc/ filenames to Chromium style (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCFrameRateController.cpp ('k') | cc/CCFrameRateCounter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCFrameRateCounter.h
diff --git a/cc/CCFrameRateCounter.h b/cc/CCFrameRateCounter.h
index 76b42242565b74db6467aff88fc71c62796561e4..1a4708c7c42869390c2f959d9afe30027993b4fe 100644
--- a/cc/CCFrameRateCounter.h
+++ b/cc/CCFrameRateCounter.h
@@ -2,71 +2,5 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CCFrameRateCounter_h
-#define CCFrameRateCounter_h
-
-#if USE(ACCELERATED_COMPOSITING)
-
-#include "base/basictypes.h"
-#include <wtf/PassOwnPtr.h>
-
-namespace cc {
-
-// This class maintains a history of timestamps, and provides functionality to
-// intelligently compute average frames per second (and standard deviation).
-class CCFrameRateCounter {
-public:
- static PassOwnPtr<CCFrameRateCounter> create()
- {
- return adoptPtr(new CCFrameRateCounter());
- }
-
- void markBeginningOfFrame(double timestamp);
- void markEndOfFrame();
- int currentFrameNumber() const { return m_currentFrameNumber; }
- void getAverageFPSAndStandardDeviation(double& averageFPS, double& standardDeviation) const;
- int timeStampHistorySize() const { return kTimeStampHistorySize; }
-
- // n = 0 returns the oldest frame retained in the history,
- // while n = timeStampHistorySize() - 1 returns the timestamp most recent frame.
- double timeStampOfRecentFrame(int /* n */);
-
- // This is a heuristic that can be used to ignore frames in a reasonable way. Returns
- // true if the given frame interval is too fast or too slow, based on constant thresholds.
- bool isBadFrameInterval(double intervalBetweenConsecutiveFrames) const;
-
- int droppedFrameCount() const { return m_droppedFrameCount; }
-
-private:
- CCFrameRateCounter();
-
- double 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;
-
- static const int kTimeStampHistorySize = 120;
-
- int m_currentFrameNumber;
- double m_timeStampHistory[kTimeStampHistorySize];
-
- int m_droppedFrameCount;
-
- DISALLOW_COPY_AND_ASSIGN(CCFrameRateCounter);
-};
-
-} // namespace cc
-
-#endif // USE(ACCELERATED_COMPOSITING)
-
-#endif
+// Temporary forwarding header
+#include "cc/frame_rate_counter.h"
« no previous file with comments | « cc/CCFrameRateController.cpp ('k') | cc/CCFrameRateCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698