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/picture_layer_tiling.h" | 5 #include "cc/resources/picture_layer_tiling.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 | 10 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 // Create a new tile because our twin didn't have a valid one. | 118 // Create a new tile because our twin didn't have a valid one. |
119 scoped_refptr<Tile> tile = client_->CreateTile(this, tile_rect); | 119 scoped_refptr<Tile> tile = client_->CreateTile(this, tile_rect); |
120 if (tile.get()) | 120 if (tile.get()) |
121 tiles_[key] = tile; | 121 tiles_[key] = tile; |
122 return tile.get(); | 122 return tile.get(); |
123 } | 123 } |
124 | 124 |
125 void PictureLayerTiling::SetCanUseLCDText(bool can_use_lcd_text) { | |
126 for (TileMap::iterator it = tiles_.begin(); it != tiles_.end(); ++it) | |
127 it->second->set_can_use_lcd_text(can_use_lcd_text); | |
128 } | |
129 | |
130 void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() { | 125 void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() { |
131 const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this); | 126 const PictureLayerTiling* twin_tiling = client_->GetTwinTiling(this); |
132 bool include_borders = true; | 127 bool include_borders = true; |
133 for (TilingData::Iterator iter( | 128 for (TilingData::Iterator iter( |
134 &tiling_data_, live_tiles_rect_, include_borders); | 129 &tiling_data_, live_tiles_rect_, include_borders); |
135 iter; | 130 iter; |
136 ++iter) { | 131 ++iter) { |
137 TileMapKey key = iter.index(); | 132 TileMapKey key = iter.index(); |
138 TileMap::iterator find = tiles_.find(key); | 133 TileMap::iterator find = tiles_.find(key); |
139 if (find != tiles_.end()) | 134 if (find != tiles_.end()) |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 954 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
960 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 955 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
961 is_valid_ = true; | 956 is_valid_ = true; |
962 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 957 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
963 !(*tile_iterator_)->HasResources()) { | 958 !(*tile_iterator_)->HasResources()) { |
964 ++(*this); | 959 ++(*this); |
965 } | 960 } |
966 } | 961 } |
967 | 962 |
968 } // namespace cc | 963 } // namespace cc |
OLD | NEW |