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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 tiles_[tile->id()] = tile.get(); | 845 tiles_[tile->id()] = tile.get(); |
846 used_layer_counts_[tile->layer_id()]++; | 846 used_layer_counts_[tile->layer_id()]++; |
847 return tile; | 847 return tile; |
848 } | 848 } |
849 | 849 |
850 void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) { | 850 void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) { |
851 rasterizer_ = rasterizer; | 851 rasterizer_ = rasterizer; |
852 rasterizer_->SetClient(this); | 852 rasterizer_->SetClient(this); |
853 } | 853 } |
854 | 854 |
| 855 void TileManager::WaitForTasksToFinishRunning() { |
| 856 rasterizer_->WaitForTasksToFinishRunning(); |
| 857 } |
| 858 |
855 bool TileManager::IsReadyToActivate() const { | 859 bool TileManager::IsReadyToActivate() const { |
856 const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers(); | 860 const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers(); |
857 | 861 |
858 for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin(); | 862 for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin(); |
859 it != layers.end(); | 863 it != layers.end(); |
860 ++it) { | 864 ++it) { |
861 if (!(*it)->AllTilesRequiredForActivationAreReadyToDraw()) | 865 if (!(*it)->AllTilesRequiredForActivationAreReadyToDraw()) |
862 return false; | 866 return false; |
863 } | 867 } |
864 | 868 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 result -= other; | 923 result -= other; |
920 return result; | 924 return result; |
921 } | 925 } |
922 | 926 |
923 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { | 927 bool TileManager::MemoryUsage::Exceeds(const MemoryUsage& limit) const { |
924 return memory_bytes_ > limit.memory_bytes_ || | 928 return memory_bytes_ > limit.memory_bytes_ || |
925 resource_count_ > limit.resource_count_; | 929 resource_count_ > limit.resource_count_; |
926 } | 930 } |
927 | 931 |
928 } // namespace cc | 932 } // namespace cc |
OLD | NEW |