| OLD | NEW |
| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 } | 467 } |
| 468 | 468 |
| 469 void TileManager::DidFinishRunningAllTileTasks() { | 469 void TileManager::DidFinishRunningAllTileTasks() { |
| 470 TRACE_EVENT0("cc", "TileManager::DidFinishRunningAllTileTasks"); | 470 TRACE_EVENT0("cc", "TileManager::DidFinishRunningAllTileTasks"); |
| 471 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); | 471 TRACE_EVENT_ASYNC_END0("cc", "ScheduledTasks", this); |
| 472 DCHECK(resource_pool_); | 472 DCHECK(resource_pool_); |
| 473 DCHECK(tile_task_manager_); | 473 DCHECK(tile_task_manager_); |
| 474 | 474 |
| 475 has_scheduled_tile_tasks_ = false; | 475 has_scheduled_tile_tasks_ = false; |
| 476 | 476 |
| 477 bool memory_usage_above_limit = resource_pool_->memory_usage_bytes() > | |
| 478 global_state_.soft_memory_limit_in_bytes; | |
| 479 | |
| 480 if (all_tiles_that_need_to_be_rasterized_are_scheduled_ && | 477 if (all_tiles_that_need_to_be_rasterized_are_scheduled_ && |
| 481 !memory_usage_above_limit) { | 478 !resource_pool_->ResourceUsageTooHigh()) { |
| 482 // TODO(ericrk): We should find a better way to safely handle re-entrant | 479 // TODO(ericrk): We should find a better way to safely handle re-entrant |
| 483 // notifications than always having to schedule a new task. | 480 // notifications than always having to schedule a new task. |
| 484 // http://crbug.com/498439 | 481 // http://crbug.com/498439 |
| 485 // TODO(vmpstr): Temporary check to debug crbug.com/642927. | 482 // TODO(vmpstr): Temporary check to debug crbug.com/642927. |
| 486 CHECK(tile_task_manager_); | 483 CHECK(tile_task_manager_); |
| 487 signals_.all_tile_tasks_completed = true; | 484 signals_.all_tile_tasks_completed = true; |
| 488 signals_check_notifier_.Schedule(); | 485 signals_check_notifier_.Schedule(); |
| 489 return; | 486 return; |
| 490 } | 487 } |
| 491 | 488 |
| (...skipping 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 all_tile_tasks_completed = false; | 1353 all_tile_tasks_completed = false; |
| 1357 did_notify_all_tile_tasks_completed = false; | 1354 did_notify_all_tile_tasks_completed = false; |
| 1358 } | 1355 } |
| 1359 | 1356 |
| 1360 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; | 1357 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule() = default; |
| 1361 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( | 1358 TileManager::PrioritizedWorkToSchedule::PrioritizedWorkToSchedule( |
| 1362 PrioritizedWorkToSchedule&& other) = default; | 1359 PrioritizedWorkToSchedule&& other) = default; |
| 1363 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; | 1360 TileManager::PrioritizedWorkToSchedule::~PrioritizedWorkToSchedule() = default; |
| 1364 | 1361 |
| 1365 } // namespace cc | 1362 } // namespace cc |
| OLD | NEW |