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

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

Issue 1421483005: Reland: Remove DCHECK_IMPLIES/CHECK_IMPLIES. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/picture_layer_tiling_set.cc ('k') | cc/tiles/tile_manager_unittest.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 #include "cc/tiles/tile_manager.h" 5 #include "cc/tiles/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 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 514
515 // We won't be able to schedule this tile, so break out early. 515 // We won't be able to schedule this tile, so break out early.
516 if (tiles_that_need_to_be_rasterized->size() >= 516 if (tiles_that_need_to_be_rasterized->size() >=
517 scheduled_raster_task_limit) { 517 scheduled_raster_task_limit) {
518 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false; 518 all_tiles_that_need_to_be_rasterized_are_scheduled_ = false;
519 break; 519 break;
520 } 520 }
521 521
522 tile->scheduled_priority_ = schedule_priority++; 522 tile->scheduled_priority_ = schedule_priority++;
523 523
524 DCHECK_IMPLIES(tile->draw_info().mode() != TileDrawInfo::OOM_MODE, 524 DCHECK(tile->draw_info().mode() == TileDrawInfo::OOM_MODE ||
525 !tile->draw_info().IsReadyToDraw()); 525 !tile->draw_info().IsReadyToDraw());
526 526
527 // If the tile already has a raster_task, then the memory used by it is 527 // If the tile already has a raster_task, then the memory used by it is
528 // already accounted for in memory_usage. Otherwise, we'll have to acquire 528 // already accounted for in memory_usage. Otherwise, we'll have to acquire
529 // more memory to create a raster task. 529 // more memory to create a raster task.
530 MemoryUsage memory_required_by_tile_to_be_scheduled; 530 MemoryUsage memory_required_by_tile_to_be_scheduled;
531 if (!tile->raster_task_.get()) { 531 if (!tile->raster_task_.get()) {
532 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig( 532 memory_required_by_tile_to_be_scheduled = MemoryUsage::FromConfig(
533 tile->desired_texture_size(), DetermineResourceFormat(tile)); 533 tile->desired_texture_size(), DetermineResourceFormat(tile));
534 } 534 }
535 535
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) { 788 for (; !raster_priority_queue->IsEmpty(); raster_priority_queue->Pop()) {
789 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw()) 789 if (!raster_priority_queue->Top().tile()->draw_info().IsReadyToDraw())
790 return false; 790 return false;
791 } 791 }
792 792
793 #if DCHECK_IS_ON() 793 #if DCHECK_IS_ON()
794 scoped_ptr<RasterTilePriorityQueue> all_queue( 794 scoped_ptr<RasterTilePriorityQueue> all_queue(
795 client_->BuildRasterQueue(global_state_.tree_priority, type)); 795 client_->BuildRasterQueue(global_state_.tree_priority, type));
796 for (; !all_queue->IsEmpty(); all_queue->Pop()) { 796 for (; !all_queue->IsEmpty(); all_queue->Pop()) {
797 Tile* tile = all_queue->Top().tile(); 797 Tile* tile = all_queue->Top().tile();
798 DCHECK_IMPLIES(tile->required_for_activation(), 798 DCHECK(!tile->required_for_activation() ||
799 tile->draw_info().IsReadyToDraw()); 799 tile->draw_info().IsReadyToDraw());
800 } 800 }
801 #endif 801 #endif
802 return true; 802 return true;
803 } 803 }
804 804
805 bool TileManager::IsReadyToActivate() const { 805 bool TileManager::IsReadyToActivate() const {
806 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate"); 806 TRACE_EVENT0("cc", "TileManager::IsReadyToActivate");
807 return AreRequiredTilesReadyToDraw( 807 return AreRequiredTilesReadyToDraw(
808 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION); 808 RasterTilePriorityQueue::Type::REQUIRED_FOR_ACTIVATION);
809 } 809 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
1005 void TileManager::Signals::reset() { 1005 void TileManager::Signals::reset() {
1006 ready_to_activate = false; 1006 ready_to_activate = false;
1007 did_notify_ready_to_activate = false; 1007 did_notify_ready_to_activate = false;
1008 ready_to_draw = false; 1008 ready_to_draw = false;
1009 did_notify_ready_to_draw = false; 1009 did_notify_ready_to_draw = false;
1010 all_tile_tasks_completed = false; 1010 all_tile_tasks_completed = false;
1011 did_notify_all_tile_tasks_completed = false; 1011 did_notify_all_tile_tasks_completed = false;
1012 } 1012 }
1013 1013
1014 } // namespace cc 1014 } // namespace cc
OLDNEW
« no previous file with comments | « cc/tiles/picture_layer_tiling_set.cc ('k') | cc/tiles/tile_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698