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

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

Issue 900073003: cc: Rework how picture layer tiling set gets into raster queues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update Created 5 years, 10 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
« no previous file with comments | « cc/resources/raster_tile_priority_queue_required.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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 <deque> 8 #include <deque>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Called when all tiles marked as required for draw are ready to draw. 45 // Called when all tiles marked as required for draw are ready to draw.
46 virtual void NotifyReadyToDraw() = 0; 46 virtual void NotifyReadyToDraw() = 0;
47 47
48 // Called when the visible representation of a tile might have changed. Some 48 // Called when the visible representation of a tile might have changed. Some
49 // examples are: 49 // examples are:
50 // - Tile version initialized. 50 // - Tile version initialized.
51 // - Tile resources freed. 51 // - Tile resources freed.
52 // - Tile marked for on-demand raster. 52 // - Tile marked for on-demand raster.
53 virtual void NotifyTileStateChanged(const Tile* tile) = 0; 53 virtual void NotifyTileStateChanged(const Tile* tile) = 0;
54 54
55 // Given an empty raster tile priority queue, this will build a priority queue
56 // that will return tiles in order in which they should be rasterized.
57 // Note if the queue was previous built, Reset must be called on it.
58 virtual scoped_ptr<RasterTilePriorityQueue> BuildRasterQueue(
59 TreePriority tree_priority,
60 RasterTilePriorityQueue::Type type) = 0;
61
62 // Given an empty eviction tile priority queue, this will build a priority
63 // queue that will return tiles in order in which they should be evicted.
64 // Note if the queue was previous built, Reset must be called on it.
65 virtual scoped_ptr<EvictionTilePriorityQueue> BuildEvictionQueue(
66 TreePriority tree_priority) = 0;
67
68 // Informs the client that due to the currently rasterizing (or scheduled to 55 // Informs the client that due to the currently rasterizing (or scheduled to
69 // be rasterized) tiles, we will be in a position that will likely require a 56 // be rasterized) tiles, we will be in a position that will likely require a
70 // draw. This can be used to preemptively start a frame. 57 // draw. This can be used to preemptively start a frame.
71 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0; 58 virtual void SetIsLikelyToRequireADraw(bool is_likely_to_require_a_draw) = 0;
72 59
60 // Returns true iff we have a pending tree.
61 virtual bool PendingTreeExists() = 0;
62
73 protected: 63 protected:
74 virtual ~TileManagerClient() {} 64 virtual ~TileManagerClient() {}
75 }; 65 };
76 66
77 struct RasterTaskCompletionStats { 67 struct RasterTaskCompletionStats {
78 RasterTaskCompletionStats(); 68 RasterTaskCompletionStats();
79 69
80 size_t completed_count; 70 size_t completed_count;
81 size_t canceled_count; 71 size_t canceled_count;
82 }; 72 };
(...skipping 21 matching lines...) Expand all
104 "minus 1"); 94 "minus 1");
105 95
106 static scoped_ptr<TileManager> Create(TileManagerClient* client, 96 static scoped_ptr<TileManager> Create(TileManagerClient* client,
107 base::SequencedTaskRunner* task_runner, 97 base::SequencedTaskRunner* task_runner,
108 ResourcePool* resource_pool, 98 ResourcePool* resource_pool,
109 TileTaskRunner* tile_task_runner, 99 TileTaskRunner* tile_task_runner,
110 Rasterizer* rasterizer, 100 Rasterizer* rasterizer,
111 size_t scheduled_raster_task_limit); 101 size_t scheduled_raster_task_limit);
112 ~TileManager() override; 102 ~TileManager() override;
113 103
104 void RegisterPictureLayerTilingSet(int layer_id,
105 WhichTree tree,
106 PictureLayerTilingSet* tiling_set);
107 void UnregisterPictureLayerTilingSet(int layer_id, WhichTree tree);
108
114 // Assigns tile memory and schedules work to prepare tiles for drawing. 109 // Assigns tile memory and schedules work to prepare tiles for drawing.
115 // - Runs client_->NotifyReadyToActivate() when all tiles required for 110 // - Runs client_->NotifyReadyToActivate() when all tiles required for
116 // activation are prepared, or failed to prepare due to OOM. 111 // activation are prepared, or failed to prepare due to OOM.
117 // - Runs client_->NotifyReadyToDraw() when all tiles required draw are 112 // - Runs client_->NotifyReadyToDraw() when all tiles required draw are
118 // prepared, or failed to prepare due to OOM. 113 // prepared, or failed to prepare due to OOM.
119 void PrepareTiles(const GlobalStateThatImpactsTilePriority& state); 114 void PrepareTiles(const GlobalStateThatImpactsTilePriority& state);
120 115
121 void UpdateVisibleTiles(const GlobalStateThatImpactsTilePriority& state); 116 void UpdateVisibleTiles(const GlobalStateThatImpactsTilePriority& state);
122 117
123 scoped_refptr<Tile> CreateTile(RasterSource* raster_source, 118 scoped_refptr<Tile> CreateTile(RasterSource* raster_source,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 return tiles; 167 return tiles;
173 } 168 }
174 169
175 void SetScheduledRasterTaskLimitForTesting(size_t limit) { 170 void SetScheduledRasterTaskLimitForTesting(size_t limit) {
176 scheduled_raster_task_limit_ = limit; 171 scheduled_raster_task_limit_ = limit;
177 } 172 }
178 173
179 bool IsReadyToActivate() const; 174 bool IsReadyToActivate() const;
180 bool IsReadyToDraw() const; 175 bool IsReadyToDraw() const;
181 176
177 scoped_ptr<RasterTilePriorityQueue> BuildRasterQueue(
178 RasterTilePriorityQueue::Type type) const;
179 scoped_ptr<EvictionTilePriorityQueue> BuildEvictionQueue() const;
180
182 protected: 181 protected:
183 TileManager(TileManagerClient* client, 182 TileManager(TileManagerClient* client,
184 const scoped_refptr<base::SequencedTaskRunner>& task_runner, 183 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
185 ResourcePool* resource_pool, 184 ResourcePool* resource_pool,
186 TileTaskRunner* tile_task_runner, 185 TileTaskRunner* tile_task_runner,
187 Rasterizer* rasterizer, 186 Rasterizer* rasterizer,
188 size_t scheduled_raster_task_limit); 187 size_t scheduled_raster_task_limit);
189 188
190 void FreeResourcesForReleasedTiles(); 189 void FreeResourcesForReleasedTiles();
191 void CleanUpReleasedTiles(); 190 void CleanUpReleasedTiles();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 304
306 UniqueNotifier ready_to_activate_notifier_; 305 UniqueNotifier ready_to_activate_notifier_;
307 UniqueNotifier ready_to_draw_notifier_; 306 UniqueNotifier ready_to_draw_notifier_;
308 UniqueNotifier ready_to_activate_check_notifier_; 307 UniqueNotifier ready_to_activate_check_notifier_;
309 UniqueNotifier ready_to_draw_check_notifier_; 308 UniqueNotifier ready_to_draw_check_notifier_;
310 UniqueNotifier more_tiles_need_prepare_check_notifier_; 309 UniqueNotifier more_tiles_need_prepare_check_notifier_;
311 310
312 bool did_notify_ready_to_activate_; 311 bool did_notify_ready_to_activate_;
313 bool did_notify_ready_to_draw_; 312 bool did_notify_ready_to_draw_;
314 313
314 base::hash_map<int, PictureLayerTilingSet::Pair>
315 paired_picture_layer_tiling_sets_;
316
315 DISALLOW_COPY_AND_ASSIGN(TileManager); 317 DISALLOW_COPY_AND_ASSIGN(TileManager);
316 }; 318 };
317 319
318 } // namespace cc 320 } // namespace cc
319 321
320 #endif // CC_RESOURCES_TILE_MANAGER_H_ 322 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/resources/raster_tile_priority_queue_required.cc ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698