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_RESOURCES_TILE_MANAGER_H_ | 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_ |
6 #define CC_RESOURCES_TILE_MANAGER_H_ | 6 #define CC_RESOURCES_TILE_MANAGER_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 20 matching lines...) Expand all Loading... |
31 virtual void ScheduleManageTiles() = 0; | 31 virtual void ScheduleManageTiles() = 0; |
32 virtual void DidInitializeVisibleTile() = 0; | 32 virtual void DidInitializeVisibleTile() = 0; |
33 | 33 |
34 protected: | 34 protected: |
35 virtual ~TileManagerClient() {} | 35 virtual ~TileManagerClient() {} |
36 }; | 36 }; |
37 | 37 |
38 // Tile manager classifying tiles into a few basic | 38 // Tile manager classifying tiles into a few basic |
39 // bins: | 39 // bins: |
40 enum TileManagerBin { | 40 enum TileManagerBin { |
41 NOW_BIN = 0, // Needed ASAP. | 41 NOW_BIN = 0, // Needed ASAP. |
42 SOON_BIN = 1, // Impl-side version of prepainting. | 42 SOON_BIN = 1, // Impl-side version of prepainting. |
43 EVENTUALLY_BIN = 2, // Nice to have, if we've got memory and time. | 43 EVENTUALLY_BIN = 2, // Nice to have, if we've got memory and time. |
44 NEVER_BIN = 3, // Dont bother. | 44 NEVER_BIN = 3, // Dont bother. |
45 NUM_BINS = 4 | 45 NUM_BINS = 4 |
46 // Be sure to update TileManagerBinAsValue when adding new fields. | 46 // Be sure to update TileManagerBinAsValue when adding new fields. |
47 }; | 47 }; |
48 scoped_ptr<base::Value> TileManagerBinAsValue( | 48 scoped_ptr<base::Value> TileManagerBinAsValue( |
49 TileManagerBin bin); | 49 TileManagerBin bin); |
50 | 50 |
51 enum TileManagerBinPriority { | 51 enum TileManagerBinPriority { |
52 HIGH_PRIORITY_BIN = 0, | 52 HIGH_PRIORITY_BIN = 0, |
53 LOW_PRIORITY_BIN = 1, | 53 LOW_PRIORITY_BIN = 1, |
54 NUM_BIN_PRIORITIES = 2 | 54 NUM_BIN_PRIORITIES = 2 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 void RegisterTile(Tile* tile); | 113 void RegisterTile(Tile* tile); |
114 void UnregisterTile(Tile* tile); | 114 void UnregisterTile(Tile* tile); |
115 void WillModifyTilePriority( | 115 void WillModifyTilePriority( |
116 Tile* tile, WhichTree tree, const TilePriority& new_priority) { | 116 Tile* tile, WhichTree tree, const TilePriority& new_priority) { |
117 // TODO(nduca): Do something smarter if reprioritization turns out to be | 117 // TODO(nduca): Do something smarter if reprioritization turns out to be |
118 // costly. | 118 // costly. |
119 ScheduleManageTiles(); | 119 ScheduleManageTiles(); |
120 } | 120 } |
121 | 121 |
122 private: | 122 private: |
123 | |
124 // Data that is passed to raster tasks. | 123 // Data that is passed to raster tasks. |
125 struct RasterTaskMetadata { | 124 struct RasterTaskMetadata { |
126 bool prediction_benchmarking; | 125 bool prediction_benchmarking; |
127 bool is_tile_in_pending_tree_now_bin; | 126 bool is_tile_in_pending_tree_now_bin; |
128 TileResolution tile_resolution; | 127 TileResolution tile_resolution; |
129 int layer_id; | 128 int layer_id; |
130 }; | 129 }; |
131 | 130 |
132 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const; | 131 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const; |
133 | 132 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 size_t max_pending_tasks_; | 222 size_t max_pending_tasks_; |
224 | 223 |
225 base::TimeTicks anticipated_draw_time_; | 224 base::TimeTicks anticipated_draw_time_; |
226 | 225 |
227 DISALLOW_COPY_AND_ASSIGN(TileManager); | 226 DISALLOW_COPY_AND_ASSIGN(TileManager); |
228 }; | 227 }; |
229 | 228 |
230 } // namespace cc | 229 } // namespace cc |
231 | 230 |
232 #endif // CC_RESOURCES_TILE_MANAGER_H_ | 231 #endif // CC_RESOURCES_TILE_MANAGER_H_ |
OLD | NEW |