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

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

Issue 2680313007: cc: Remove resource freed tiles from tile manager pending gpu work set. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | 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 #include "cc/tiles/tile_manager.h" 5 #include "cc/tiles/tile_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 scheduled_raster_task_limit_ = scheduled_raster_task_limit; 418 scheduled_raster_task_limit_ = scheduled_raster_task_limit;
419 resource_pool_ = resource_pool; 419 resource_pool_ = resource_pool;
420 image_controller_.SetImageDecodeCache(image_decode_cache); 420 image_controller_.SetImageDecodeCache(image_decode_cache);
421 tile_task_manager_ = TileTaskManagerImpl::Create(task_graph_runner); 421 tile_task_manager_ = TileTaskManagerImpl::Create(task_graph_runner);
422 raster_buffer_provider_ = raster_buffer_provider; 422 raster_buffer_provider_ = raster_buffer_provider;
423 } 423 }
424 424
425 void TileManager::Release(Tile* tile) { 425 void TileManager::Release(Tile* tile) {
426 FreeResourcesForTile(tile); 426 FreeResourcesForTile(tile);
427 tiles_.erase(tile->id()); 427 tiles_.erase(tile->id());
428 pending_gpu_work_tiles_.erase(tile);
429 } 428 }
430 429
431 void TileManager::DidFinishRunningTileTasksRequiredForActivation() { 430 void TileManager::DidFinishRunningTileTasksRequiredForActivation() {
432 TRACE_EVENT0("cc", 431 TRACE_EVENT0("cc",
433 "TileManager::DidFinishRunningTileTasksRequiredForActivation"); 432 "TileManager::DidFinishRunningTileTasksRequiredForActivation");
434 TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state", 433 TRACE_EVENT_ASYNC_STEP_INTO1("cc", "ScheduledTasks", this, "running", "state",
435 ScheduledTasksStateAsValue()); 434 ScheduledTasksStateAsValue());
436 // TODO(vmpstr): Temporary check to debug crbug.com/642927. 435 // TODO(vmpstr): Temporary check to debug crbug.com/642927.
437 CHECK(tile_task_manager_); 436 CHECK(tile_task_manager_);
438 signals_.ready_to_activate = true; 437 signals_.ready_to_activate = true;
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 "had_enough_memory_to_schedule_tiles_needed_now", 796 "had_enough_memory_to_schedule_tiles_needed_now",
798 had_enough_memory_to_schedule_tiles_needed_now); 797 had_enough_memory_to_schedule_tiles_needed_now);
799 return work_to_schedule; 798 return work_to_schedule;
800 } 799 }
801 800
802 void TileManager::FreeResourcesForTile(Tile* tile) { 801 void TileManager::FreeResourcesForTile(Tile* tile) {
803 TileDrawInfo& draw_info = tile->draw_info(); 802 TileDrawInfo& draw_info = tile->draw_info();
804 Resource* resource = draw_info.TakeResource(); 803 Resource* resource = draw_info.TakeResource();
805 if (resource) 804 if (resource)
806 resource_pool_->ReleaseResource(resource); 805 resource_pool_->ReleaseResource(resource);
806 pending_gpu_work_tiles_.erase(tile);
vmpstr 2017/02/09 18:49:20 nit: might as well make it a part of the if
sunnyps 2017/02/10 23:49:59 Done. Also added a DCHECK in CheckPendingGpuWorkTi
807 } 807 }
808 808
809 void TileManager::FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw( 809 void TileManager::FreeResourcesForTileAndNotifyClientIfTileWasReadyToDraw(
810 Tile* tile) { 810 Tile* tile) {
811 bool was_ready_to_draw = tile->draw_info().IsReadyToDraw(); 811 bool was_ready_to_draw = tile->draw_info().IsReadyToDraw();
812 FreeResourcesForTile(tile); 812 FreeResourcesForTile(tile);
813 if (was_ready_to_draw) 813 if (was_ready_to_draw)
814 client_->NotifyTileStateChanged(tile); 814 client_->NotifyTileStateChanged(tile);
815 } 815 }
816 816
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
1455 all_tile_tasks_completed = false; 1455 all_tile_tasks_completed = false;
1456 did_notify_all_tile_tasks_completed = false; 1456 did_notify_all_tile_tasks_completed = false;
1457 } 1457 }
1458 1458
1459 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; 1459 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default;
1460 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( 1460 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule(
1461 PrioritizedWorkToSchedule&& other) = default; 1461 PrioritizedWorkToSchedule&& other) = default;
1462 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; 1462 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default;
1463 1463
1464 } // namespace cc 1464 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698