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

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

Issue 285373003: Reland "cc: Remove layers that are not drawn from tile manager." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « cc/resources/tile_manager.h ('k') | 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/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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 !mts.tile_versions[mts.raster_mode].raster_task_) { 670 !mts.tile_versions[mts.raster_mode].raster_task_) {
671 FreeResourcesForTile(tile); 671 FreeResourcesForTile(tile);
672 continue; 672 continue;
673 } 673 }
674 674
675 // Insert the tile into a priority set. 675 // Insert the tile into a priority set.
676 tiles->InsertTile(tile, mts.bin); 676 tiles->InsertTile(tile, mts.bin);
677 } 677 }
678 } 678 }
679 679
680 void TileManager::CleanUpLayers() {
681 for (size_t i = 0; i < layers_.size(); ++i) {
682 if (layers_[i]->IsDrawnRenderSurfaceLayerListMember())
683 continue;
684
685 layers_[i]->DidUnregisterLayer();
686 std::swap(layers_[i], layers_.back());
687 layers_.pop_back();
688 --i;
689 prioritized_tiles_dirty_ = true;
690 }
691 }
692
680 void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) { 693 void TileManager::ManageTiles(const GlobalStateThatImpactsTilePriority& state) {
681 TRACE_EVENT0("cc", "TileManager::ManageTiles"); 694 TRACE_EVENT0("cc", "TileManager::ManageTiles");
682 695
683 // Update internal state. 696 // Update internal state.
684 if (state != global_state_) { 697 if (state != global_state_) {
685 global_state_ = state; 698 global_state_ = state;
686 prioritized_tiles_dirty_ = true; 699 prioritized_tiles_dirty_ = true;
687 } 700 }
688 701
702 CleanUpLayers();
703
689 // We need to call CheckForCompletedTasks() once in-between each call 704 // We need to call CheckForCompletedTasks() once in-between each call
690 // to ScheduleTasks() to prevent canceled tasks from being scheduled. 705 // to ScheduleTasks() to prevent canceled tasks from being scheduled.
691 if (!did_check_for_completed_tasks_since_last_schedule_tasks_) { 706 if (!did_check_for_completed_tasks_since_last_schedule_tasks_) {
692 rasterizer_delegate_->CheckForCompletedTasks(); 707 rasterizer_delegate_->CheckForCompletedTasks();
693 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; 708 did_check_for_completed_tasks_since_last_schedule_tasks_ = true;
694 } 709 }
695 710
696 UpdatePrioritizedTileSetIfNeeded(); 711 UpdatePrioritizedTileSetIfNeeded();
697 712
698 TileVector tiles_that_need_to_be_rasterized; 713 TileVector tiles_that_need_to_be_rasterized;
(...skipping 917 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 } 1631 }
1617 1632
1618 void TileManager::SetRasterizersForTesting(Rasterizer* rasterizer, 1633 void TileManager::SetRasterizersForTesting(Rasterizer* rasterizer,
1619 Rasterizer* gpu_rasterizer) { 1634 Rasterizer* gpu_rasterizer) {
1620 Rasterizer* rasterizers[2] = {rasterizer, gpu_rasterizer}; 1635 Rasterizer* rasterizers[2] = {rasterizer, gpu_rasterizer};
1621 rasterizer_delegate_ = 1636 rasterizer_delegate_ =
1622 RasterizerDelegate::Create(this, rasterizers, arraysize(rasterizers)); 1637 RasterizerDelegate::Create(this, rasterizers, arraysize(rasterizers));
1623 } 1638 }
1624 1639
1625 } // namespace cc 1640 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698