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

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

Issue 2560253003: Delay Activation/Draw in smoothness mode.
Patch Set: more unit tests Created 4 years 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/tiles/tile_draw_info.cc ('k') | cc/tiles/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_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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 BasicStateAsValue() const; 141 BasicStateAsValue() const;
142 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const; 142 void BasicStateAsValueInto(base::trace_event::TracedValue* dict) const;
143 const MemoryHistory::Entry& memory_stats_from_last_assign() const { 143 const MemoryHistory::Entry& memory_stats_from_last_assign() const {
144 return memory_stats_from_last_assign_; 144 return memory_stats_from_last_assign_;
145 } 145 }
146 146
147 // Public methods for testing. 147 // Public methods for testing.
148 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) { 148 void InitializeTilesWithResourcesForTesting(const std::vector<Tile*>& tiles) {
149 for (size_t i = 0; i < tiles.size(); ++i) { 149 for (size_t i = 0; i < tiles.size(); ++i) {
150 TileDrawInfo& draw_info = tiles[i]->draw_info(); 150 TileDrawInfo& draw_info = tiles[i]->draw_info();
151 draw_info.resource_ = resource_pool_->AcquireResource( 151 draw_info.set_resource(resource_pool_->AcquireResource(
152 tiles[i]->desired_texture_size(), 152 tiles[i]->desired_texture_size(),
153 raster_buffer_provider_->GetResourceFormat(false), 153 raster_buffer_provider_->GetResourceFormat(false),
154 client_->GetTileColorSpace()); 154 client_->GetTileColorSpace()));
155 draw_info.set_is_resource_ready_for_draw();
155 } 156 }
156 } 157 }
157 158
158 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) { 159 void ReleaseTileResourcesForTesting(const std::vector<Tile*>& tiles) {
159 for (size_t i = 0; i < tiles.size(); ++i) { 160 for (size_t i = 0; i < tiles.size(); ++i) {
160 Tile* tile = tiles[i]; 161 Tile* tile = tiles[i];
161 FreeResourcesForTile(tile); 162 FreeResourcesForTile(tile);
162 } 163 }
163 } 164 }
164 165
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 scoped_refptr<TileTask> CreateTaskSetFinishedTask( 297 scoped_refptr<TileTask> CreateTaskSetFinishedTask(
297 void (TileManager::*callback)()); 298 void (TileManager::*callback)());
298 PrioritizedWorkToSchedule AssignGpuMemoryToTiles(); 299 PrioritizedWorkToSchedule AssignGpuMemoryToTiles();
299 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule); 300 void ScheduleTasks(const PrioritizedWorkToSchedule& work_to_schedule);
300 301
301 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> 302 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
302 ScheduledTasksStateAsValue() const; 303 ScheduledTasksStateAsValue() const;
303 304
304 bool UsePartialRaster() const; 305 bool UsePartialRaster() const;
305 306
307 void CheckPendingReadyToDrawTiles(bool issue_signals);
308 void UpdatePendingReadyToDrawTiles();
309 void ReadyToDrawCallback(uint64_t callback_id);
310
306 TileManagerClient* client_; 311 TileManagerClient* client_;
307 base::SequencedTaskRunner* task_runner_; 312 base::SequencedTaskRunner* task_runner_;
308 ResourcePool* resource_pool_; 313 ResourcePool* resource_pool_;
309 std::unique_ptr<TileTaskManager> tile_task_manager_; 314 std::unique_ptr<TileTaskManager> tile_task_manager_;
310 RasterBufferProvider* raster_buffer_provider_; 315 RasterBufferProvider* raster_buffer_provider_;
311 GlobalStateThatImpactsTilePriority global_state_; 316 GlobalStateThatImpactsTilePriority global_state_;
312 size_t scheduled_raster_task_limit_; 317 size_t scheduled_raster_task_limit_;
313 const bool use_partial_raster_; 318 const bool use_partial_raster_;
314 bool use_gpu_rasterization_; 319 bool use_gpu_rasterization_;
315 320
(...skipping 17 matching lines...) Expand all
333 338
334 Signals signals_; 339 Signals signals_;
335 340
336 UniqueNotifier signals_check_notifier_; 341 UniqueNotifier signals_check_notifier_;
337 342
338 bool has_scheduled_tile_tasks_; 343 bool has_scheduled_tile_tasks_;
339 344
340 uint64_t prepare_tiles_count_; 345 uint64_t prepare_tiles_count_;
341 uint64_t next_tile_id_; 346 uint64_t next_tile_id_;
342 347
348 std::vector<Tile*> pending_ready_for_draw_tiles_;
349 uint64_t pending_required_for_activation_callback_id_ = 0;
350 uint64_t pending_required_for_draw_callback_id_ = 0;
351 bool has_pending_ready_to_activate_resource_ = false;
352 bool has_pending_ready_to_draw_resources_ = false;
353 bool pending_tile_requirements_dirty_ = true;
354
343 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 355 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
344 std::vector<scoped_refptr<TileTask>> locked_image_tasks_; 356 std::vector<scoped_refptr<TileTask>> locked_image_tasks_;
345 357
346 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 358 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
359 base::WeakPtrFactory<TileManager> ready_to_draw_callback_weak_ptr_factory_;
347 360
348 DISALLOW_COPY_AND_ASSIGN(TileManager); 361 DISALLOW_COPY_AND_ASSIGN(TileManager);
349 }; 362 };
350 363
351 } // namespace cc 364 } // namespace cc
352 365
353 #endif // CC_TILES_TILE_MANAGER_H_ 366 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/tiles/tile_draw_info.cc ('k') | cc/tiles/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698