| Index: cc/frame_rate_counter.cc
|
| diff --git a/cc/frame_rate_counter.cc b/cc/frame_rate_counter.cc
|
| index fca42a52df43821f630068f89ed2a5b5ac5946a0..2c392289fe1e9e66c278fc913c198aab5db7fcab 100644
|
| --- a/cc/frame_rate_counter.cc
|
| +++ b/cc/frame_rate_counter.cc
|
| @@ -24,8 +24,8 @@ static inline int safeMod(int number, int modulus)
|
| }
|
|
|
| // static
|
| -scoped_ptr<FrameRateCounter> FrameRateCounter::create() {
|
| - return make_scoped_ptr(new FrameRateCounter());
|
| +scoped_ptr<FrameRateCounter> FrameRateCounter::create(bool hasImplThread) {
|
| + return make_scoped_ptr(new FrameRateCounter(hasImplThread));
|
| }
|
|
|
| inline base::TimeDelta FrameRateCounter::frameInterval(int frameNumber) const
|
| @@ -39,8 +39,9 @@ inline int FrameRateCounter::frameIndex(int frameNumber) const
|
| return safeMod(frameNumber, kTimeStampHistorySize);
|
| }
|
|
|
| -FrameRateCounter::FrameRateCounter()
|
| - : m_currentFrameNumber(1)
|
| +FrameRateCounter::FrameRateCounter(bool hasImplThread)
|
| + : m_hasImplThread(hasImplThread)
|
| + , m_currentFrameNumber(1)
|
| , m_droppedFrameCount(0)
|
| {
|
| m_timeStampHistory[0] = base::TimeTicks::Now();
|
| @@ -54,7 +55,7 @@ void FrameRateCounter::markBeginningOfFrame(base::TimeTicks timestamp)
|
| m_timeStampHistory[frameIndex(m_currentFrameNumber)] = timestamp;
|
| base::TimeDelta frameIntervalSeconds = frameInterval(m_currentFrameNumber);
|
|
|
| - if (Proxy::hasImplThread() && m_currentFrameNumber > 0) {
|
| + if (m_hasImplThread && m_currentFrameNumber > 0) {
|
| HISTOGRAM_CUSTOM_COUNTS("Renderer4.CompositorThreadImplDrawDelay", frameIntervalSeconds.InMilliseconds(), 1, 120, 60);
|
| }
|
|
|
| @@ -71,7 +72,7 @@ void FrameRateCounter::markEndOfFrame()
|
| bool FrameRateCounter::isBadFrameInterval(base::TimeDelta intervalBetweenConsecutiveFrames) const
|
| {
|
| double delta = intervalBetweenConsecutiveFrames.InSecondsF();
|
| - bool schedulerAllowsDoubleFrames = !Proxy::hasImplThread();
|
| + bool schedulerAllowsDoubleFrames = !m_hasImplThread;
|
| bool intervalTooFast = schedulerAllowsDoubleFrames ? delta < kFrameTooFast : delta <= 0.0;
|
| bool intervalTooSlow = delta > kFrameTooSlow;
|
| return intervalTooFast || intervalTooSlow;
|
|
|