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

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: Address code review comments and fix all cc_unittests 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 "CCAnimationEvents.h" 8 #include "CCAnimationEvents.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 FloatSize m_layoutViewportSize; 96 FloatSize m_layoutViewportSize;
97 }; 97 };
98 98
99 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta te 99 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta te
100 class LayerTreeHostImpl : public InputHandlerClient, 100 class LayerTreeHostImpl : public InputHandlerClient,
101 public RendererClient, 101 public RendererClient,
102 public WebKit::WebCompositorOutputSurfaceClient { 102 public WebKit::WebCompositorOutputSurfaceClient {
103 typedef std::vector<LayerImpl*> LayerList; 103 typedef std::vector<LayerImpl*> LayerList;
104 104
105 public: 105 public:
106 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*); 106 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT reeHostImplClient*, Proxy*);
107 virtual ~LayerTreeHostImpl(); 107 virtual ~LayerTreeHostImpl();
108 108
109 // InputHandlerClient implementation 109 // InputHandlerClient implementation
110 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE; 110 virtual InputHandlerClient::ScrollStatus scrollBegin(const IntPoint&, InputH andlerClient::ScrollInputType) OVERRIDE;
111 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE; 111 virtual void scrollBy(const IntPoint&, const IntSize&) OVERRIDE;
112 virtual void scrollEnd() OVERRIDE; 112 virtual void scrollEnd() OVERRIDE;
113 virtual void pinchGestureBegin() OVERRIDE; 113 virtual void pinchGestureBegin() OVERRIDE;
114 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE; 114 virtual void pinchGestureUpdate(float, const IntPoint&) OVERRIDE;
115 virtual void pinchGestureEnd() OVERRIDE; 115 virtual void pinchGestureEnd() OVERRIDE;
116 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, double startTime, double duration) OVERRIDE; 116 virtual void startPageScaleAnimation(const IntSize& targetPosition, bool anc horPoint, float pageScale, double startTime, double duration) OVERRIDE;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 void setNeedsRedraw(); 223 void setNeedsRedraw();
224 224
225 void renderingStats(RenderingStats*) const; 225 void renderingStats(RenderingStats*) const;
226 226
227 void updateRootScrollLayerImplTransform(); 227 void updateRootScrollLayerImplTransform();
228 228
229 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } 229 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); }
230 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get() ; } 230 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get() ; }
231 ResourceProvider* resourceProvider() const { return m_resourceProvider.get() ; } 231 ResourceProvider* resourceProvider() const { return m_resourceProvider.get() ; }
232 Proxy* proxy() const { return m_proxy; }
232 233
233 class CullRenderPassesWithCachedTextures { 234 class CullRenderPassesWithCachedTextures {
234 public: 235 public:
235 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const; 236 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&) const;
236 237
237 // Iterates from the root first, in order to remove the surfaces closest 238 // Iterates from the root first, in order to remove the surfaces closest
238 // to the root with cached textures, and all surfaces that draw into 239 // to the root with cached textures, and all surfaces that draw into
239 // them. 240 // them.
240 size_t renderPassListBegin(const RenderPassList& list) const { return li st.size() - 1; } 241 size_t renderPassListBegin(const RenderPassList& list) const { return li st.size() - 1; }
241 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; } 242 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; }
(...skipping 12 matching lines...) Expand all
254 // target becomes empty, then its target can be removed also. 255 // target becomes empty, then its target can be removed also.
255 size_t renderPassListBegin(const RenderPassList&) const { return 0; } 256 size_t renderPassListBegin(const RenderPassList&) const { return 0; }
256 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); } 257 size_t renderPassListEnd(const RenderPassList& list) const { return list .size(); }
257 size_t renderPassListNext(size_t it) const { return it + 1; } 258 size_t renderPassListNext(size_t it) const { return it + 1; }
258 }; 259 };
259 260
260 template<typename RenderPassCuller> 261 template<typename RenderPassCuller>
261 static void removeRenderPasses(RenderPassCuller, FrameData&); 262 static void removeRenderPasses(RenderPassCuller, FrameData&);
262 263
263 protected: 264 protected:
264 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*); 265 LayerTreeHostImpl(const LayerTreeSettings&, LayerTreeHostImplClient*, Proxy* );
265 266
266 void animatePageScale(double monotonicTime); 267 void animatePageScale(double monotonicTime);
267 void animateScrollbars(double monotonicTime); 268 void animateScrollbars(double monotonicTime);
268 269
269 // Exposed for testing. 270 // Exposed for testing.
270 void calculateRenderSurfaceLayerList(LayerList&); 271 void calculateRenderSurfaceLayerList(LayerList&);
271 272
272 // Virtual for testing. 273 // Virtual for testing.
273 virtual void animateLayers(double monotonicTime, double wallClockTime); 274 virtual void animateLayers(double monotonicTime, double wallClockTime);
274 275
275 // Virtual for testing. 276 // Virtual for testing.
276 virtual base::TimeDelta lowFrequencyAnimationInterval() const; 277 virtual base::TimeDelta lowFrequencyAnimationInterval() const;
277 278
278 LayerTreeHostImplClient* m_client; 279 LayerTreeHostImplClient* m_client;
280 Proxy* m_proxy;
279 int m_sourceFrameNumber; 281 int m_sourceFrameNumber;
280 282
281 private: 283 private:
282 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo); 284 void computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo);
283 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo); 285 void computePinchZoomDeltas(ScrollAndScaleSet* scrollInfo);
284 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale); 286 void makeScrollAndScaleSet(ScrollAndScaleSet* scrollInfo, const IntSize& scr ollOffset, float pageScale);
285 287
286 void setPageScaleDelta(float); 288 void setPageScaleDelta(float);
287 void updateMaxScrollPosition(); 289 void updateMaxScrollPosition();
288 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList); 290 void trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, const LayerList& re nderSurfaceLayerList);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 349
348 size_t m_numImplThreadScrolls; 350 size_t m_numImplThreadScrolls;
349 size_t m_numMainThreadScrolls; 351 size_t m_numMainThreadScrolls;
350 352
351 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); 353 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
352 }; 354 };
353 355
354 } // namespace cc 356 } // namespace cc
355 357
356 #endif 358 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698