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

Unified Diff: cc/debug/frame_rate_counter.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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/debug/devtools_instrumentation.h ('k') | cc/debug/frame_rate_counter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/frame_rate_counter.h
diff --git a/cc/debug/frame_rate_counter.h b/cc/debug/frame_rate_counter.h
deleted file mode 100644
index 0b69b29aea541be345102d281c1acbf130fa7a79..0000000000000000000000000000000000000000
--- a/cc/debug/frame_rate_counter.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CC_DEBUG_FRAME_RATE_COUNTER_H_
-#define CC_DEBUG_FRAME_RATE_COUNTER_H_
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/time/time.h"
-#include "cc/debug/ring_buffer.h"
-
-namespace cc {
-
-// This class maintains a history of timestamps, and provides functionality to
-// intelligently compute average frames per second.
-class FrameRateCounter {
- public:
- static scoped_ptr<FrameRateCounter> Create(bool has_impl_thread);
-
- int current_frame_number() const { return ring_buffer_.CurrentIndex(); }
- int dropped_frame_count() const { return dropped_frame_count_; }
- size_t time_stamp_history_size() const { return ring_buffer_.BufferSize(); }
-
- void SaveTimeStamp(base::TimeTicks timestamp, bool software);
-
- // n = 0 returns the oldest frame interval retained in the history, while n =
- // time_stamp_history_size() - 1 returns the most recent frame interval.
- base::TimeDelta RecentFrameInterval(size_t n) const;
-
- // 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(
- base::TimeDelta interval_between_consecutive_frames) const;
-
- void GetMinAndMaxFPS(double* min_fps, double* max_fps) const;
- double GetAverageFPS() const;
-
- typedef RingBuffer<base::TimeTicks, 136> RingBufferType;
- RingBufferType::Iterator begin() const { return ring_buffer_.Begin(); }
- RingBufferType::Iterator end() const { return ring_buffer_.End(); }
-
- private:
- explicit FrameRateCounter(bool has_impl_thread);
-
- RingBufferType ring_buffer_;
-
- bool has_impl_thread_;
- int dropped_frame_count_;
-
- DISALLOW_COPY_AND_ASSIGN(FrameRateCounter);
-};
-
-} // namespace cc
-
-#endif // CC_DEBUG_FRAME_RATE_COUNTER_H_
« no previous file with comments | « cc/debug/devtools_instrumentation.h ('k') | cc/debug/frame_rate_counter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698