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/tiles/tile_manager.h

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 protected: 78 protected:
79 virtual ~TileManagerClient() {} 79 virtual ~TileManagerClient() {}
80 }; 80 };
81 81
82 struct RasterTaskCompletionStats { 82 struct RasterTaskCompletionStats {
83 RasterTaskCompletionStats(); 83 RasterTaskCompletionStats();
84 84
85 size_t completed_count; 85 size_t completed_count;
86 size_t canceled_count; 86 size_t canceled_count;
87 }; 87 };
88 scoped_refptr<base::trace_event::ConvertableToTraceFormat> 88 scoped_ptr<base::trace_event::ConvertableToTraceFormat>
89 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats); 89 RasterTaskCompletionStatsAsValue(const RasterTaskCompletionStats& stats);
90 90
91 // This class manages tiles, deciding which should get rasterized and which 91 // This class manages tiles, deciding which should get rasterized and which
92 // should no longer have any memory assigned to them. Tile objects are "owned" 92 // should no longer have any memory assigned to them. Tile objects are "owned"
93 // by layers; they automatically register with the manager when they are 93 // by layers; they automatically register with the manager when they are
94 // created, and unregister from the manager when they are deleted. 94 // created, and unregister from the manager when they are deleted.
95 class CC_EXPORT TileManager { 95 class CC_EXPORT TileManager {
96 public: 96 public:
97 static scoped_ptr<TileManager> Create(TileManagerClient* client, 97 static scoped_ptr<TileManager> Create(TileManagerClient* client,
98 base::SequencedTaskRunner* task_runner, 98 base::SequencedTaskRunner* task_runner,
(...skipping 30 matching lines...) Expand all
129 int source_frame_number, 129 int source_frame_number,
130 int flags); 130 int flags);
131 131
132 bool IsReadyToActivate() const; 132 bool IsReadyToActivate() const;
133 bool IsReadyToDraw() const; 133 bool IsReadyToDraw() const;
134 134
135 ImageDecodeController* GetImageDecodeController() { 135 ImageDecodeController* GetImageDecodeController() {
136 return &image_decode_controller_; 136 return &image_decode_controller_;
137 } 137 }
138 138
139 scoped_refptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue() 139 scoped_ptr<base::trace_event::ConvertableToTraceFormat> BasicStateAsValue()
140 const; 140 const;
141 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; 141 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const;
142 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 142 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
143 return memory_stats_from_last_assign_; 143 return memory_stats_from_last_assign_;
144 } 144 }
145 145
146 // Public methods for testing. 146 // Public methods for testing.
147 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { 147 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) {
148 for (size_t i = 0; i < tiles.size(); ++i) { 148 for (size_t i = 0; i < tiles.size(); ++i) {
149 TileDrawInfo& draw_info = tiles[i]->draw_info(); 149 TileDrawInfo& draw_info = tiles[i]->draw_info();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 ResourceFormat DetermineResourceFormat(const Tile* tile) const; 274 ResourceFormat DetermineResourceFormat(const Tile* tile) const;
275 bool DetermineResourceRequiresSwizzle(const Tile* tile) const; 275 bool DetermineResourceRequiresSwizzle(const Tile* tile) const;
276 276
277 void DidFinishRunningTileTasksRequiredForActivation(); 277 void DidFinishRunningTileTasksRequiredForActivation();
278 void DidFinishRunningTileTasksRequiredForDraw(); 278 void DidFinishRunningTileTasksRequiredForDraw();
279 void DidFinishRunningAllTileTasks(); 279 void DidFinishRunningAllTileTasks();
280 280
281 scoped_refptr<TileTask> CreateTaskSetFinishedTask( 281 scoped_refptr<TileTask> CreateTaskSetFinishedTask(
282 void (TileManager::*callback)()); 282 void (TileManager::*callback)());
283 283
284 scoped_refptr<base::trace_event::ConvertableToTraceFormat> 284 scoped_ptr<base::trace_event::ConvertableToTraceFormat>
285 ScheduledTasksStateAsValue() const; 285 ScheduledTasksStateAsValue() const;
286 286
287 TileManagerClient* client_; 287 TileManagerClient* client_;
288 scoped_refptr<base::SequencedTaskRunner> task_runner_; 288 scoped_refptr<base::SequencedTaskRunner> task_runner_;
289 ResourcePool* resource_pool_; 289 ResourcePool* resource_pool_;
290 TileTaskRunner* tile_task_runner_; 290 TileTaskRunner* tile_task_runner_;
291 GlobalStateThatImpactsTilePriority global_state_; 291 GlobalStateThatImpactsTilePriority global_state_;
292 size_t scheduled_raster_task_limit_; 292 size_t scheduled_raster_task_limit_;
293 const bool use_partial_raster_; 293 const bool use_partial_raster_;
294 bool use_gpu_rasterization_; 294 bool use_gpu_rasterization_;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 340 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
341 341
342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 342 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
343 343
344 DISALLOW_COPY_AND_ASSIGN(TileManager); 344 DISALLOW_COPY_AND_ASSIGN(TileManager);
345 }; 345 };
346 346
347 } // namespace cc 347 } // namespace cc
348 348
349 #endif // CC_TILES_TILE_MANAGER_H_ 349 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698