| Index: cc/trees/single_thread_proxy.h
|
| diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h
|
| index 7ad48b48bee6aa3414815fa0a3e4bde4abd39a3b..fcc04fd0458852c12de3d643474be8b2294a89ae 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,
|
| @@ -49,6 +52,25 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| virtual void ForceSerializeOnSwapBuffers() 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 ScheduledActionActivatePendingTree() 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;
|
| @@ -59,7 +81,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;
|
| @@ -79,8 +101,8 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| virtual void PostDelayedScrollbarFadeOnImplThread(
|
| const base::Closure& start_fade,
|
| base::TimeDelta delay) OVERRIDE {}
|
| - virtual void DidActivatePendingTree() OVERRIDE {}
|
| - virtual void DidManageTiles() OVERRIDE {}
|
| + virtual void DidActivatePendingTree() OVERRIDE;
|
| + virtual void DidManageTiles() OVERRIDE;
|
| virtual void SetDebugState(const LayerTreeDebugState& debug_state) OVERRIDE {}
|
|
|
| // Attempts to create the context and renderer synchronously. Calls
|
| @@ -94,10 +116,11 @@ class CC_EXPORT SingleThreadProxy : public Proxy,
|
| SingleThreadProxy(LayerTreeHost* layer_tree_host,
|
| LayerTreeHostSingleThreadClient* client);
|
|
|
| - 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();
|
| @@ -111,9 +134,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);
|
| };
|
|
|