OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TILE_MANAGER_H_ | 5 #ifndef CC_TILE_MANAGER_H_ |
6 #define CC_TILE_MANAGER_H_ | 6 #define CC_TILE_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 TileResolution resolution; | 61 TileResolution resolution; |
62 float time_to_needed_in_seconds; | 62 float time_to_needed_in_seconds; |
63 }; | 63 }; |
64 | 64 |
65 // This class manages tiles, deciding which should get rasterized and which | 65 // This class manages tiles, deciding which should get rasterized and which |
66 // should no longer have any memory assigned to them. Tile objects are "owned" | 66 // should no longer have any memory assigned to them. Tile objects are "owned" |
67 // by layers; they automatically register with the manager when they are | 67 // by layers; they automatically register with the manager when they are |
68 // created, and unregister from the manager when they are deleted. | 68 // created, and unregister from the manager when they are deleted. |
69 class CC_EXPORT TileManager { | 69 class CC_EXPORT TileManager { |
70 public: | 70 public: |
71 TileManager(TileManagerClient* client, ResourceProvider *resource_provider); | 71 TileManager(TileManagerClient* client, |
| 72 ResourceProvider *resource_provider, |
| 73 size_t num_raster_threads); |
72 virtual ~TileManager(); | 74 virtual ~TileManager(); |
73 | 75 |
74 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_
state_; } | 76 const GlobalStateThatImpactsTilePriority& GlobalState() const { return global_
state_; } |
75 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); | 77 void SetGlobalState(const GlobalStateThatImpactsTilePriority& state); |
76 | 78 |
77 void ManageTiles(); | 79 void ManageTiles(); |
78 | 80 |
79 void renderingStats(RenderingStats* stats); | 81 void renderingStats(RenderingStats* stats); |
80 | 82 |
81 protected: | 83 protected: |
(...skipping 13 matching lines...) Expand all Loading... |
95 scoped_refptr<Tile>, | 97 scoped_refptr<Tile>, |
96 ResourceProvider::ResourceId, | 98 ResourceProvider::ResourceId, |
97 scoped_refptr<PicturePileImpl>, | 99 scoped_refptr<PicturePileImpl>, |
98 RenderingStats*); | 100 RenderingStats*); |
99 void DidFinishTileInitialization(Tile*, ResourceProvider::ResourceId); | 101 void DidFinishTileInitialization(Tile*, ResourceProvider::ResourceId); |
100 | 102 |
101 TileManagerClient* client_; | 103 TileManagerClient* client_; |
102 scoped_ptr<ResourcePool> resource_pool_; | 104 scoped_ptr<ResourcePool> resource_pool_; |
103 bool manage_tiles_pending_; | 105 bool manage_tiles_pending_; |
104 int pending_raster_tasks_; | 106 int pending_raster_tasks_; |
| 107 size_t num_raster_threads_; |
105 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 108 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
106 | 109 |
107 GlobalStateThatImpactsTilePriority global_state_; | 110 GlobalStateThatImpactsTilePriority global_state_; |
108 | 111 |
109 typedef std::vector<Tile*> TileVector; | 112 typedef std::vector<Tile*> TileVector; |
110 TileVector tiles_; | 113 TileVector tiles_; |
111 TileVector tiles_that_need_to_be_rasterized_; | 114 TileVector tiles_that_need_to_be_rasterized_; |
112 | 115 |
113 RenderingStats rendering_stats_; | 116 RenderingStats rendering_stats_; |
114 }; | 117 }; |
115 | 118 |
116 } // namespace cc | 119 } // namespace cc |
117 | 120 |
118 #endif // CC_TILE_MANAGER_H_ | 121 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |