diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 00:47:12 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-20 00:47:12 +0000 |
commit | 1654cf59615bfa5976db15b817681ec714d01019 (patch) | |
tree | c9d03e2ccfa48edfd62810722831aed9786843ad /cc | |
parent | 8e42eea41e438894c27d6a3db1e589fab99da53c (diff) | |
download | chromium_src-1654cf59615bfa5976db15b817681ec714d01019.zip chromium_src-1654cf59615bfa5976db15b817681ec714d01019.tar.gz chromium_src-1654cf59615bfa5976db15b817681ec714d01019.tar.bz2 |
cc: Chromify FrameRateController
Style-only change.
BUG=144577
Review URL: https://chromiumcodereview.appspot.com/12922002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc')
-rw-r--r-- | cc/scheduler/frame_rate_controller.cc | 211 | ||||
-rw-r--r-- | cc/scheduler/frame_rate_controller.h | 123 | ||||
-rw-r--r-- | cc/scheduler/frame_rate_controller_unittest.cc | 34 | ||||
-rw-r--r-- | cc/scheduler/scheduler.cc | 32 | ||||
-rw-r--r-- | cc/scheduler/scheduler.h | 2 | ||||
-rw-r--r-- | cc/test/scheduler_test_common.h | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 2 | ||||
-rw-r--r-- | cc/trees/thread_proxy.cc | 2 |
8 files changed, 199 insertions, 209 deletions
diff --git a/cc/scheduler/frame_rate_controller.cc b/cc/scheduler/frame_rate_controller.cc index de7b26a..d78c496 100644 --- a/cc/scheduler/frame_rate_controller.cc +++ b/cc/scheduler/frame_rate_controller.cc @@ -13,152 +13,141 @@ namespace cc { class FrameRateControllerTimeSourceAdapter : public TimeSourceClient { -public: - static scoped_ptr<FrameRateControllerTimeSourceAdapter> Create(FrameRateController* frameRateController) { - return make_scoped_ptr(new FrameRateControllerTimeSourceAdapter(frameRateController)); - } - virtual ~FrameRateControllerTimeSourceAdapter() {} - - virtual void onTimerTick() OVERRIDE { - m_frameRateController->onTimerTick(); - } - -private: - explicit FrameRateControllerTimeSourceAdapter(FrameRateController* frameRateController) - : m_frameRateController(frameRateController) {} - - FrameRateController* m_frameRateController; + public: + static scoped_ptr<FrameRateControllerTimeSourceAdapter> Create( + FrameRateController* frame_rate_controller) { + return make_scoped_ptr( + new FrameRateControllerTimeSourceAdapter(frame_rate_controller)); + } + virtual ~FrameRateControllerTimeSourceAdapter() {} + + virtual void onTimerTick() OVERRIDE { frame_rate_controller_->OnTimerTick(); } + + private: + explicit FrameRateControllerTimeSourceAdapter( + FrameRateController* frame_rate_controller) + : frame_rate_controller_(frame_rate_controller) {} + + FrameRateController* frame_rate_controller_; }; FrameRateController::FrameRateController(scoped_refptr<TimeSource> timer) - : m_client(0) - , m_numFramesPending(0) - , m_maxFramesPending(0) - , m_timeSource(timer) - , m_active(false) - , m_swapBuffersCompleteSupported(true) - , m_isTimeSourceThrottling(true) - , m_thread(0) - , m_weakFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) -{ - m_timeSourceClientAdapter = FrameRateControllerTimeSourceAdapter::Create(this); - m_timeSource->setClient(m_timeSourceClientAdapter.get()); + : client_(NULL), + num_frames_pending_(0), + max_frames_pending_(0), + time_source_(timer), + active_(false), + swap_buffers_complete_supported_(true), + is_time_source_throttling_(true), + thread_(NULL), + weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { + time_source_client_adapter_ = + FrameRateControllerTimeSourceAdapter::Create(this); + time_source_->setClient(time_source_client_adapter_.get()); } FrameRateController::FrameRateController(Thread* thread) - : m_client(0) - , m_numFramesPending(0) - , m_maxFramesPending(0) - , m_active(false) - , m_swapBuffersCompleteSupported(true) - , m_isTimeSourceThrottling(false) - , m_thread(thread) - , m_weakFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) -{ + : client_(NULL), + num_frames_pending_(0), + max_frames_pending_(0), + active_(false), + swap_buffers_complete_supported_(true), + is_time_source_throttling_(false), + thread_(thread), + weak_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {} + +FrameRateController::~FrameRateController() { + if (is_time_source_throttling_) + time_source_->setActive(false); } -FrameRateController::~FrameRateController() -{ - if (m_isTimeSourceThrottling) - m_timeSource->setActive(false); +void FrameRateController::SetActive(bool active) { + if (active_ == active) + return; + TRACE_EVENT1("cc", "FrameRateController::SetActive", "active", active); + active_ = active; + + if (is_time_source_throttling_) { + time_source_->setActive(active); + } else { + if (active) + PostManualTick(); + else + weak_factory_.InvalidateWeakPtrs(); + } } -void FrameRateController::setActive(bool active) -{ - if (m_active == active) - return; - TRACE_EVENT1("cc", "FrameRateController::setActive", "active", active); - m_active = active; - - if (m_isTimeSourceThrottling) - m_timeSource->setActive(active); - else { - if (active) - postManualTick(); - else - m_weakFactory.InvalidateWeakPtrs(); - } +void FrameRateController::SetMaxFramesPending(int max_frames_pending) { + DCHECK_GE(max_frames_pending, 0); + max_frames_pending_ = max_frames_pending; } -void FrameRateController::setMaxFramesPending(int maxFramesPending) -{ - DCHECK_GE(maxFramesPending, 0); - m_maxFramesPending = maxFramesPending; +void FrameRateController::SetTimebaseAndInterval(base::TimeTicks timebase, + base::TimeDelta interval) { + if (is_time_source_throttling_) + time_source_->setTimebaseAndInterval(timebase, interval); } -void FrameRateController::setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) -{ - if (m_isTimeSourceThrottling) - m_timeSource->setTimebaseAndInterval(timebase, interval); +void FrameRateController::SetSwapBuffersCompleteSupported(bool supported) { + swap_buffers_complete_supported_ = supported; } -void FrameRateController::setSwapBuffersCompleteSupported(bool supported) -{ - m_swapBuffersCompleteSupported = supported; -} - -void FrameRateController::onTimerTick() -{ - DCHECK(m_active); +void FrameRateController::OnTimerTick() { + DCHECK(active_); - // Check if we have too many frames in flight. - bool throttled = m_maxFramesPending && m_numFramesPending >= m_maxFramesPending; - TRACE_COUNTER_ID1("cc", "ThrottledVSyncInterval", m_thread, throttled); + // Check if we have too many frames in flight. + bool throttled = + max_frames_pending_ && num_frames_pending_ >= max_frames_pending_; + TRACE_COUNTER_ID1("cc", "ThrottledVSyncInterval", thread_, throttled); - if (m_client) - m_client->vsyncTick(throttled); + if (client_) + client_->VSyncTick(throttled); - if (m_swapBuffersCompleteSupported && !m_isTimeSourceThrottling && !throttled) - postManualTick(); + if (swap_buffers_complete_supported_ && !is_time_source_throttling_ && + !throttled) + PostManualTick(); } -void FrameRateController::postManualTick() -{ - if (m_active) - m_thread->PostTask(base::Bind(&FrameRateController::manualTick, m_weakFactory.GetWeakPtr())); +void FrameRateController::PostManualTick() { + if (active_) { + thread_->PostTask(base::Bind(&FrameRateController::ManualTick, + weak_factory_.GetWeakPtr())); + } } -void FrameRateController::manualTick() -{ - onTimerTick(); -} +void FrameRateController::ManualTick() { OnTimerTick(); } -void FrameRateController::didBeginFrame() -{ - if (m_swapBuffersCompleteSupported) - m_numFramesPending++; - else if (!m_isTimeSourceThrottling) - postManualTick(); +void FrameRateController::DidBeginFrame() { + if (swap_buffers_complete_supported_) + num_frames_pending_++; + else if (!is_time_source_throttling_) + PostManualTick(); } -void FrameRateController::didFinishFrame() -{ - DCHECK(m_swapBuffersCompleteSupported); +void FrameRateController::DidFinishFrame() { + DCHECK(swap_buffers_complete_supported_); - m_numFramesPending--; - if (!m_isTimeSourceThrottling) - postManualTick(); + num_frames_pending_--; + if (!is_time_source_throttling_) + PostManualTick(); } -void FrameRateController::didAbortAllPendingFrames() -{ - m_numFramesPending = 0; +void FrameRateController::DidAbortAllPendingFrames() { + num_frames_pending_ = 0; } -base::TimeTicks FrameRateController::nextTickTime() -{ - if (m_isTimeSourceThrottling) - return m_timeSource->nextTickTime(); +base::TimeTicks FrameRateController::NextTickTime() { + if (is_time_source_throttling_) + return time_source_->nextTickTime(); - return base::TimeTicks(); + return base::TimeTicks(); } -base::TimeTicks FrameRateController::lastTickTime() -{ - if (m_isTimeSourceThrottling) - return m_timeSource->lastTickTime(); +base::TimeTicks FrameRateController::LastTickTime() { + if (is_time_source_throttling_) + return time_source_->lastTickTime(); - return base::TimeTicks::Now(); + return base::TimeTicks::Now(); } } // namespace cc diff --git a/cc/scheduler/frame_rate_controller.h b/cc/scheduler/frame_rate_controller.h index 46fa592..d633277 100644 --- a/cc/scheduler/frame_rate_controller.h +++ b/cc/scheduler/frame_rate_controller.h @@ -17,73 +17,74 @@ class Thread; class TimeSource; class CC_EXPORT FrameRateControllerClient { -public: - // Throttled is true when we have a maximum number of frames pending. - virtual void vsyncTick(bool throttled) = 0; + public: + // Throttled is true when we have a maximum number of frames pending. + virtual void VSyncTick(bool throttled) = 0; -protected: - virtual ~FrameRateControllerClient() {} + protected: + virtual ~FrameRateControllerClient() {} }; class FrameRateControllerTimeSourceAdapter; class CC_EXPORT FrameRateController { -public: - enum { - kDefaultMaxFramesPending = 2 - }; - - explicit FrameRateController(scoped_refptr<TimeSource>); - // Alternate form of FrameRateController with unthrottled frame-rate. - explicit FrameRateController(Thread*); - virtual ~FrameRateController(); - - void setClient(FrameRateControllerClient* client) { m_client = client; } - - void setActive(bool); - - // Use the following methods to adjust target frame rate. - // - // Multiple frames can be in-progress, but for every didBeginFrame, a - // didFinishFrame should be posted. - // - // If the rendering pipeline crashes, call didAbortAllPendingFrames. - void didBeginFrame(); - void didFinishFrame(); - void didAbortAllPendingFrames(); - void setMaxFramesPending(int); // 0 for unlimited. - int maxFramesPending() const { return m_maxFramesPending; } - - // This returns null for unthrottled frame-rate. - base::TimeTicks nextTickTime(); - - // This returns now for unthrottled frame-rate. - base::TimeTicks lastTickTime(); - - void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval); - void setSwapBuffersCompleteSupported(bool); - -protected: - friend class FrameRateControllerTimeSourceAdapter; - void onTimerTick(); - - void postManualTick(); - void manualTick(); - - FrameRateControllerClient* m_client; - int m_numFramesPending; - int m_maxFramesPending; - scoped_refptr<TimeSource> m_timeSource; - scoped_ptr<FrameRateControllerTimeSourceAdapter> m_timeSourceClientAdapter; - bool m_active; - bool m_swapBuffersCompleteSupported; - - // Members for unthrottled frame-rate. - bool m_isTimeSourceThrottling; - base::WeakPtrFactory<FrameRateController> m_weakFactory; - Thread* m_thread; - - DISALLOW_COPY_AND_ASSIGN(FrameRateController); + public: + enum { + DEFAULT_MAX_FRAMES_PENDING = 2 + }; + + explicit FrameRateController(scoped_refptr<TimeSource> timer); + // Alternate form of FrameRateController with unthrottled frame-rate. + explicit FrameRateController(Thread* thread); + virtual ~FrameRateController(); + + void SetClient(FrameRateControllerClient* client) { client_ = client; } + + void SetActive(bool active); + + // Use the following methods to adjust target frame rate. + // + // Multiple frames can be in-progress, but for every DidBeginFrame, a + // DidFinishFrame should be posted. + // + // If the rendering pipeline crashes, call DidAbortAllPendingFrames. + void DidBeginFrame(); + void DidFinishFrame(); + void DidAbortAllPendingFrames(); + void SetMaxFramesPending(int max_frames_pending); // 0 for unlimited. + int MaxFramesPending() const { return max_frames_pending_; } + + // This returns null for unthrottled frame-rate. + base::TimeTicks NextTickTime(); + + // This returns now for unthrottled frame-rate. + base::TimeTicks LastTickTime(); + + void SetTimebaseAndInterval(base::TimeTicks timebase, + base::TimeDelta interval); + void SetSwapBuffersCompleteSupported(bool supported); + + protected: + friend class FrameRateControllerTimeSourceAdapter; + void OnTimerTick(); + + void PostManualTick(); + void ManualTick(); + + FrameRateControllerClient* client_; + int num_frames_pending_; + int max_frames_pending_; + scoped_refptr<TimeSource> time_source_; + scoped_ptr<FrameRateControllerTimeSourceAdapter> time_source_client_adapter_; + bool active_; + bool swap_buffers_complete_supported_; + + // Members for unthrottled frame-rate. + bool is_time_source_throttling_; + base::WeakPtrFactory<FrameRateController> weak_factory_; + Thread* thread_; + + DISALLOW_COPY_AND_ASSIGN(FrameRateController); }; } // namespace cc diff --git a/cc/scheduler/frame_rate_controller_unittest.cc b/cc/scheduler/frame_rate_controller_unittest.cc index 4eb7e60..833a492 100644 --- a/cc/scheduler/frame_rate_controller_unittest.cc +++ b/cc/scheduler/frame_rate_controller_unittest.cc @@ -17,7 +17,7 @@ public: void reset() { m_vsyncTicked = false; } bool vsyncTicked() const { return m_vsyncTicked; } - virtual void vsyncTick(bool throttled) OVERRIDE { + virtual void VSyncTick(bool throttled) OVERRIDE { m_vsyncTicked = !throttled; } @@ -34,8 +34,8 @@ TEST(FrameRateControllerTest, TestFrameThrottling_ImmediateAck) scoped_refptr<FakeDelayBasedTimeSource> timeSource = FakeDelayBasedTimeSource::create(interval, &thread); FrameRateController controller(timeSource); - controller.setClient(&client); - controller.setActive(true); + controller.SetClient(&client); + controller.SetActive(true); base::TimeTicks elapsed; // Muck around with time a bit @@ -47,11 +47,11 @@ TEST(FrameRateControllerTest, TestFrameThrottling_ImmediateAck) client.reset(); // Tell the controller we drew - controller.didBeginFrame(); + controller.DidBeginFrame(); // Tell the controller the frame ended 5ms later timeSource->setNow(timeSource->now() + base::TimeDelta::FromMilliseconds(5)); - controller.didFinishFrame(); + controller.DidFinishFrame(); // Trigger another frame, make sure vsync runs again elapsed += base::TimeDelta::FromMilliseconds(thread.pendingDelayMs()); @@ -69,9 +69,9 @@ TEST(FrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight) scoped_refptr<FakeDelayBasedTimeSource> timeSource = FakeDelayBasedTimeSource::create(interval, &thread); FrameRateController controller(timeSource); - controller.setClient(&client); - controller.setActive(true); - controller.setMaxFramesPending(2); + controller.SetClient(&client); + controller.SetActive(true); + controller.SetMaxFramesPending(2); base::TimeTicks elapsed; // Muck around with time a bit @@ -83,7 +83,7 @@ TEST(FrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight) client.reset(); // Tell the controller we drew - controller.didBeginFrame(); + controller.DidBeginFrame(); // Trigger another frame, make sure vsync callback runs again elapsed += base::TimeDelta::FromMilliseconds(thread.pendingDelayMs()); @@ -94,7 +94,7 @@ TEST(FrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight) client.reset(); // Tell the controller we drew, again. - controller.didBeginFrame(); + controller.DidBeginFrame(); // Trigger another frame. Since two frames are pending, we should not draw. elapsed += base::TimeDelta::FromMilliseconds(thread.pendingDelayMs()); @@ -105,7 +105,7 @@ TEST(FrameRateControllerTest, TestFrameThrottling_TwoFramesInFlight) // Tell the controller the first frame ended 5ms later timeSource->setNow(timeSource->now() + base::TimeDelta::FromMilliseconds(5)); - controller.didFinishFrame(); + controller.DidFinishFrame(); // Tick should not have been called EXPECT_FALSE(client.vsyncTicked()); @@ -124,11 +124,11 @@ TEST(FrameRateControllerTest, TestFrameThrottling_Unthrottled) FakeFrameRateControllerClient client; FrameRateController controller(&thread); - controller.setClient(&client); - controller.setMaxFramesPending(2); + controller.SetClient(&client); + controller.SetMaxFramesPending(2); // setActive triggers 1st frame, make sure the vsync callback is called - controller.setActive(true); + controller.SetActive(true); thread.runPendingTask(); EXPECT_TRUE(client.vsyncTicked()); client.reset(); @@ -145,13 +145,13 @@ TEST(FrameRateControllerTest, TestFrameThrottling_Unthrottled) client.reset(); // didBeginFrame triggers 2nd frame, make sure the vsync callback is called - controller.didBeginFrame(); + controller.DidBeginFrame(); thread.runPendingTask(); EXPECT_TRUE(client.vsyncTicked()); client.reset(); // didBeginFrame triggers 3rd frame (> maxFramesPending), make sure the vsync callback is NOT called - controller.didBeginFrame(); + controller.DidBeginFrame(); thread.runPendingTask(); EXPECT_FALSE(client.vsyncTicked()); client.reset(); @@ -160,7 +160,7 @@ TEST(FrameRateControllerTest, TestFrameThrottling_Unthrottled) EXPECT_FALSE(thread.hasPendingTask()); // didFinishFrame triggers a frame, make sure the vsync callback is called - controller.didFinishFrame(); + controller.DidFinishFrame(); thread.runPendingTask(); EXPECT_TRUE(client.vsyncTicked()); } diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index 1280d42..8393897 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -19,11 +19,11 @@ Scheduler::Scheduler(SchedulerClient* client, state_machine_(scheduler_settings), inside_process_scheduled_actions_(false) { DCHECK(client_); - frame_rate_controller_->setClient(this); + frame_rate_controller_->SetClient(this); DCHECK(!state_machine_.VSyncCallbackNeeded()); } -Scheduler::~Scheduler() { frame_rate_controller_->setActive(false); } +Scheduler::~Scheduler() { frame_rate_controller_->SetActive(false); } void Scheduler::SetCanBeginFrame(bool can) { state_machine_.SetCanBeginFrame(can); @@ -89,20 +89,20 @@ void Scheduler::BeginFrameAborted() { } void Scheduler::SetMaxFramesPending(int max_frames_pending) { - frame_rate_controller_->setMaxFramesPending(max_frames_pending); + frame_rate_controller_->SetMaxFramesPending(max_frames_pending); } int Scheduler::MaxFramesPending() const { - return frame_rate_controller_->maxFramesPending(); + return frame_rate_controller_->MaxFramesPending(); } void Scheduler::SetSwapBuffersCompleteSupported(bool supported) { - frame_rate_controller_->setSwapBuffersCompleteSupported(supported); + frame_rate_controller_->SetSwapBuffersCompleteSupported(supported); } void Scheduler::DidSwapBuffersComplete() { TRACE_EVENT0("cc", "Scheduler::didSwapBuffersComplete"); - frame_rate_controller_->didFinishFrame(); + frame_rate_controller_->DidFinishFrame(); } void Scheduler::DidLoseOutputSurface() { @@ -113,26 +113,26 @@ void Scheduler::DidLoseOutputSurface() { void Scheduler::DidRecreateOutputSurface() { TRACE_EVENT0("cc", "Scheduler::didRecreateOutputSurface"); - frame_rate_controller_->didAbortAllPendingFrames(); + frame_rate_controller_->DidAbortAllPendingFrames(); state_machine_.DidRecreateOutputSurface(); ProcessScheduledActions(); } void Scheduler::SetTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) { - frame_rate_controller_->setTimebaseAndInterval(timebase, interval); + frame_rate_controller_->SetTimebaseAndInterval(timebase, interval); } base::TimeTicks Scheduler::AnticipatedDrawTime() { - return frame_rate_controller_->nextTickTime(); + return frame_rate_controller_->NextTickTime(); } base::TimeTicks Scheduler::LastVSyncTime() { - return frame_rate_controller_->lastTickTime(); + return frame_rate_controller_->LastTickTime(); } -void Scheduler::vsyncTick(bool throttled) { - TRACE_EVENT1("cc", "Scheduler::vsyncTick", "throttled", throttled); +void Scheduler::VSyncTick(bool throttled) { + TRACE_EVENT1("cc", "Scheduler::VSyncTick", "throttled", throttled); if (!throttled) state_machine_.DidEnterVSync(); ProcessScheduledActions(); @@ -174,14 +174,14 @@ void Scheduler::ProcessScheduledActions() { client_->ScheduledActionDrawAndSwapIfPossible(); state_machine_.DidDrawIfPossibleCompleted(result.did_draw); if (result.did_swap) - frame_rate_controller_->didBeginFrame(); + frame_rate_controller_->DidBeginFrame(); break; } case SchedulerStateMachine::ACTION_DRAW_FORCED: { ScheduledActionDrawAndSwapResult result = client_->ScheduledActionDrawAndSwapForced(); if (result.did_swap) - frame_rate_controller_->didBeginFrame(); + frame_rate_controller_->DidBeginFrame(); break; } case SchedulerStateMachine::ACTION_BEGIN_OUTPUT_SURFACE_RECREATION: @@ -195,8 +195,8 @@ void Scheduler::ProcessScheduledActions() { } // Activate or deactivate the frame rate controller. - frame_rate_controller_->setActive(state_machine_.VSyncCallbackNeeded()); - client_->DidAnticipatedDrawTimeChange(frame_rate_controller_->nextTickTime()); + frame_rate_controller_->SetActive(state_machine_.VSyncCallbackNeeded()); + client_->DidAnticipatedDrawTimeChange(frame_rate_controller_->NextTickTime()); } } // namespace cc diff --git a/cc/scheduler/scheduler.h b/cc/scheduler/scheduler.h index c91f604..ea23e22 100644 --- a/cc/scheduler/scheduler.h +++ b/cc/scheduler/scheduler.h @@ -104,7 +104,7 @@ class CC_EXPORT Scheduler : FrameRateControllerClient { base::TimeTicks LastVSyncTime(); // FrameRateControllerClient implementation - virtual void vsyncTick(bool throttled) OVERRIDE; + virtual void VSyncTick(bool throttled) OVERRIDE; private: Scheduler(SchedulerClient* client, diff --git a/cc/test/scheduler_test_common.h b/cc/test/scheduler_test_common.h index 7f7df8c..6bca5f6 100644 --- a/cc/test/scheduler_test_common.h +++ b/cc/test/scheduler_test_common.h @@ -119,7 +119,7 @@ class FakeFrameRateController : public cc::FrameRateController { public: FakeFrameRateController(scoped_refptr<cc::TimeSource> timer) : cc::FrameRateController(timer) { } - int numFramesPending() const { return m_numFramesPending; } + int numFramesPending() const { return num_frames_pending_; } }; } // namespace cc diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index a99f2a9..258636d 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -2078,7 +2078,7 @@ public: if (m_delegatingRenderer) EXPECT_EQ(1, proxy->MaxFramesPendingForTesting()); else - EXPECT_EQ(FrameRateController::kDefaultMaxFramesPending, proxy->MaxFramesPendingForTesting()); + EXPECT_EQ(FrameRateController::DEFAULT_MAX_FRAMES_PENDING, proxy->MaxFramesPendingForTesting()); endTest(); } diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 7099618..72b00a3 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -1126,7 +1126,7 @@ void ThreadProxy::InitializeRendererOnImplThread( int maxFramesPending = layer_tree_host_impl_->output_surface()-> capabilities().max_frames_pending; if (maxFramesPending <= 0) - maxFramesPending = FrameRateController::kDefaultMaxFramesPending; + maxFramesPending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING; if (layer_tree_host_impl_->output_surface()->capabilities(). has_parent_compositor) maxFramesPending = 1; |