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

Unified Diff: cc/frame_rate_counter.cc

Issue 11369071: A speculative Revert for r165872 - Remove static thread pointers from CC, attempt 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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/frame_rate_counter.h ('k') | cc/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/frame_rate_counter.cc
===================================================================
--- cc/frame_rate_counter.cc (revision 165906)
+++ cc/frame_rate_counter.cc (working copy)
@@ -24,8 +24,8 @@
}
// static
-scoped_ptr<FrameRateCounter> FrameRateCounter::create(bool hasImplThread) {
- return make_scoped_ptr(new FrameRateCounter(hasImplThread));
+scoped_ptr<FrameRateCounter> FrameRateCounter::create() {
+ return make_scoped_ptr(new FrameRateCounter());
}
inline base::TimeDelta FrameRateCounter::frameInterval(int frameNumber) const
@@ -39,9 +39,8 @@
return safeMod(frameNumber, kTimeStampHistorySize);
}
-FrameRateCounter::FrameRateCounter(bool hasImplThread)
- : m_hasImplThread(hasImplThread)
- , m_currentFrameNumber(1)
+FrameRateCounter::FrameRateCounter()
+ : m_currentFrameNumber(1)
, m_droppedFrameCount(0)
{
m_timeStampHistory[0] = base::TimeTicks::Now();
@@ -55,7 +54,7 @@
m_timeStampHistory[frameIndex(m_currentFrameNumber)] = timestamp;
base::TimeDelta frameIntervalSeconds = frameInterval(m_currentFrameNumber);
- if (m_hasImplThread && m_currentFrameNumber > 0) {
+ if (Proxy::hasImplThread() && m_currentFrameNumber > 0) {
HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", frameIntervalSeconds.InMilliseconds(), 1, 120, 60);
}
@@ -71,7 +70,7 @@
bool FrameRateCounter::isBadFrameInterval(base::TimeDelta intervalBetweenConsecutiveFrames) const
{
- bool schedulerAllowsDoubleFrames = !m_hasImplThread;
+ bool schedulerAllowsDoubleFrames = !Proxy::hasImplThread();
bool intervalTooFast = schedulerAllowsDoubleFrames && intervalBetweenConsecutiveFrames.InSecondsF() < kFrameTooFast;
bool intervalTooSlow = intervalBetweenConsecutiveFrames.InSecondsF() > kFrameTooSlow;
return intervalTooFast || intervalTooSlow;
@@ -133,3 +132,4 @@
}
} // namespace cc
+
« no previous file with comments | « cc/frame_rate_counter.h ('k') | cc/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698