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

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

Issue 514123002: Manual fixups in compositor code scoped_refptr operator T* removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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_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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 // This class manages tiles, deciding which should get rasterized and which 83 // This class manages tiles, deciding which should get rasterized and which
84 // should no longer have any memory assigned to them. Tile objects are "owned" 84 // should no longer have any memory assigned to them. Tile objects are "owned"
85 // by layers; they automatically register with the manager when they are 85 // by layers; they automatically register with the manager when they are
86 // created, and unregister from the manager when they are deleted. 86 // created, and unregister from the manager when they are deleted.
87 class CC_EXPORT TileManager : public RasterizerClient, 87 class CC_EXPORT TileManager : public RasterizerClient,
88 public RefCountedManager<Tile> { 88 public RefCountedManager<Tile> {
89 public: 89 public:
90 static scoped_ptr<TileManager> Create( 90 static scoped_ptr<TileManager> Create(
91 TileManagerClient* client, 91 TileManagerClient* client,
92 base::SequencedTaskRunner* task_runner, 92 base::SequencedTaskRunner* task_runner,
danakj 2014/08/28 16:50:42 doesn't this need to be a scoped_refptr too?
dcheng 2014/08/28 17:21:18 I've tried to keep this patch to the bare minimum
danakj 2014/08/28 17:23:55 This method is what calls the constructor which is
dcheng 2014/08/28 17:29:00 It is, but this is "fine" since scoped_refptr is i
93 ResourcePool* resource_pool, 93 ResourcePool* resource_pool,
94 Rasterizer* rasterizer, 94 Rasterizer* rasterizer,
95 RenderingStatsInstrumentation* rendering_stats_instrumentation); 95 RenderingStatsInstrumentation* rendering_stats_instrumentation);
96 virtual ~TileManager(); 96 virtual ~TileManager();
97 97
98 void ManageTiles(const GlobalStateThatImpactsTilePriority& state); 98 void ManageTiles(const GlobalStateThatImpactsTilePriority& state);
99 99
100 // Returns true when visible tiles have been initialized. 100 // Returns true when visible tiles have been initialized.
101 bool UpdateVisibleTiles(); 101 bool UpdateVisibleTiles();
102 102
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void SetRasterizerForTesting(Rasterizer* rasterizer); 152 void SetRasterizerForTesting(Rasterizer* rasterizer);
153 153
154 void FreeResourcesAndCleanUpReleasedTilesForTesting() { 154 void FreeResourcesAndCleanUpReleasedTilesForTesting() {
155 prioritized_tiles_.Clear(); 155 prioritized_tiles_.Clear();
156 FreeResourcesForReleasedTiles(); 156 FreeResourcesForReleasedTiles();
157 CleanUpReleasedTiles(); 157 CleanUpReleasedTiles();
158 } 158 }
159 159
160 protected: 160 protected:
161 TileManager(TileManagerClient* client, 161 TileManager(TileManagerClient* client,
162 base::SequencedTaskRunner* task_runner, 162 const scoped_refptr<base::SequencedTaskRunner>& task_runner,
163 ResourcePool* resource_pool, 163 ResourcePool* resource_pool,
164 Rasterizer* rasterizer, 164 Rasterizer* rasterizer,
165 RenderingStatsInstrumentation* rendering_stats_instrumentation); 165 RenderingStatsInstrumentation* rendering_stats_instrumentation);
166 166
167 // Methods called by Tile 167 // Methods called by Tile
168 friend class Tile; 168 friend class Tile;
169 void DidChangeTilePriority(Tile* tile); 169 void DidChangeTilePriority(Tile* tile);
170 170
171 void FreeResourcesForReleasedTiles(); 171 void FreeResourcesForReleasedTiles();
172 void CleanUpReleasedTiles(); 172 void CleanUpReleasedTiles();
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_; 263 std::vector<scoped_refptr<RasterTask> > orphan_raster_tasks_;
264 264
265 UniqueNotifier ready_to_activate_check_notifier_; 265 UniqueNotifier ready_to_activate_check_notifier_;
266 266
267 DISALLOW_COPY_AND_ASSIGN(TileManager); 267 DISALLOW_COPY_AND_ASSIGN(TileManager);
268 }; 268 };
269 269
270 } // namespace cc 270 } // namespace cc
271 271
272 #endif // CC_RESOURCES_TILE_MANAGER_H_ 272 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698