Chromium Code Reviews| 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_TILES_TILE_MANAGER_H_ | 5 #ifndef CC_TILES_TILE_MANAGER_H_ |
| 6 #define CC_TILES_TILE_MANAGER_H_ | 6 #define CC_TILES_TILE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 | 206 |
| 207 void AssignGpuMemoryToTiles( | 207 void AssignGpuMemoryToTiles( |
| 208 RasterTilePriorityQueue* raster_priority_queue, | 208 RasterTilePriorityQueue* raster_priority_queue, |
| 209 size_t scheduled_raser_task_limit, | 209 size_t scheduled_raser_task_limit, |
| 210 PrioritizedTileVector* tiles_that_need_to_be_rasterized); | 210 PrioritizedTileVector* tiles_that_need_to_be_rasterized); |
| 211 | 211 |
| 212 private: | 212 private: |
| 213 class MemoryUsage { | 213 class MemoryUsage { |
| 214 public: | 214 public: |
| 215 MemoryUsage(); | 215 MemoryUsage(); |
| 216 MemoryUsage(int64 memory_bytes, int resource_count); | 216 MemoryUsage(size_t memory_bytes, size_t resource_count); |
| 217 | 217 |
| 218 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format); | 218 static MemoryUsage FromConfig(const gfx::Size& size, ResourceFormat format); |
| 219 static MemoryUsage FromTile(const Tile* tile); | 219 static MemoryUsage FromTile(const Tile* tile); |
| 220 | 220 |
| 221 MemoryUsage& operator+=(const MemoryUsage& other); | 221 MemoryUsage& operator+=(const MemoryUsage& other); |
| 222 MemoryUsage& operator-=(const MemoryUsage& other); | 222 MemoryUsage& operator-=(const MemoryUsage& other); |
| 223 MemoryUsage operator-(const MemoryUsage& other); | 223 MemoryUsage operator-(const MemoryUsage& other); |
| 224 | 224 |
| 225 bool Exceeds(const MemoryUsage& limit) const; | 225 bool Exceeds(const MemoryUsage& limit) const; |
| 226 int64 memory_bytes() const { return memory_bytes_; } | 226 size_t memory_bytes() const { |
| 227 // This is used for HUD layers / logging, so we can just static_cast here. | |
| 228 DCHECK_GE(memory_bytes_, 0); | |
| 229 return static_cast<size_t>(memory_bytes_); | |
| 230 } | |
| 227 | 231 |
| 228 private: | 232 private: |
| 229 int64 memory_bytes_; | 233 int64 memory_bytes_; |
|
danakj
2015/06/09 17:39:49
why not size_ts here?
| |
| 230 int resource_count_; | 234 int resource_count_; |
| 231 }; | 235 }; |
| 232 | 236 |
| 233 void OnImageDecodeTaskCompleted(int layer_id, | 237 void OnImageDecodeTaskCompleted(int layer_id, |
| 234 SkPixelRef* pixel_ref, | 238 SkPixelRef* pixel_ref, |
| 235 bool was_canceled); | 239 bool was_canceled); |
| 236 void OnRasterTaskCompleted(Tile::Id tile, | 240 void OnRasterTaskCompleted(Tile::Id tile, |
| 237 scoped_ptr<ScopedResource> resource, | 241 scoped_ptr<ScopedResource> resource, |
| 238 const RasterSource::SolidColorAnalysis& analysis, | 242 const RasterSource::SolidColorAnalysis& analysis, |
| 239 bool was_canceled); | 243 bool was_canceled); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 306 | 310 |
| 307 bool did_notify_ready_to_activate_; | 311 bool did_notify_ready_to_activate_; |
| 308 bool did_notify_ready_to_draw_; | 312 bool did_notify_ready_to_draw_; |
| 309 | 313 |
| 310 DISALLOW_COPY_AND_ASSIGN(TileManager); | 314 DISALLOW_COPY_AND_ASSIGN(TileManager); |
| 311 }; | 315 }; |
| 312 | 316 |
| 313 } // namespace cc | 317 } // namespace cc |
| 314 | 318 |
| 315 #endif // CC_TILES_TILE_MANAGER_H_ | 319 #endif // CC_TILES_TILE_MANAGER_H_ |
| OLD | NEW |