diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 06:59:20 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-13 06:59:20 +0000 |
commit | 107fc127f06ac9d14ec1f68fae13077ab968c13a (patch) | |
tree | f925112610e38f7b1820c392b8356a8603aecd24 /cc/trees | |
parent | 96d89f8411a85509c890f30d2dbb841211c31362 (diff) | |
download | chromium_src-107fc127f06ac9d14ec1f68fae13077ab968c13a.zip chromium_src-107fc127f06ac9d14ec1f68fae13077ab968c13a.tar.gz chromium_src-107fc127f06ac9d14ec1f68fae13077ab968c13a.tar.bz2 |
cc: Emulate BeginFrame in OutputSurfaces that don't support it natively
This includes two small fixes for the original version of this
patch that broke software compositing and WebView.
This will allow us to avoid having two different code paths
in the Scheduler. It also allows us to more easily remove the
VSyncTimeSource and FrameRateController from the Scheduler.
This patch instantiates the FrameRateController inside of
OutputSurface for now, but the FrameRateController could be
removed in future patches.
BUG=245920
BUG=243497
TBR=nduca@chromium.org,sievers@chromium.org,kbr@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16833003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 24 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 8 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 2 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest.cc | 62 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 4 | ||||
-rw-r--r-- | cc/trees/proxy.cc | 4 | ||||
-rw-r--r-- | cc/trees/proxy.h | 3 | ||||
-rw-r--r-- | cc/trees/single_thread_proxy.h | 2 | ||||
-rw-r--r-- | cc/trees/thread_proxy.cc | 109 | ||||
-rw-r--r-- | cc/trees/thread_proxy.h | 41 |
10 files changed, 97 insertions, 162 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index a497421..2670bf8 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -1071,11 +1071,6 @@ void LayerTreeHostImpl::SetNeedsRedrawRect(gfx::Rect damage_rect) { client_->SetNeedsRedrawRectOnImplThread(damage_rect); } -void LayerTreeHostImpl::OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) { - client_->OnVSyncParametersChanged(timebase, interval); -} - void LayerTreeHostImpl::BeginFrame(base::TimeTicks frame_time) { client_->BeginFrameOnImplThread(frame_time); } @@ -1514,6 +1509,25 @@ bool LayerTreeHostImpl::DoInitializeRenderer( resource_provider_ = resource_provider.Pass(); } + // Setup BeginFrameEmulation if it's not supported natively + if (!settings_.begin_frame_scheduling_enabled) { + const base::TimeDelta display_refresh_interval = + base::TimeDelta::FromMicroseconds( + base::Time::kMicrosecondsPerSecond / + settings_.refresh_rate); + + output_surface->InitializeBeginFrameEmulation( + proxy_->ImplThread(), + settings_.throttle_frame_production, + display_refresh_interval); + } + + int max_frames_pending = + output_surface->capabilities().max_frames_pending; + if (max_frames_pending <= 0) + max_frames_pending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING; + output_surface->SetMaxFramesPending(max_frames_pending); + output_surface_ = output_surface.Pass(); if (!visible_) diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 72c542d..e2a303e 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -54,8 +54,6 @@ class LayerTreeHostImplClient { scoped_refptr<ContextProvider> offscreen_context_provider) = 0; virtual void DidLoseOutputSurfaceOnImplThread() = 0; virtual void OnSwapBuffersCompleteOnImplThread() = 0; - virtual void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) = 0; virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) = 0; virtual void OnCanDrawStateChanged(bool can_draw) = 0; virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) = 0; @@ -183,8 +181,6 @@ class CC_EXPORT LayerTreeHostImpl virtual float DeviceScaleFactor() const OVERRIDE; virtual const LayerTreeSettings& Settings() const OVERRIDE; public: - virtual void DidLoseOutputSurface() OVERRIDE; - virtual void OnSwapBuffersComplete(const CompositorFrameAck* ack) OVERRIDE; virtual void SetFullRootLayerDamage() OVERRIDE; virtual void SetManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERRIDE; @@ -205,12 +201,12 @@ class CC_EXPORT LayerTreeHostImpl virtual bool DeferredInitialize( scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; virtual void SetNeedsRedrawRect(gfx::Rect rect) OVERRIDE; - virtual void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) OVERRIDE; virtual void BeginFrame(base::TimeTicks frame_time) OVERRIDE; virtual void SetExternalDrawConstraints(const gfx::Transform& transform, gfx::Rect viewport) OVERRIDE; + virtual void DidLoseOutputSurface() OVERRIDE; + virtual void OnSwapBuffersComplete(const CompositorFrameAck* ack) OVERRIDE; // Called from LayerTreeImpl. void OnCanDrawStateChangedForTree(); diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 2439dc5..9184e46 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -95,8 +95,6 @@ class LayerTreeHostImplTest : public testing::Test, } virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE {} virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE {} - virtual void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) OVERRIDE {} virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) OVERRIDE {} virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE { diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index b8a2e9c..e4d192e 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc @@ -2049,36 +2049,6 @@ class LayerTreeHostTestCapturePicture : public LayerTreeHostTest { MULTI_THREAD_TEST_F(LayerTreeHostTestCapturePicture); -class LayerTreeHostTestMaxPendingFrames : public LayerTreeHostTest { - public: - LayerTreeHostTestMaxPendingFrames() : LayerTreeHostTest() {} - - virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } - - virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { - DCHECK(host_impl->proxy()->HasImplThread()); - - const ThreadProxy* proxy = static_cast<ThreadProxy*>(host_impl->proxy()); - if (delegating_renderer()) { - EXPECT_EQ(1, proxy->MaxFramesPendingForTesting()); - } else { - EXPECT_EQ(FrameRateController::DEFAULT_MAX_FRAMES_PENDING, - proxy->MaxFramesPendingForTesting()); - } - EndTest(); - } - - virtual void AfterTest() OVERRIDE {} -}; - -TEST_F(LayerTreeHostTestMaxPendingFrames, DelegatingRenderer) { - RunTest(true, true, true); -} - -TEST_F(LayerTreeHostTestMaxPendingFrames, GLRenderer) { - RunTest(true, false, true); -} - class LayerTreeHostTestShutdownWithOnlySomeResourcesEvicted : public LayerTreeHostTest { public: @@ -2253,32 +2223,10 @@ class LayerTreeHostTestBeginFrameNotification : public LayerTreeHostTest { } virtual void BeginTest() OVERRIDE { + // This will trigger a SetNeedsBeginFrame which will trigger a BeginFrame. PostSetNeedsCommitToMainThread(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { - FakeOutputSurface* fake_output_surface = - reinterpret_cast<FakeOutputSurface*>(host_impl->output_surface()); - - // The BeginFrame notification is turned off now but will get - // enabled once we return, so post a task to trigger it. - ASSERT_FALSE(fake_output_surface->needs_begin_frame()); - PostBeginFrameOnImplThread(fake_output_surface); - } - - void PostBeginFrameOnImplThread(FakeOutputSurface* fake_output_surface) { - DCHECK(ImplThread()); - ImplThread()->PostTask( - base::Bind(&LayerTreeHostTestBeginFrameNotification::BeginFrame, - base::Unretained(this), - base::Unretained(fake_output_surface))); - } - - void BeginFrame(FakeOutputSurface* fake_output_surface) { - ASSERT_TRUE(fake_output_surface->needs_begin_frame()); - fake_output_surface->BeginFrame(frame_time_); - } - virtual bool PrepareToDrawOnThread( LayerTreeHostImpl* host_impl, LayerTreeHostImpl::FrameData* frame, @@ -2824,11 +2772,6 @@ class LayerTreeHostTestNumFramesPending : public LayerTreeHostTest { } } - virtual void SwapBuffersCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { - const ThreadProxy* proxy = static_cast<ThreadProxy*>(impl->proxy()); - EXPECT_EQ(0, proxy->NumFramesPendingForTesting()); - } - virtual void AfterTest() OVERRIDE {} protected: @@ -2895,6 +2838,9 @@ class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { // Force redraw again. host_impl->SetNeedsRedrawRect(gfx::Rect(1, 1)); + + // If we didn't swap this begin frame, we need to request another one. + host_impl->SetNeedsBeginFrame(true); } virtual void AfterTest() OVERRIDE { diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index c448002..29cc4f4 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -193,7 +193,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws started_animating_ = true; } - virtual void DrawLayersOnThread(LayerTreeHostImpl* tree_impl) OVERRIDE { + virtual void DrawLayersOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { if (started_animating_) EndTest(); } @@ -205,7 +205,7 @@ class LayerTreeHostAnimationTestCheckerboardDoesNotStarveDraws return false; } - virtual void AfterTest() OVERRIDE {} + virtual void AfterTest() OVERRIDE { } private: bool started_animating_; diff --git a/cc/trees/proxy.cc b/cc/trees/proxy.cc index 8d2d2b7..fd39ed0 100644 --- a/cc/trees/proxy.cc +++ b/cc/trees/proxy.cc @@ -78,4 +78,8 @@ Proxy::~Proxy() { DCHECK(IsMainThread()); } +std::string Proxy::SchedulerStateAsStringForTesting() { + return ""; +} + } // namespace cc diff --git a/cc/trees/proxy.h b/cc/trees/proxy.h index aaab780..4e6171c 100644 --- a/cc/trees/proxy.h +++ b/cc/trees/proxy.h @@ -5,6 +5,8 @@ #ifndef CC_TREES_PROXY_H_ #define CC_TREES_PROXY_H_ +#include <string> + #include "base/basictypes.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" @@ -98,6 +100,7 @@ class CC_EXPORT Proxy { // Testing hooks virtual bool CommitPendingForTesting() = 0; + virtual std::string SchedulerStateAsStringForTesting(); protected: explicit Proxy(scoped_ptr<Thread> impl_thread); diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index 0c3946b..9d995ba 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h @@ -51,8 +51,6 @@ class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE {} - virtual void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) OVERRIDE {} virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) OVERRIDE {} virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 53db2c2..020c255 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -4,6 +4,8 @@ #include "cc/trees/thread_proxy.h" +#include <string> + #include "base/auto_reset.h" #include "base/bind.h" #include "base/debug/trace_event.h" @@ -16,7 +18,6 @@ #include "cc/scheduler/delay_based_time_source.h" #include "cc/scheduler/frame_rate_controller.h" #include "cc/scheduler/scheduler.h" -#include "cc/scheduler/vsync_time_source.h" #include "cc/trees/layer_tree_host.h" #include "cc/trees/layer_tree_impl.h" @@ -32,6 +33,23 @@ const double kSmoothnessTakesPriorityExpirationDelay = 0.25; namespace cc { +struct ThreadProxy::ReadbackRequest { + CompletionEvent completion; + bool success; + void* pixels; + gfx::Rect rect; +}; + +struct ThreadProxy::CommitPendingRequest { + CompletionEvent completion; + bool commit_pending; +}; + +struct ThreadProxy::SchedulerStateRequest { + CompletionEvent completion; + std::string state; +}; + scoped_ptr<Proxy> ThreadProxy::Create(LayerTreeHost* layer_tree_host, scoped_ptr<Thread> impl_thread) { return make_scoped_ptr( @@ -64,7 +82,6 @@ ThreadProxy::ThreadProxy(LayerTreeHost* layer_tree_host, layer_tree_host->settings().begin_frame_scheduling_enabled), using_synchronous_renderer_compositor_( layer_tree_host->settings().using_synchronous_renderer_compositor), - vsync_client_(NULL), inside_draw_(false), defer_commits_(false), renew_tree_priority_on_impl_thread_pending_(false) { @@ -328,36 +345,21 @@ void ThreadProxy::CheckOutputSurfaceStatusOnImplThread() { void ThreadProxy::OnSwapBuffersCompleteOnImplThread() { DCHECK(IsImplThread()); TRACE_EVENT0("cc", "ThreadProxy::OnSwapBuffersCompleteOnImplThread"); - scheduler_on_impl_thread_->DidSwapBuffersComplete(); Proxy::MainThread()->PostTask( base::Bind(&ThreadProxy::DidCompleteSwapBuffers, main_thread_weak_ptr_)); } -void ThreadProxy::OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) { +void ThreadProxy::SetNeedsBeginFrameOnImplThread(bool enable) { DCHECK(IsImplThread()); - TRACE_EVENT2("cc", - "ThreadProxy::OnVSyncParametersChanged", - "timebase", - (timebase - base::TimeTicks()).InMilliseconds(), - "interval", - interval.InMilliseconds()); - scheduler_on_impl_thread_->SetTimebaseAndInterval(timebase, interval); + TRACE_EVENT1("cc", "ThreadProxy::SetNeedsBeginFrameOnImplThread", + "enable", enable); + layer_tree_host_impl_->SetNeedsBeginFrame(enable); } void ThreadProxy::BeginFrameOnImplThread(base::TimeTicks frame_time) { DCHECK(IsImplThread()); - TRACE_EVENT0("cc", "ThreadProxy::OnBeginFrameOnImplThread"); - if (vsync_client_) - vsync_client_->DidVSync(frame_time); -} - -void ThreadProxy::RequestVSyncNotification(VSyncClient* client) { - DCHECK(IsImplThread()); - TRACE_EVENT1( - "cc", "ThreadProxy::RequestVSyncNotification", "enable", !!client); - vsync_client_ = client; - layer_tree_host_impl_->SetNeedsBeginFrame(!!client); + TRACE_EVENT0("cc", "ThreadProxy::BeginFrameOnImplThread"); + scheduler_on_impl_thread_->BeginFrame(frame_time); } void ThreadProxy::OnCanDrawStateChanged(bool can_draw) { @@ -1110,35 +1112,14 @@ void ThreadProxy::InitializeImplOnImplThread(CompletionEvent* completion) { TRACE_EVENT0("cc", "ThreadProxy::InitializeImplOnImplThread"); DCHECK(IsImplThread()); layer_tree_host_impl_ = layer_tree_host_->CreateLayerTreeHostImpl(this); - const base::TimeDelta display_refresh_interval = - base::TimeDelta::FromMicroseconds( - base::Time::kMicrosecondsPerSecond / - layer_tree_host_->settings().refresh_rate); - scoped_ptr<FrameRateController> frame_rate_controller; - if (throttle_frame_production_) { - if (begin_frame_scheduling_enabled_) { - frame_rate_controller.reset( - new FrameRateController(VSyncTimeSource::Create( - this, - using_synchronous_renderer_compositor_ ? - VSyncTimeSource::DISABLE_SYNCHRONOUSLY : - VSyncTimeSource::DISABLE_ON_NEXT_TICK))); - } else { - frame_rate_controller.reset( - new FrameRateController(DelayBasedTimeSource::Create( - display_refresh_interval, Proxy::ImplThread()))); - } - } else { - frame_rate_controller.reset(new FrameRateController(Proxy::ImplThread())); - } const LayerTreeSettings& settings = layer_tree_host_->settings(); SchedulerSettings scheduler_settings; scheduler_settings.impl_side_painting = settings.impl_side_painting; scheduler_settings.timeout_and_draw_when_animation_checkerboards = settings.timeout_and_draw_when_animation_checkerboards; - scheduler_on_impl_thread_ = Scheduler::Create(this, - frame_rate_controller.Pass(), - scheduler_settings); + scheduler_settings.using_synchronous_renderer_compositor = + settings.using_synchronous_renderer_compositor; + scheduler_on_impl_thread_ = Scheduler::Create(this, scheduler_settings); scheduler_on_impl_thread_->SetVisible(layer_tree_host_impl_->visible()); impl_thread_weak_ptr_ = weak_factory_on_impl_thread_.GetWeakPtr(); @@ -1164,16 +1145,6 @@ void ThreadProxy::InitializeOutputSurfaceOnImplThread( if (*success) { *capabilities = layer_tree_host_impl_->GetRendererCapabilities(); - - OutputSurface* output_surface_ptr = layer_tree_host_impl_->output_surface(); - DCHECK(output_surface_ptr); - int max_frames_pending = - output_surface_ptr->capabilities().max_frames_pending; - if (max_frames_pending <= 0) - max_frames_pending = FrameRateController::DEFAULT_MAX_FRAMES_PENDING; - - scheduler_on_impl_thread_->SetMaxFramesPending(max_frames_pending); - scheduler_on_impl_thread_->DidCreateAndInitializeOutputSurface(); } @@ -1218,7 +1189,6 @@ void ThreadProxy::LayerTreeHostClosedOnImplThread(CompletionEvent* completion) { scheduler_on_impl_thread_.reset(); layer_tree_host_impl_.reset(); weak_factory_on_impl_thread_.InvalidateWeakPtrs(); - vsync_client_ = NULL; completion->Signal(); } @@ -1278,6 +1248,29 @@ void ThreadProxy::CommitPendingOnImplThreadForTesting( request->completion.Signal(); } +std::string ThreadProxy::SchedulerStateAsStringForTesting() { + if (IsImplThread()) + return scheduler_on_impl_thread_->StateAsStringForTesting(); + + SchedulerStateRequest scheduler_state_request; + { + DebugScopedSetMainThreadBlocked main_thread_blocked(this); + Proxy::ImplThread()->PostTask( + base::Bind(&ThreadProxy::SchedulerStateAsStringOnImplThreadForTesting, + impl_thread_weak_ptr_, + &scheduler_state_request)); + scheduler_state_request.completion.Wait(); + } + return scheduler_state_request.state; +} + +void ThreadProxy::SchedulerStateAsStringOnImplThreadForTesting( + SchedulerStateRequest* request) { + DCHECK(IsImplThread()); + request->state = scheduler_on_impl_thread_->StateAsStringForTesting(); + request->completion.Signal(); +} + skia::RefPtr<SkPicture> ThreadProxy::CapturePicture() { DCHECK(IsMainThread()); CompletionEvent completion; diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h index 3cc905d..8013882 100644 --- a/cc/trees/thread_proxy.h +++ b/cc/trees/thread_proxy.h @@ -5,6 +5,8 @@ #ifndef CC_TREES_THREAD_PROXY_H_ #define CC_TREES_THREAD_PROXY_H_ +#include <string> + #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" #include "base/time.h" @@ -12,7 +14,6 @@ #include "cc/base/completion_event.h" #include "cc/resources/resource_update_controller.h" #include "cc/scheduler/scheduler.h" -#include "cc/scheduler/vsync_time_source.h" #include "cc/trees/layer_tree_host_impl.h" #include "cc/trees/proxy.h" @@ -29,8 +30,7 @@ class Thread; class ThreadProxy : public Proxy, LayerTreeHostImplClient, SchedulerClient, - ResourceUpdateControllerClient, - VSyncProvider { + ResourceUpdateControllerClient { public: static scoped_ptr<Proxy> Create(LayerTreeHost* layer_tree_host, scoped_ptr<Thread> impl_thread); @@ -59,6 +59,7 @@ class ThreadProxy : public Proxy, virtual skia::RefPtr<SkPicture> CapturePicture() OVERRIDE; virtual scoped_ptr<base::Value> AsValue() const OVERRIDE; virtual bool CommitPendingForTesting() OVERRIDE; + virtual std::string SchedulerStateAsStringForTesting() OVERRIDE; // LayerTreeHostImplClient implementation virtual void DidTryInitializeRendererOnImplThread( @@ -66,10 +67,7 @@ class ThreadProxy : public Proxy, scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; - virtual void OnVSyncParametersChanged(base::TimeTicks timebase, - base::TimeDelta interval) OVERRIDE; - virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) - OVERRIDE; + virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) OVERRIDE; virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE; virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE; virtual void SetNeedsRedrawOnImplThread() OVERRIDE; @@ -91,6 +89,7 @@ class ThreadProxy : public Proxy, virtual void DidActivatePendingTree() OVERRIDE; // SchedulerClient implementation + virtual void SetNeedsBeginFrameOnImplThread(bool enable) OVERRIDE; virtual void ScheduledActionSendBeginFrameToMainThread() OVERRIDE; virtual ScheduledActionDrawAndSwapResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE; @@ -106,17 +105,6 @@ class ThreadProxy : public Proxy, // ResourceUpdateControllerClient implementation virtual void ReadyToFinalizeTextureUpdates() OVERRIDE; - // VSyncProvider implementation - virtual void RequestVSyncNotification(VSyncClient* client) OVERRIDE; - - int MaxFramesPendingForTesting() const { - return scheduler_on_impl_thread_->MaxFramesPending(); - } - - int NumFramesPendingForTesting() const { - return scheduler_on_impl_thread_->NumFramesPendingForTesting(); - } - private: ThreadProxy(LayerTreeHost* layer_tree_host, scoped_ptr<Thread> impl_thread); @@ -143,16 +131,10 @@ class ThreadProxy : public Proxy, const RendererCapabilities& capabilities); // Called on impl thread. - struct ReadbackRequest { - CompletionEvent completion; - bool success; - void* pixels; - gfx::Rect rect; - }; - struct CommitPendingRequest { - CompletionEvent completion; - bool commit_pending; - }; + struct ReadbackRequest; + struct CommitPendingRequest; + struct SchedulerStateRequest; + void ForceCommitOnImplThread(CompletionEvent* completion); void StartCommitOnImplThread( CompletionEvent* completion, @@ -182,6 +164,8 @@ class ThreadProxy : public Proxy, void ForceSerializeOnSwapBuffersOnImplThread(CompletionEvent* completion); void CheckOutputSurfaceStatusOnImplThread(); void CommitPendingOnImplThreadForTesting(CommitPendingRequest* request); + void SchedulerStateAsStringOnImplThreadForTesting( + SchedulerStateRequest* request); void CapturePictureOnImplThread(CompletionEvent* completion, skia::RefPtr<SkPicture>* picture); void AsValueOnImplThread(CompletionEvent* completion, @@ -250,7 +234,6 @@ class ThreadProxy : public Proxy, bool throttle_frame_production_; bool begin_frame_scheduling_enabled_; bool using_synchronous_renderer_compositor_; - VSyncClient* vsync_client_; bool inside_draw_; |