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

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

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip - fixed few unit tests Created 4 years, 8 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 MemoryUsage operator-(const MemoryUsage& other); 235 MemoryUsage operator-(const MemoryUsage& other);
236 236
237 bool Exceeds(const MemoryUsage& limit) const; 237 bool Exceeds(const MemoryUsage& limit) const;
238 int64_t memory_bytes() const { return memory_bytes_; } 238 int64_t memory_bytes() const { return memory_bytes_; }
239 239
240 private: 240 private:
241 int64_t memory_bytes_; 241 int64_t memory_bytes_;
242 int resource_count_; 242 int resource_count_;
243 }; 243 };
244 244
245 void OnRasterTaskCompleted( 245 void CheckAndProcessCompletedTasks();
246 Tile::Id tile, 246 void CompleteRasterTask(Tile* tile, Resource* resource, bool was_canceled);
247 Resource* resource,
248 bool was_canceled);
249 247
250 void FreeResourcesForTile(Tile* tile); 248 void FreeResourcesForTile(Tile* tile);
251 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile); 249 void FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(Tile* tile);
252 scoped_refptr<RasterTask> CreateRasterTask( 250 scoped_refptr<RasterTask> CreateRasterTask(
253 const PrioritizedTile& prioritized_tile); 251 const PrioritizedTile& prioritized_tile);
254 252
255 std::unique_ptr<EvictionTilePriorityQueue> 253 std::unique_ptr<EvictionTilePriorityQueue>
256 FreeTileResourcesUntilUsageIsWithinLimit( 254 FreeTileResourcesUntilUsageIsWithinLimit(
257 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue, 255 std::unique_ptr<EvictionTilePriorityQueue> eviction_priority_queue,
258 const MemoryUsage& limit, 256 const MemoryUsage& limit,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 size_t scheduled_raster_task_limit_; 289 size_t scheduled_raster_task_limit_;
292 const bool use_partial_raster_; 290 const bool use_partial_raster_;
293 bool use_gpu_rasterization_; 291 bool use_gpu_rasterization_;
294 292
295 using TileMap = std::unordered_map<Tile::Id, Tile*>; 293 using TileMap = std::unordered_map<Tile::Id, Tile*>;
296 TileMap tiles_; 294 TileMap tiles_;
297 295
298 bool all_tiles_that_need_to_be_rasterized_are_scheduled_; 296 bool all_tiles_that_need_to_be_rasterized_are_scheduled_;
299 MemoryHistory::Entry memory_stats_from_last_assign_; 297 MemoryHistory::Entry memory_stats_from_last_assign_;
300 298
301 bool did_check_for_completed_tasks_since_last_schedule_tasks_; 299 bool did_check_and_process_completed_tasks_since_last_schedule_tasks_;
302 bool did_oom_on_last_assign_; 300 bool did_oom_on_last_assign_;
303 301
304 ImageDecodeController* image_decode_controller_; 302 ImageDecodeController* image_decode_controller_;
305 303
306 RasterTaskCompletionStats flush_stats_; 304 RasterTaskCompletionStats flush_stats_;
307 305
308 std::vector<Tile*> released_tiles_; 306 std::vector<Tile*> released_tiles_;
309 307
310 std::vector<scoped_refptr<TileTask>> orphan_tasks_; 308 std::vector<scoped_refptr<TileTask>> orphan_tasks_;
311 309
(...skipping 27 matching lines...) Expand all
339 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_; 337 std::unordered_map<Tile::Id, std::vector<DrawImage>> scheduled_draw_images_;
340 338
341 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_; 339 base::WeakPtrFactory<TileManager> task_set_finished_weak_ptr_factory_;
342 340
343 DISALLOW_COPY_AND_ASSIGN(TileManager); 341 DISALLOW_COPY_AND_ASSIGN(TileManager);
344 }; 342 };
345 343
346 } // namespace cc 344 } // namespace cc
347 345
348 #endif // CC_TILES_TILE_MANAGER_H_ 346 #endif // CC_TILES_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698