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

Side by Side Diff: cc/layer_tree_host_impl.h

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 165444 Created 8 years, 1 month 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
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 CCLayerTreeHostImpl_h 5 #ifndef CCLayerTreeHostImpl_h
6 #define CCLayerTreeHostImpl_h 6 #define CCLayerTreeHostImpl_h
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 gfx::SizeF m_layoutViewportSize; 98 gfx::SizeF m_layoutViewportSize;
99 }; 99 };
100 100
101 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta te 101 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta te
102 class LayerTreeHostImpl : public InputHandlerClient, 102 class LayerTreeHostImpl : public InputHandlerClient,
103 public RendererClient, 103 public RendererClient,
104 public WebKit::WebCompositorOutputSurfaceClient { 104 public WebKit::WebCompositorOutputSurfaceClient {
105 typedef std::vector<LayerImpl*> LayerList; 105 typedef std::vector<LayerImpl*> LayerList;
106 106
107 public: 107 public:
108 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*); 108 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*, Proxy*);
109 virtual ~LayerTreeHostImpl(); 109 virtual ~LayerTreeHostImpl();
110 110
111 // InputHandlerClient implementation 111 // InputHandlerClient implementation
112 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE; 112 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE;
113 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE; 113 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE;
114 virtual void scrollEnd() OVERRIDE; 114 virtual void scrollEnd() OVERRIDE;
115 virtual void pinchGestureBegin() OVERRIDE; 115 virtual void pinchGestureBegin() OVERRIDE;
116 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE; 116 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE;
117 virtual void pinchGestureEnd() OVERRIDE; 117 virtual void pinchGestureEnd() OVERRIDE;
118 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVERRIDE; 118 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, base::TimeTicks startTime, base::TimeDelta duration) OVERRIDE;
(...skipping 28 matching lines...) Expand all
147 void didDrawAllLayers(const FrameData&); 147 void didDrawAllLayers(const FrameData&);
148 148
149 // RendererClient implementation 149 // RendererClient implementation
150 virtual const gfx::Size& deviceViewportSize() const OVERRIDE; 150 virtual const gfx::Size& deviceViewportSize() const OVERRIDE;
151 virtual const LayerTreeSettings& settings() const OVERRIDE; 151 virtual const LayerTreeSettings& settings() const OVERRIDE;
152 virtual void didLoseContext() OVERRIDE; 152 virtual void didLoseContext() OVERRIDE;
153 virtual void onSwapBuffersComplete() OVERRIDE; 153 virtual void onSwapBuffersComplete() OVERRIDE;
154 virtual void setFullRootLayerDamage() OVERRIDE; 154 virtual void setFullRootLayerDamage() OVERRIDE;
155 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE; 155 virtual void setManagedMemoryPolicy(const ManagedMemoryPolicy& policy) OVERR IDE;
156 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE; 156 virtual void enforceManagedMemoryPolicy(const ManagedMemoryPolicy& policy) O VERRIDE;
157 virtual bool hasImplThread() const OVERRIDE;
157 158
158 // WebCompositorOutputSurfaceClient implementation. 159 // WebCompositorOutputSurfaceClient implementation.
159 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter valInSeconds) OVERRIDE; 160 virtual void onVSyncParametersChanged(double monotonicTimebase, double inter valInSeconds) OVERRIDE;
160 161
161 // Implementation 162 // Implementation
162 bool canDraw(); 163 bool canDraw();
163 GraphicsContext* context() const; 164 GraphicsContext* context() const;
164 165
165 std::string layerTreeAsText() const; 166 std::string layerTreeAsText() const;
166 167
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 225
225 void setNeedsRedraw(); 226 void setNeedsRedraw();
226 227
227 void renderingStats(RenderingStats*) const; 228 void renderingStats(RenderingStats*) const;
228 229
229 void updateRootScrollLayerImplTransform(); 230 void updateRootScrollLayerImplTransform();
230 231
231 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } 232 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); }
232 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get() ; } 233 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get() ; }
233 ResourceProvider* resourceProvider() const { return m_resourceProvider.get() ; } 234 ResourceProvider* resourceProvider() const { return m_resourceProvider.get() ; }
235 Proxy* proxy() const { return m_proxy; }
234 236
235 class CullRenderPassesWithCachedTextures { 237 class CullRenderPassesWithCachedTextures {
236 public: 238 public:
237 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const; 239 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const;
238 240
239 // Iterates from the root first, in order to remove the surfaces closest 241 // Iterates from the root first, in order to remove the surfaces closest
240 // to the root with cached textures, and all surfaces that draw into 242 // to the root with cached textures, and all surfaces that draw into
241 // them. 243 // them.
242 size_t renderPassListBegin(const RenderPassList& list) const { return li st.size() - 1; } 244 size_t renderPassListBegin(const RenderPassList& list) const { return li st.size() - 1; }
243 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; } 245 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; }
(...skipping 12 matching lines...) Expand all
256 // target becomes empty, then its target can be removed also. 258 // target becomes empty, then its target can be removed also.
257 size_t renderPassListBegin(const RenderPassList&) const { return 0; } 259 size_t renderPassListBegin(const RenderPassList&) const { return 0; }
258 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); } 260 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); }
259 size_t renderPassListNext(size_t it) const { return it + 1; } 261 size_t renderPassListNext(size_t it) const { return it + 1; }
260 }; 262 };
261 263
262 template<typename RenderPassCuller> 264 template<typename RenderPassCuller>
263 static void removeRenderPasses(RenderPassCuller, FrameData&); 265 static void removeRenderPasses(RenderPassCuller, FrameData&);
264 266
265 protected: 267 protected:
266 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*); 268 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*, Proxy* );
267 269
268 void animatePageScale(base::TimeTicks monotonicTime); 270 void animatePageScale(base::TimeTicks monotonicTime);
269 void animateScrollbars(base::TimeTicks monotonicTime); 271 void animateScrollbars(base::TimeTicks monotonicTime);
270 272
271 // Exposed for testing. 273 // Exposed for testing.
272 void calculateRenderSurfaceLayerList(LayerList&); 274 void calculateRenderSurfaceLayerList(LayerList&);
273 275
274 // Virtual for testing. 276 // Virtual for testing.
275 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo ckTime); 277 virtual void animateLayers(base::TimeTicks monotonicTime, base::Time wallClo ckTime);
276 278
277 // Virtual for testing. 279 // Virtual for testing.
278 virtual base::TimeDelta lowFrequencyAnimationInterval() const; 280 virtual base::TimeDelta lowFrequencyAnimationInterval() const;
279 281
280 LayerTreeHostImplClient* m_client; 282 LayerTreeHostImplClient* m_client;
283 Proxy* m_proxy;
281 int m_sourceFrameNumber; 284 int m_sourceFrameNumber;
282 285
283 private: 286 private:
284 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo); 287 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo);
285 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo); 288 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo);
286 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale); 289 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale);
287 290
288 void setPageScaleDelta(float); 291 void setPageScaleDelta(float);
289 void updateMaxScrollPosition(); 292 void updateMaxScrollPosition();
290 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList); 293 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 352
350 size_t m_numImplThreadScrolls; 353 size_t m_numImplThreadScrolls;
351 size_t m_numMainThreadScrolls; 354 size_t m_numMainThreadScrolls;
352 355
353 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 356 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
354 }; 357 };
355 358
356 } // namespace cc 359 } // namespace cc
357 360
358 #endif 361 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698