| 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 <list> | 8 #include <list> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "cc/memory_history.h" |
| 15 #include "cc/rendering_stats.h" | 16 #include "cc/rendering_stats.h" |
| 16 #include "cc/resource_pool.h" | 17 #include "cc/resource_pool.h" |
| 17 #include "cc/tile_priority.h" | 18 #include "cc/tile_priority.h" |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 class RasterWorkerPool; | 21 class RasterWorkerPool; |
| 21 class ResourceProvider; | 22 class ResourceProvider; |
| 22 class Tile; | 23 class Tile; |
| 23 class TileVersion; | 24 class TileVersion; |
| 24 | 25 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 void ManageTiles(); | 105 void ManageTiles(); |
| 105 void CheckForCompletedTileUploads(); | 106 void CheckForCompletedTileUploads(); |
| 106 | 107 |
| 107 scoped_ptr<base::Value> AsValue() const; | 108 scoped_ptr<base::Value> AsValue() const; |
| 108 void GetMemoryStats(size_t* memoryRequiredBytes, | 109 void GetMemoryStats(size_t* memoryRequiredBytes, |
| 109 size_t* memoryNiceToHaveBytes, | 110 size_t* memoryNiceToHaveBytes, |
| 110 size_t* memoryUsedBytes) const; | 111 size_t* memoryUsedBytes) const; |
| 111 void GetRenderingStats(RenderingStats* stats); | 112 void GetRenderingStats(RenderingStats* stats); |
| 112 bool HasPendingWorkScheduled(WhichTree tree) const; | 113 bool HasPendingWorkScheduled(WhichTree tree) const; |
| 113 | 114 |
| 115 const MemoryHistory::Entry& memory_stats_from_last_assign() const { return mem
ory_stats_from_last_assign_; } |
| 116 |
| 114 protected: | 117 protected: |
| 115 // Methods called by Tile | 118 // Methods called by Tile |
| 116 friend class Tile; | 119 friend class Tile; |
| 117 void RegisterTile(Tile* tile); | 120 void RegisterTile(Tile* tile); |
| 118 void UnregisterTile(Tile* tile); | 121 void UnregisterTile(Tile* tile); |
| 119 void WillModifyTilePriority( | 122 void WillModifyTilePriority( |
| 120 Tile* tile, WhichTree tree, const TilePriority& new_priority); | 123 Tile* tile, WhichTree tree, const TilePriority& new_priority); |
| 121 | 124 |
| 122 private: | 125 private: |
| 123 void SortTiles(); | 126 void SortTiles(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 // when all the image decoding tasks finish. | 172 // when all the image decoding tasks finish. |
| 170 TileList tiles_with_image_decoding_tasks_; | 173 TileList tiles_with_image_decoding_tasks_; |
| 171 | 174 |
| 172 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; | 175 typedef base::hash_map<uint32_t, skia::LazyPixelRef*> PixelRefMap; |
| 173 PixelRefMap pending_decode_tasks_; | 176 PixelRefMap pending_decode_tasks_; |
| 174 | 177 |
| 175 typedef std::queue<scoped_refptr<Tile> > TileQueue; | 178 typedef std::queue<scoped_refptr<Tile> > TileQueue; |
| 176 TileQueue tiles_with_pending_set_pixels_; | 179 TileQueue tiles_with_pending_set_pixels_; |
| 177 size_t bytes_pending_set_pixels_; | 180 size_t bytes_pending_set_pixels_; |
| 178 bool ever_exceeded_memory_budget_; | 181 bool ever_exceeded_memory_budget_; |
| 182 MemoryHistory::Entry memory_stats_from_last_assign_; |
| 179 | 183 |
| 180 RenderingStats rendering_stats_; | 184 RenderingStats rendering_stats_; |
| 181 | 185 |
| 182 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; | 186 int raster_state_count_[NUM_STATES][NUM_TREES][NUM_BINS]; |
| 183 | 187 |
| 184 DISALLOW_COPY_AND_ASSIGN(TileManager); | 188 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 185 }; | 189 }; |
| 186 | 190 |
| 187 } // namespace cc | 191 } // namespace cc |
| 188 | 192 |
| 189 #endif // CC_TILE_MANAGER_H_ | 193 #endif // CC_TILE_MANAGER_H_ |
| OLD | NEW |