Index: trunk/src/cc/trees/thread_proxy.h |
=================================================================== |
--- trunk/src/cc/trees/thread_proxy.h (revision 206654) |
+++ trunk/src/cc/trees/thread_proxy.h (working copy) |
@@ -5,8 +5,6 @@ |
#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" |
@@ -15,6 +13,7 @@ |
#include "cc/resources/resource_update_controller.h" |
#include "cc/scheduler/rolling_time_delta_history.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" |
@@ -31,7 +30,8 @@ |
class ThreadProxy : public Proxy, |
LayerTreeHostImplClient, |
SchedulerClient, |
- ResourceUpdateControllerClient { |
+ ResourceUpdateControllerClient, |
+ VSyncProvider { |
public: |
static scoped_ptr<Proxy> Create(LayerTreeHost* layer_tree_host, |
scoped_ptr<Thread> impl_thread); |
@@ -60,7 +60,6 @@ |
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( |
@@ -68,7 +67,10 @@ |
scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE; |
virtual void DidLoseOutputSurfaceOnImplThread() OVERRIDE; |
virtual void OnSwapBuffersCompleteOnImplThread() OVERRIDE; |
- virtual void BeginFrameOnImplThread(base::TimeTicks frame_time) 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; |
virtual void OnHasPendingTreeStateChanged(bool has_pending_tree) OVERRIDE; |
virtual void SetNeedsRedrawOnImplThread() OVERRIDE; |
@@ -90,7 +92,6 @@ |
virtual void DidActivatePendingTree() OVERRIDE; |
// SchedulerClient implementation |
- virtual void SetNeedsBeginFrameOnImplThread(bool enable) OVERRIDE; |
virtual void ScheduledActionSendBeginFrameToMainThread() OVERRIDE; |
virtual ScheduledActionDrawAndSwapResult |
ScheduledActionDrawAndSwapIfPossible() OVERRIDE; |
@@ -107,6 +108,17 @@ |
// 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); |
@@ -133,10 +145,16 @@ |
const RendererCapabilities& capabilities); |
// Called on impl thread. |
- struct ReadbackRequest; |
- struct CommitPendingRequest; |
- struct SchedulerStateRequest; |
- |
+ struct ReadbackRequest { |
+ CompletionEvent completion; |
+ bool success; |
+ void* pixels; |
+ gfx::Rect rect; |
+ }; |
+ struct CommitPendingRequest { |
+ CompletionEvent completion; |
+ bool commit_pending; |
+ }; |
void ForceCommitOnImplThread(CompletionEvent* completion); |
void StartCommitOnImplThread( |
CompletionEvent* completion, |
@@ -166,8 +184,6 @@ |
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, |
@@ -236,6 +252,7 @@ |
bool throttle_frame_production_; |
bool begin_frame_scheduling_enabled_; |
bool using_synchronous_renderer_compositor_; |
+ VSyncClient* vsync_client_; |
bool inside_draw_; |