| Index: cc/trees/single_thread_proxy.h
|
| diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
|
| index cd593aca6092b76ed550d940f0f9b9b89ee9dc90..bb2b7ed4a8815acecf93f696a5b9254bd11fe2d0 100644
|
| --- a/cc/trees/single_thread_proxy.h
|
| +++ b/cc/trees/single_thread_proxy.h
|
| @@ -10,8 +10,10 @@
|
| #include "base/time/time.h"
|
| #include "cc/animation/animation_events.h"
|
| #include "cc/output/begin_frame_args.h"
|
| +#include "cc/scheduler/scheduler.h"
|
| #include "cc/trees/layer_tree_host_impl.h"
|
| #include "cc/trees/proxy.h"
|
| +#include "cc/trees/proxy_timing_history.h"
|
|
|
| namespace cc {
|
|
|
| @@ -20,7 +22,8 @@ class LayerTreeHost;
|
| class LayerTreeHostSingleThreadClient;
|
|
|
| class CC_EXPORT SingleThreadProxy : public Proxy,
|
| - NON_EXPORTED_BASE(LayerTreeHostImplClient) {
|
| + NON_EXPORTED_BASE(LayerTreeHostImplClient),
|
| + SchedulerClient {
|
| public:
|
| static scoped_ptr<Proxy> Create(
|
| LayerTreeHost* layer_tree_host,
|
| @@ -51,6 +54,25 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| virtual bool SupportsImplScrolling() const OVERRIDE;
|
| virtual scoped_ptr<base::Value> AsValue() const OVERRIDE;
|
| virtual bool CommitPendingForTesting() OVERRIDE;
|
| + virtual scoped_ptr<base::Value> SchedulerAsValueForTesting() OVERRIDE;
|
| +
|
| + // SchedulerClient implementation
|
| + virtual void SetNeedsBeginFrame(bool enable) OVERRIDE;
|
| + virtual void WillBeginImplFrame(const BeginFrameArgs& args) OVERRIDE;
|
| + virtual void ScheduledActionSendBeginMainFrame() OVERRIDE;
|
| + virtual DrawResult ScheduledActionDrawAndSwapIfPossible() OVERRIDE;
|
| + virtual DrawResult ScheduledActionDrawAndSwapForced() OVERRIDE;
|
| + virtual void ScheduledActionCommit() OVERRIDE;
|
| + virtual void ScheduledActionAnimate() OVERRIDE;
|
| + virtual void ScheduledActionUpdateVisibleTiles() OVERRIDE;
|
| + virtual void ScheduledActionActivateSyncTree() OVERRIDE;
|
| + virtual void ScheduledActionBeginOutputSurfaceCreation() OVERRIDE;
|
| + virtual void ScheduledActionManageTiles() OVERRIDE;
|
| + virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) OVERRIDE;
|
| + virtual base::TimeDelta DrawDurationEstimate() OVERRIDE;
|
| + virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() OVERRIDE;
|
| + virtual base::TimeDelta CommitToActivateDurationEstimate() OVERRIDE;
|
| + virtual void DidBeginImplFrameDeadline() OVERRIDE;
|
|
|
| // LayerTreeHostImplClient implementation
|
| virtual void UpdateRendererCapabilitiesOnImplThread() OVERRIDE;
|
| @@ -61,7 +83,7 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| virtual void SetMaxSwapsPendingOnImplThread(int max) OVERRIDE {}
|
| virtual void DidSwapBuffersOnImplThread() OVERRIDE;
|
| virtual void DidSwapBuffersCompleteOnImplThread() OVERRIDE;
|
| - virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE {}
|
| + virtual void BeginFrame(const BeginFrameArgs& args) OVERRIDE;
|
| virtual void OnCanDrawStateChanged(bool can_draw) OVERRIDE;
|
| virtual void NotifyReadyToActivate() OVERRIDE;
|
| virtual void SetNeedsRedrawOnImplThread() OVERRIDE;
|
| @@ -82,7 +104,7 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| const base::Closure& start_fade,
|
| base::TimeDelta delay) OVERRIDE {}
|
| virtual void DidActivateSyncTree() OVERRIDE {}
|
| - virtual void DidManageTiles() OVERRIDE {}
|
| + virtual void DidManageTiles() OVERRIDE;
|
| virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE {}
|
|
|
| // Attempts to create the context and renderer synchronously. Calls
|
| @@ -98,10 +120,11 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| LayerTreeHostSingleThreadClient* client,
|
| scoped_refptr<base::SingleThreadTaskRunner> main_task_runner);
|
|
|
| - void DoCommit(scoped_ptr<ResourceUpdateQueue> queue);
|
| - bool DoComposite(base::TimeTicks frame_begin_time,
|
| - LayerTreeHostImpl::FrameData* frame);
|
| - void DidSwapFrame();
|
| + void DoCommit(base::TimeTicks frame_begin_time);
|
| + DrawResult DoComposite(base::TimeTicks frame_begin_time,
|
| + LayerTreeHostImpl::FrameData* frame);
|
| + void DoSwap();
|
| + void DidCommitAndDrawFrame();
|
|
|
| bool ShouldComposite() const;
|
| void UpdateBackgroundAnimateTicking();
|
| @@ -115,9 +138,18 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| scoped_ptr<LayerTreeHostImpl> layer_tree_host_impl_;
|
| RendererCapabilities renderer_capabilities_for_main_thread_;
|
|
|
| + // Accessed from both threads.
|
| + scoped_ptr<Scheduler> scheduler_on_impl_thread_;
|
| + ProxyTimingHistory timing_history_;
|
| +
|
| bool next_frame_is_newly_committed_frame_;
|
|
|
| bool inside_draw_;
|
| + bool defer_commits_;
|
| + bool commit_was_deferred_;
|
| + bool commit_requested_;
|
| +
|
| + base::WeakPtrFactory<SingleThreadProxy> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SingleThreadProxy);
|
| };
|
|
|