Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: cc/trees/single_thread_proxy.h

Issue 363383002: Forward input tasks to the Blink scheduler (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. DefaultMainThreadTaskRunner now dispatches properly. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_ 5 #ifndef CC_TREES_SINGLE_THREAD_PROXY_H_
6 #define CC_TREES_SINGLE_THREAD_PROXY_H_ 6 #define CC_TREES_SINGLE_THREAD_PROXY_H_
7 7
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "cc/animation/animation_events.h" 11 #include "cc/animation/animation_events.h"
12 #include "cc/output/begin_frame_args.h" 12 #include "cc/output/begin_frame_args.h"
13 #include "cc/trees/layer_tree_host_impl.h" 13 #include "cc/trees/layer_tree_host_impl.h"
14 #include "cc/trees/proxy.h" 14 #include "cc/trees/proxy.h"
15 15
16 namespace cc { 16 namespace cc {
17 17
18 class ContextProvider; 18 class ContextProvider;
19 class LayerTreeHost; 19 class LayerTreeHost;
20 class LayerTreeHostSingleThreadClient; 20 class LayerTreeHostSingleThreadClient;
21 21
22 class CC_EXPORT SingleThreadProxy : public Proxy, 22 class CC_EXPORT SingleThreadProxy : public Proxy,
23 NON_EXPORTED_BASE(LayerTreeHostImplClient) { 23 NON_EXPORTED_BASE(LayerTreeHostImplClient) {
24 public: 24 public:
25 static scoped_ptr<Proxy> Create( 25 static scoped_ptr<Proxy> Create(
26 LayerTreeHost* layer_tree_host, 26 LayerTreeHost* layer_tree_host,
27 LayerTreeHostSingleThreadClient* client); 27 LayerTreeHostSingleThreadClient* client,
28 scoped_refptr<cc::MainThreadTaskRunner> main_task_runner);
28 virtual ~SingleThreadProxy(); 29 virtual ~SingleThreadProxy();
29 30
30 // Proxy implementation 31 // Proxy implementation
31 virtual void FinishAllRendering() OVERRIDE; 32 virtual void FinishAllRendering() OVERRIDE;
32 virtual bool IsStarted() const OVERRIDE; 33 virtual bool IsStarted() const OVERRIDE;
33 virtual void SetLayerTreeHostClientReady() OVERRIDE; 34 virtual void SetLayerTreeHostClientReady() OVERRIDE;
34 virtual void SetVisible(bool visible) OVERRIDE; 35 virtual void SetVisible(bool visible) OVERRIDE;
35 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE; 36 virtual const RendererCapabilities& GetRendererCapabilities() const OVERRIDE;
36 virtual void SetNeedsAnimate() OVERRIDE; 37 virtual void SetNeedsAnimate() OVERRIDE;
37 virtual void SetNeedsUpdateLayers() OVERRIDE; 38 virtual void SetNeedsUpdateLayers() OVERRIDE;
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 87
87 // Attempts to create the context and renderer synchronously. Calls 88 // Attempts to create the context and renderer synchronously. Calls
88 // LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted with the result. 89 // LayerTreeHost::OnCreateAndInitializeOutputSurfaceAttempted with the result.
89 void CreateAndInitializeOutputSurface(); 90 void CreateAndInitializeOutputSurface();
90 91
91 // Called by the legacy path where RenderWidget does the scheduling. 92 // Called by the legacy path where RenderWidget does the scheduling.
92 void CompositeImmediately(base::TimeTicks frame_begin_time); 93 void CompositeImmediately(base::TimeTicks frame_begin_time);
93 94
94 private: 95 private:
95 SingleThreadProxy(LayerTreeHost* layer_tree_host, 96 SingleThreadProxy(LayerTreeHost* layer_tree_host,
96 LayerTreeHostSingleThreadClient* client); 97 LayerTreeHostSingleThreadClient* client,
98 scoped_refptr<cc::MainThreadTaskRunner> main_task_runner);
97 99
98 void DoCommit(scoped_ptr<ResourceUpdateQueue> queue); 100 void DoCommit(scoped_ptr<ResourceUpdateQueue> queue);
99 bool DoComposite(base::TimeTicks frame_begin_time, 101 bool DoComposite(base::TimeTicks frame_begin_time,
100 LayerTreeHostImpl::FrameData* frame); 102 LayerTreeHostImpl::FrameData* frame);
101 void DidSwapFrame(); 103 void DidSwapFrame();
102 104
103 bool ShouldComposite() const; 105 bool ShouldComposite() const;
104 void UpdateBackgroundAnimateTicking(); 106 void UpdateBackgroundAnimateTicking();
105 107
106 // Accessed on main thread only. 108 // Accessed on main thread only.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 private: 178 private:
177 DebugScopedSetImplThread impl_thread_; 179 DebugScopedSetImplThread impl_thread_;
178 DebugScopedSetMainThreadBlocked main_thread_blocked_; 180 DebugScopedSetMainThreadBlocked main_thread_blocked_;
179 181
180 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked); 182 DISALLOW_COPY_AND_ASSIGN(DebugScopedSetImplThreadAndMainThreadBlocked);
181 }; 183 };
182 184
183 } // namespace cc 185 } // namespace cc
184 186
185 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_ 187 #endif // CC_TREES_SINGLE_THREAD_PROXY_H_
OLDNEW
« no previous file with comments | « cc/trees/proxy.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | cc/trees/thread_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698