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 16 matching lines...) Expand all Loading... |
27 namespace cc { | 27 namespace cc { |
28 | 28 |
29 class CompletionEvent; | 29 class CompletionEvent; |
30 class CompositorFrameMetadata; | 30 class CompositorFrameMetadata; |
31 class DebugRectHistory; | 31 class DebugRectHistory; |
32 class FrameRateCounter; | 32 class FrameRateCounter; |
33 class LayerImpl; | 33 class LayerImpl; |
34 class LayerTreeHostImplTimeSourceAdapter; | 34 class LayerTreeHostImplTimeSourceAdapter; |
35 class LayerTreeImpl; | 35 class LayerTreeImpl; |
36 class PageScaleAnimation; | 36 class PageScaleAnimation; |
| 37 class PaintTimeCounter; |
37 class RenderPassDrawQuad; | 38 class RenderPassDrawQuad; |
38 class ResourceProvider; | 39 class ResourceProvider; |
39 class TopControlsManager; | 40 class TopControlsManager; |
40 struct RendererCapabilities; | 41 struct RendererCapabilities; |
41 struct RenderingStats; | 42 struct RenderingStats; |
42 | 43 |
43 // LayerTreeHost->Proxy callback interface. | 44 // LayerTreeHost->Proxy callback interface. |
44 class LayerTreeHostImplClient { | 45 class LayerTreeHostImplClient { |
45 public: | 46 public: |
46 virtual void didLoseOutputSurfaceOnImplThread() = 0; | 47 virtual void didLoseOutputSurfaceOnImplThread() = 0; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} | 198 bool needsUpdateDrawProperties() const { return m_needsUpdateDrawProperties;
} |
198 | 199 |
199 void renderingStats(RenderingStats*) const; | 200 void renderingStats(RenderingStats*) const; |
200 | 201 |
201 void sendManagedMemoryStats( | 202 void sendManagedMemoryStats( |
202 size_t memoryVisibleBytes, | 203 size_t memoryVisibleBytes, |
203 size_t memoryVisibleAndNearbyBytes, | 204 size_t memoryVisibleAndNearbyBytes, |
204 size_t memoryUseBytes); | 205 size_t memoryUseBytes); |
205 | 206 |
206 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } | 207 FrameRateCounter* fpsCounter() const { return m_fpsCounter.get(); } |
| 208 PaintTimeCounter* paintTimeCounter() const { return m_paintTimeCounter.get()
; } |
207 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } | 209 DebugRectHistory* debugRectHistory() const { return m_debugRectHistory.get()
; } |
208 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } | 210 ResourceProvider* resourceProvider() const { return m_resourceProvider.get()
; } |
209 TopControlsManager* topControlsManager() const { return m_topControlsManager
.get(); } | 211 TopControlsManager* topControlsManager() const { return m_topControlsManager
.get(); } |
210 | 212 |
211 Proxy* proxy() const { return m_proxy; } | 213 Proxy* proxy() const { return m_proxy; } |
212 | 214 |
213 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } | 215 AnimationRegistrar* animationRegistrar() const { return m_animationRegistrar
.get(); } |
214 | 216 |
215 void setDebugState(const LayerTreeDebugState& debugState) { m_debugState = d
ebugState; } | 217 void setDebugState(const LayerTreeDebugState& debugState) { m_debugState = d
ebugState; } |
216 const LayerTreeDebugState& debugState() const { return m_debugState; } | 218 const LayerTreeDebugState& debugState() const { return m_debugState; } |
217 | 219 |
| 220 void savePaintTime(const base::TimeDelta& totalPaintTime); |
| 221 |
218 class CC_EXPORT CullRenderPassesWithCachedTextures { | 222 class CC_EXPORT CullRenderPassesWithCachedTextures { |
219 public: | 223 public: |
220 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&)
const; | 224 bool shouldRemoveRenderPass(const RenderPassDrawQuad&, const FrameData&)
const; |
221 | 225 |
222 // Iterates from the root first, in order to remove the surfaces closest | 226 // Iterates from the root first, in order to remove the surfaces closest |
223 // to the root with cached textures, and all surfaces that draw into | 227 // to the root with cached textures, and all surfaces that draw into |
224 // them. | 228 // them. |
225 size_t renderPassListBegin(const RenderPassList& list) const { return li
st.size() - 1; } | 229 size_t renderPassListBegin(const RenderPassList& list) const { return li
st.size() - 1; } |
226 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; } | 230 size_t renderPassListEnd(const RenderPassList&) const { return 0 - 1; } |
227 size_t renderPassListNext(size_t it) const { return it - 1; } | 231 size_t renderPassListNext(size_t it) const { return it - 1; } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 scoped_ptr<TopControlsManager> m_topControlsManager; | 330 scoped_ptr<TopControlsManager> m_topControlsManager; |
327 | 331 |
328 scoped_ptr<PageScaleAnimation> m_pageScaleAnimation; | 332 scoped_ptr<PageScaleAnimation> m_pageScaleAnimation; |
329 | 333 |
330 // This is used for ticking animations slowly when hidden. | 334 // This is used for ticking animations slowly when hidden. |
331 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; | 335 scoped_ptr<LayerTreeHostImplTimeSourceAdapter> m_timeSourceClientAdapter; |
332 | 336 |
333 PinchZoomViewport m_pinchZoomViewport; | 337 PinchZoomViewport m_pinchZoomViewport; |
334 | 338 |
335 scoped_ptr<FrameRateCounter> m_fpsCounter; | 339 scoped_ptr<FrameRateCounter> m_fpsCounter; |
| 340 scoped_ptr<PaintTimeCounter> m_paintTimeCounter; |
336 scoped_ptr<DebugRectHistory> m_debugRectHistory; | 341 scoped_ptr<DebugRectHistory> m_debugRectHistory; |
337 | 342 |
338 int64 m_numImplThreadScrolls; | 343 int64 m_numImplThreadScrolls; |
339 int64 m_numMainThreadScrolls; | 344 int64 m_numMainThreadScrolls; |
340 | 345 |
341 int64 m_cumulativeNumLayersDrawn; | 346 int64 m_cumulativeNumLayersDrawn; |
342 | 347 |
343 int64 m_cumulativeNumMissingTiles; | 348 int64 m_cumulativeNumMissingTiles; |
344 | 349 |
345 size_t m_lastSentMemoryVisibleBytes; | 350 size_t m_lastSentMemoryVisibleBytes; |
346 size_t m_lastSentMemoryVisibleAndNearbyBytes; | 351 size_t m_lastSentMemoryVisibleAndNearbyBytes; |
347 size_t m_lastSentMemoryUseBytes; | 352 size_t m_lastSentMemoryUseBytes; |
348 | 353 |
349 scoped_ptr<AnimationRegistrar> m_animationRegistrar; | 354 scoped_ptr<AnimationRegistrar> m_animationRegistrar; |
350 | 355 |
351 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 356 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
352 }; | 357 }; |
353 | 358 |
354 } // namespace cc | 359 } // namespace cc |
355 | 360 |
356 #endif // CC_LAYER_TREE_HOST_IMPL_H_ | 361 #endif // CC_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |