| 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/resources/tile_manager.h" | 5 #include "cc/resources/tile_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 tile_version.set_rasterize_on_demand(); | 531 tile_version.set_rasterize_on_demand(); |
| 532 client_->NotifyTileStateChanged(tile); | 532 client_->NotifyTileStateChanged(tile); |
| 533 } | 533 } |
| 534 } | 534 } |
| 535 | 535 |
| 536 DCHECK(IsReadyToActivate()); | 536 DCHECK(IsReadyToActivate()); |
| 537 ready_to_activate_check_notifier_.Schedule(); | 537 ready_to_activate_check_notifier_.Schedule(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 void TileManager::DidFinishRunningTasksRequiredForActivation() { | 540 void TileManager::DidFinishRunningTasksRequiredForActivation() { |
| 541 TRACE_EVENT1("cc", |
| 542 "TileManager::DidFinishRunningTasksRequiredForActivation", |
| 543 "all_tiles_required_for_activation_have_memory", |
| 544 all_tiles_required_for_activation_have_memory_); |
| 541 // This is only a true indication that all tiles required for | 545 // This is only a true indication that all tiles required for |
| 542 // activation are initialized when no tiles are OOM. We need to | 546 // activation are initialized when no tiles are OOM. We need to |
| 543 // wait for DidFinishRunningTasks() to be called, try to re-assign | 547 // wait for DidFinishRunningTasks() to be called, try to re-assign |
| 544 // memory and in worst case use on-demand raster when tiles | 548 // memory and in worst case use on-demand raster when tiles |
| 545 // required for activation are OOM. | 549 // required for activation are OOM. |
| 546 if (!all_tiles_required_for_activation_have_memory_) | 550 if (!all_tiles_required_for_activation_have_memory_) |
| 547 return; | 551 return; |
| 548 | 552 |
| 549 ready_to_activate_check_notifier_.Schedule(); | 553 ready_to_activate_check_notifier_.Schedule(); |
| 550 } | 554 } |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); | 1173 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); |
| 1170 | 1174 |
| 1171 rasterizer_->CheckForCompletedTasks(); | 1175 rasterizer_->CheckForCompletedTasks(); |
| 1172 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1176 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
| 1173 | 1177 |
| 1174 if (IsReadyToActivate()) | 1178 if (IsReadyToActivate()) |
| 1175 client_->NotifyReadyToActivate(); | 1179 client_->NotifyReadyToActivate(); |
| 1176 } | 1180 } |
| 1177 | 1181 |
| 1178 } // namespace cc | 1182 } // namespace cc |
| OLD | NEW |