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_TREES_LAYER_TREE_HOST_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
7 | 7 |
| 8 #include <string> |
| 9 #include <vector> |
| 10 |
8 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 13 #include "base/time.h" |
11 #include "cc/animation/animation_events.h" | 14 #include "cc/animation/animation_events.h" |
12 #include "cc/animation/animation_registrar.h" | 15 #include "cc/animation/animation_registrar.h" |
13 #include "cc/base/cc_export.h" | 16 #include "cc/base/cc_export.h" |
14 #include "cc/input/input_handler.h" | 17 #include "cc/input/input_handler.h" |
15 #include "cc/input/top_controls_manager_client.h" | 18 #include "cc/input/top_controls_manager_client.h" |
16 #include "cc/layers/render_pass_sink.h" | 19 #include "cc/layers/render_pass_sink.h" |
17 #include "cc/output/output_surface_client.h" | 20 #include "cc/output/output_surface_client.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 base::Time wall_clock_time) = 0; | 62 base::Time wall_clock_time) = 0; |
60 // Returns true if resources were deleted by this call. | 63 // Returns true if resources were deleted by this call. |
61 virtual bool ReduceContentsTextureMemoryOnImplThread( | 64 virtual bool ReduceContentsTextureMemoryOnImplThread( |
62 size_t limit_bytes, | 65 size_t limit_bytes, |
63 int priority_cutoff) = 0; | 66 int priority_cutoff) = 0; |
64 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; | 67 virtual void ReduceWastedContentsTextureMemoryOnImplThread() = 0; |
65 virtual void SendManagedMemoryStats() = 0; | 68 virtual void SendManagedMemoryStats() = 0; |
66 virtual bool IsInsideDraw() = 0; | 69 virtual bool IsInsideDraw() = 0; |
67 virtual void RenewTreePriority() = 0; | 70 virtual void RenewTreePriority() = 0; |
68 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; | 71 virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; |
| 72 |
| 73 protected: |
| 74 virtual ~LayerTreeHostImplClient() {} |
69 }; | 75 }; |
70 | 76 |
71 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering | 77 // LayerTreeHostImpl owns the LayerImpl trees as well as associated rendering |
72 // state. | 78 // state. |
73 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, | 79 class CC_EXPORT LayerTreeHostImpl : public InputHandlerClient, |
74 public RendererClient, | 80 public RendererClient, |
75 public TileManagerClient, | 81 public TileManagerClient, |
76 public OutputSurfaceClient, | 82 public OutputSurfaceClient, |
77 public TopControlsManagerClient { | 83 public TopControlsManagerClient { |
78 public: | 84 public: |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 293 |
288 // Iterates from the root first, in order to remove the surfaces closest | 294 // Iterates from the root first, in order to remove the surfaces closest |
289 // to the root with cached textures, and all surfaces that draw into | 295 // to the root with cached textures, and all surfaces that draw into |
290 // them. | 296 // them. |
291 size_t RenderPassListBegin(const RenderPassList& list) const { | 297 size_t RenderPassListBegin(const RenderPassList& list) const { |
292 return list.size() - 1; | 298 return list.size() - 1; |
293 } | 299 } |
294 size_t RenderPassListEnd(const RenderPassList& list) const { return 0 - 1; } | 300 size_t RenderPassListEnd(const RenderPassList& list) const { return 0 - 1; } |
295 size_t RenderPassListNext(size_t it) const { return it - 1; } | 301 size_t RenderPassListNext(size_t it) const { return it - 1; } |
296 | 302 |
297 CullRenderPassesWithCachedTextures(Renderer& renderer) | 303 explicit CullRenderPassesWithCachedTextures(Renderer* renderer) |
298 : renderer_(renderer) {} | 304 : renderer_(renderer) {} |
299 private: | 305 private: |
300 Renderer& renderer_; | 306 Renderer* renderer_; |
301 }; | 307 }; |
302 | 308 |
303 class CC_EXPORT CullRenderPassesWithNoQuads { | 309 class CC_EXPORT CullRenderPassesWithNoQuads { |
304 public: | 310 public: |
305 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, | 311 bool ShouldRemoveRenderPass(const RenderPassDrawQuad& quad, |
306 const FrameData& frame) const; | 312 const FrameData& frame) const; |
307 | 313 |
308 // Iterates in draw order, so that when a surface is removed, and its | 314 // Iterates in draw order, so that when a surface is removed, and its |
309 // target becomes empty, then its target can be removed also. | 315 // target becomes empty, then its target can be removed also. |
310 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } | 316 size_t RenderPassListBegin(const RenderPassList& list) const { return 0; } |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 scoped_ptr<AnimationRegistrar> animation_registrar_; | 462 scoped_ptr<AnimationRegistrar> animation_registrar_; |
457 | 463 |
458 RenderingStatsInstrumentation* rendering_stats_instrumentation_; | 464 RenderingStatsInstrumentation* rendering_stats_instrumentation_; |
459 | 465 |
460 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); | 466 DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl); |
461 }; | 467 }; |
462 | 468 |
463 } // namespace cc | 469 } // namespace cc |
464 | 470 |
465 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ | 471 #endif // CC_TREES_LAYER_TREE_HOST_IMPL_H_ |
OLD | NEW |