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> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 size_t* memoryUsedBytes); | 89 size_t* memoryUsedBytes); |
90 | 90 |
91 void GetRenderingStats(RenderingStats* stats); | 91 void GetRenderingStats(RenderingStats* stats); |
92 | 92 |
93 protected: | 93 protected: |
94 // Methods called by Tile | 94 // Methods called by Tile |
95 friend class Tile; | 95 friend class Tile; |
96 void RegisterTile(Tile* tile); | 96 void RegisterTile(Tile* tile); |
97 void UnregisterTile(Tile* tile); | 97 void UnregisterTile(Tile* tile); |
98 void WillModifyTilePriority( | 98 void WillModifyTilePriority( |
99 Tile* tile, WhichTree tree, const TilePriority& new_priority); | 99 Tile* tile, WhichTree tree, const TilePriority& new_priority) { |
| 100 // TODO(nduca): Do something smarter if reprioritization turns out to be |
| 101 // costly. |
| 102 ScheduleManageTiles(); |
| 103 } |
100 | 104 |
101 private: | 105 private: |
102 void SortTiles(); | 106 void SortTiles(); |
103 void AssignGpuMemoryToTiles(); | 107 void AssignGpuMemoryToTiles(); |
104 void FreeResourcesForTile(Tile* tile); | 108 void FreeResourcesForTile(Tile* tile); |
105 void ScheduleManageTiles(); | 109 void ScheduleManageTiles() { |
| 110 if (manage_tiles_pending_) |
| 111 return; |
| 112 client_->ScheduleManageTiles(); |
| 113 manage_tiles_pending_ = true; |
| 114 } |
106 void DispatchMoreTasks(); | 115 void DispatchMoreTasks(); |
107 void GatherPixelRefsForTile(Tile* tile); | 116 void GatherPixelRefsForTile(Tile* tile); |
108 void DispatchImageDecodeTasksForTile(Tile* tile); | 117 void DispatchImageDecodeTasksForTile(Tile* tile); |
109 void DispatchOneImageDecodeTask( | 118 void DispatchOneImageDecodeTask( |
110 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); | 119 scoped_refptr<Tile> tile, skia::LazyPixelRef* pixel_ref); |
111 void OnImageDecodeTaskCompleted( | 120 void OnImageDecodeTaskCompleted( |
112 scoped_refptr<Tile> tile, uint32_t pixel_ref_id); | 121 scoped_refptr<Tile> tile, uint32_t pixel_ref_id); |
113 void DispatchOneRasterTask(scoped_refptr<Tile> tile); | 122 void DispatchOneRasterTask(scoped_refptr<Tile> tile); |
114 void OnRasterTaskCompleted( | 123 void OnRasterTaskCompleted( |
115 scoped_refptr<Tile> tile, | 124 scoped_refptr<Tile> tile, |
(...skipping 25 matching lines...) Expand all Loading... |
141 TileQueue tiles_with_pending_set_pixels_; | 150 TileQueue tiles_with_pending_set_pixels_; |
142 | 151 |
143 RenderingStats rendering_stats_; | 152 RenderingStats rendering_stats_; |
144 | 153 |
145 DISALLOW_COPY_AND_ASSIGN(TileManager); | 154 DISALLOW_COPY_AND_ASSIGN(TileManager); |
146 }; | 155 }; |
147 | 156 |
148 } // namespace cc | 157 } // namespace cc |
149 | 158 |
150 #endif // CC_TILE_MANAGER_H_ | 159 #endif // CC_TILE_MANAGER_H_ |
OLD | NEW |