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