Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: cc/tiles/tile_manager.h

Issue 2339703005: cc: Add ImageManager to keep all the image locking in the same place. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <unordered_map> 13 #include <unordered_map>
14 #include <utility> 14 #include <utility>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/macros.h" 17 #include "base/macros.h"
18 #include "base/values.h" 18 #include "base/values.h"
19 #include "cc/base/unique_notifier.h" 19 #include "cc/base/unique_notifier.h"
20 #include "cc/playback/raster_source.h" 20 #include "cc/playback/raster_source.h"
21 #include "cc/raster/raster_buffer_provider.h" 21 #include "cc/raster/raster_buffer_provider.h"
22 #include "cc/resources/memory_history.h" 22 #include "cc/resources/memory_history.h"
23 #include "cc/resources/resource_pool.h" 23 #include "cc/resources/resource_pool.h"
24 #include "cc/tiles/eviction_tile_priority_queue.h" 24 #include "cc/tiles/eviction_tile_priority_queue.h"
25 #include "cc/tiles/image_decode_controller.h" 25 #include "cc/tiles/image_manager.h"
26 #include "cc/tiles/raster_tile_priority_queue.h" 26 #include "cc/tiles/raster_tile_priority_queue.h"
27 #include "cc/tiles/tile.h" 27 #include "cc/tiles/tile.h"
28 #include "cc/tiles/tile_draw_info.h" 28 #include "cc/tiles/tile_draw_info.h"
29 #include "cc/tiles/tile_task_manager.h" 29 #include "cc/tiles/tile_task_manager.h"
30 30
31 namespace base { 31 namespace base {
32 namespace trace_event { 32 namespace trace_event {
33 class ConvertableToTraceFormat; 33 class ConvertableToTraceFormat;
34 class TracedValue; 34 class TracedValue;
35 } 35 }
36 } 36 }
37 37
38 namespace cc { 38 namespace cc {
39 class PictureLayerImpl; 39 class PictureLayerImpl;
40 class ResourceProvider; 40 class ResourceProvider;
41 class ImageDecodeController;
41 42
42 class CC_EXPORT TileManagerClient { 43 class CC_EXPORT TileManagerClient {
43 public: 44 public:
44 // Called when all tiles marked as required for activation are ready to draw. 45 // Called when all tiles marked as required for activation are ready to draw.
45 virtual void NotifyReadyToActivate() = 0; 46 virtual void NotifyReadyToActivate() = 0;
46 47
47 // Called when all tiles marked as required for draw are ready to draw. 48 // Called when all tiles marked as required for draw are ready to draw.
48 virtual void NotifyReadyToDraw() = 0; 49 virtual void NotifyReadyToDraw() = 0;
49 50
50 // Called when all tile tasks started by the most recent call to PrepareTiles 51 // Called when all tile tasks started by the most recent call to PrepareTiles
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 bool use_gpu_rasterization_; 306 bool use_gpu_rasterization_;
306 307
307 std::unordered_map<Tile::Id, Tile*> tiles_; 308 std::unordered_map<Tile::Id, Tile*> tiles_;
308 309
309 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; 310 bool all_tiles_that_need_to_be_rasterized_are_scheduled_;
310 MemoryHistory::Entry memory_stats_from_last_assign_; 311 MemoryHistory::Entry memory_stats_from_last_assign_;
311 312
312 bool did_check_for_completed_tasks_since_last_schedule_tasks_; 313 bool did_check_for_completed_tasks_since_last_schedule_tasks_;
313 bool did_oom_on_last_assign_; 314 bool did_oom_on_last_assign_;
314 315
315 ImageDecodeController* image_decode_controller_; 316 ImageManager image_manager_;
316 317
317 RasterTaskCompletionStats flush_stats_; 318 RasterTaskCompletionStats flush_stats_;
318 319
319 std::vector<Tile*> released_tiles_; 320 std::vector<Tile*> released_tiles_;
320 321
321 std::vector<scoped_refptr<TileTask>> orphan_tasks_; 322 std::vector<scoped_refptr<TileTask>> orphan_tasks_;
322 323
323 TaskGraph graph_; 324 TaskGraph graph_;
324 scoped_refptr<TileTask> required_for_activation_done_task_; 325 scoped_refptr<TileTask> required_for_activation_done_task_;
325 scoped_refptr<TileTask> required_for_draw_done_task_; 326 scoped_refptr<TileTask> required_for_draw_done_task_;
326 scoped_refptr<TileTask> all_done_task_; 327 scoped_refptr<TileTask> all_done_task_;
327 328
328 UniqueNotifier more_tiles_need_prepare_check_notifier_; 329 UniqueNotifier more_tiles_need_prepare_check_notifier_;
329 330
330 Signals signals_; 331 Signals signals_;
331 332
332 UniqueNotifier signals_check_notifier_; 333 UniqueNotifier signals_check_notifier_;
333 334
334 bool has_scheduled_tile_tasks_; 335 bool has_scheduled_tile_tasks_;
335 336
336 uint64_t prepare_tiles_count_; 337 uint64_t prepare_tiles_count_;
337 uint64_t next_tile_id_; 338 uint64_t next_tile_id_;
338 339
339 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 340 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
340 std::vector<std::pair<DrawImage, scoped_refptr<TileTask>>> locked_images_; 341 std::vector<DrawImage> locked_images_;
342 std::vector<scoped_refptr<TileTask>> locked_image_tasks_;
341 343
342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 344 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
343 345
344 DISALLOW_COPY_AND_ASSIGN(TileManager); 346 DISALLOW_COPY_AND_ASSIGN(TileManager);
345 }; 347 };
346 348
347 } // namespace cc 349 } // namespace cc
348 350
349 #endif // CC_TILES_TILE_MANAGER_H_ 351 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698