OLD | NEW |
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_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_LAYER_TREE_HOST_IMPL_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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 gfx::Vector2dF m_zoomedViewportOffset; | 108 gfx::Vector2dF m_zoomedViewportOffset; |
109 gfx::SizeF m_layoutViewportSize; | 109 gfx::SizeF m_layoutViewportSize; |
110 }; | 110 }; |
111 | 111 |
112 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te | 112 // LayerTreeHostImpl owns the LayerImpl tree as well as associated rendering sta
te |
113 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, | 113 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, |
114 public RendererClient, | 114 public RendererClient, |
115 public TileManagerClient, | 115 public TileManagerClient, |
116 public NON_EXPORTED_BASE(WebKit::WebComposit
orOutputSurfaceClient) { | 116 public NON_EXPORTED_BASE(WebKit::WebComposit
orOutputSurfaceClient) { |
117 typedef std::vector<LayerImpl*> LayerList; | 117 typedef std::vector<LayerImpl*> LayerList; |
| 118 typedef base::hash_set<LayerAnimationController*> AnimationControllerSet; |
118 | 119 |
119 public: | 120 public: |
120 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); | 121 static scoped_ptr<LayerTreeHostImpl> create(const LayerTreeSettings&, LayerT
reeHostImplClient*, Proxy*); |
121 virtual ~LayerTreeHostImpl(); | 122 virtual ~LayerTreeHostImpl(); |
122 | 123 |
123 // InputHandlerClient implementation | 124 // InputHandlerClient implementation |
124 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; | 125 virtual InputHandlerClient::ScrollStatus scrollBegin(gfx::Point, InputHandle
rClient::ScrollInputType) OVERRIDE; |
125 virtual bool scrollBy(const gfx::Point&, const gfx::Vector2d&) OVERRIDE; | 126 virtual bool scrollBy(const gfx::Point&, const gfx::Vector2d&) OVERRIDE; |
126 virtual void scrollEnd() OVERRIDE; | 127 virtual void scrollEnd() OVERRIDE; |
127 virtual void pinchGestureBegin() OVERRIDE; | 128 virtual void pinchGestureBegin() OVERRIDE; |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); | 234 scoped_ptr<ScrollAndScaleSet> processScrollDeltas(); |
234 gfx::Transform implTransform() const; | 235 gfx::Transform implTransform() const; |
235 | 236 |
236 void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, flo
at scale, base::TimeDelta duration); | 237 void startPageScaleAnimation(gfx::Vector2d targetOffset, bool useAnchor, flo
at scale, base::TimeDelta duration); |
237 | 238 |
238 SkColor backgroundColor() const { return m_backgroundColor; } | 239 SkColor backgroundColor() const { return m_backgroundColor; } |
239 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } | 240 void setBackgroundColor(SkColor color) { m_backgroundColor = color; } |
240 | 241 |
241 bool hasTransparentBackground() const { return m_hasTransparentBackground; } | 242 bool hasTransparentBackground() const { return m_hasTransparentBackground; } |
242 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } | 243 void setHasTransparentBackground(bool transparent) { m_hasTransparentBackgro
und = transparent; } |
243 | 244 bool needsAnimateLayers() const; |
244 bool needsAnimateLayers() const { return m_needsAnimateLayers; } | |
245 void setNeedsAnimateLayers() { m_needsAnimateLayers = true; } | |
246 | 245 |
247 void setNeedsRedraw(); | 246 void setNeedsRedraw(); |
248 | 247 |
249 void renderingStats(RenderingStats*) const; | 248 void renderingStats(RenderingStats*) const; |
250 | 249 |
251 void updateRootScrollLayerImplTransform(); | 250 void updateRootScrollLayerImplTransform(); |
252 | 251 |
253 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } | 252 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
254 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } | 253 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } |
255 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 254 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 gfx::Size m_deviceViewportSize; | 348 gfx::Size m_deviceViewportSize; |
350 float m_deviceScaleFactor; | 349 float m_deviceScaleFactor; |
351 bool m_visible; | 350 bool m_visible; |
352 bool m_contentsTexturesPurged; | 351 bool m_contentsTexturesPurged; |
353 ManagedMemoryPolicy m_managedMemoryPolicy; | 352 ManagedMemoryPolicy m_managedMemoryPolicy; |
354 | 353 |
355 SkColor m_backgroundColor; | 354 SkColor m_backgroundColor; |
356 bool m_hasTransparentBackground; | 355 bool m_hasTransparentBackground; |
357 | 356 |
358 // If this is true, it is necessary to traverse the layer tree ticking the a
nimators. | 357 // If this is true, it is necessary to traverse the layer tree ticking the a
nimators. |
359 bool m_needsAnimateLayers; | |
360 bool m_pinchGestureActive; | 358 bool m_pinchGestureActive; |
361 gfx::Point m_previousPinchAnchor; | 359 gfx::Point m_previousPinchAnchor; |
362 | 360 |
363 scoped_ptr<PageScaleAnimation> m_pageScaleAnimation; | 361 scoped_ptr<PageScaleAnimation> m_pageScaleAnimation; |
364 | 362 |
365 // This is used for ticking animations slowly when hidden. | 363 // This is used for ticking animations slowly when hidden. |
366 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; | 364 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; |
367 | 365 |
368 LayerSorter m_layerSorter; | 366 LayerSorter m_layerSorter; |
369 | 367 |
(...skipping 10 matching lines...) Expand all Loading... |
380 size_t m_numMainThreadScrolls; | 378 size_t m_numMainThreadScrolls; |
381 | 379 |
382 size_t m_cumulativeNumLayersDrawn; | 380 size_t m_cumulativeNumLayersDrawn; |
383 | 381 |
384 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 382 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
385 }; | 383 }; |
386 | 384 |
387 } // namespace cc | 385 } // namespace cc |
388 | 386 |
389 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 387 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |