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 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1129 source_frame_number, | 1129 source_frame_number, |
1130 flags)); | 1130 flags)); |
1131 DCHECK(tiles_.find(tile->id()) == tiles_.end()); | 1131 DCHECK(tiles_.find(tile->id()) == tiles_.end()); |
1132 | 1132 |
1133 tiles_[tile->id()] = tile; | 1133 tiles_[tile->id()] = tile; |
1134 used_layer_counts_[tile->layer_id()]++; | 1134 used_layer_counts_[tile->layer_id()]++; |
1135 prioritized_tiles_dirty_ = true; | 1135 prioritized_tiles_dirty_ = true; |
1136 return tile; | 1136 return tile; |
1137 } | 1137 } |
1138 | 1138 |
| 1139 void TileManager::GetPairedPictureLayers( |
| 1140 std::vector<PairedPictureLayer>* paired_layers) const { |
| 1141 const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers(); |
| 1142 |
| 1143 paired_layers->clear(); |
| 1144 // Reserve a maximum possible paired layers. |
| 1145 paired_layers->reserve(layers.size()); |
| 1146 |
| 1147 for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin(); |
| 1148 it != layers.end(); |
| 1149 ++it) { |
| 1150 PictureLayerImpl* layer = *it; |
| 1151 |
| 1152 // TODO(vmpstr): Iterators and should handle this instead. crbug.com/381704 |
| 1153 if (!layer->HasValidTilePriorities()) |
| 1154 continue; |
| 1155 |
| 1156 PictureLayerImpl* twin_layer = layer->GetTwinLayer(); |
| 1157 |
| 1158 // Ignore the twin layer when tile priorities are invalid. |
| 1159 // TODO(vmpstr): Iterators should handle this instead. crbug.com/381704 |
| 1160 if (twin_layer && !twin_layer->HasValidTilePriorities()) |
| 1161 twin_layer = NULL; |
| 1162 |
| 1163 PairedPictureLayer paired_layer; |
| 1164 WhichTree tree = layer->GetTree(); |
| 1165 |
| 1166 // If the current tree is ACTIVE_TREE, then always generate a paired_layer. |
| 1167 // If current tree is PENDING_TREE, then only generate a paired_layer if |
| 1168 // there is no twin layer. |
| 1169 if (tree == ACTIVE_TREE) { |
| 1170 DCHECK(!twin_layer || twin_layer->GetTree() == PENDING_TREE); |
| 1171 paired_layer.active_layer = layer; |
| 1172 paired_layer.pending_layer = twin_layer; |
| 1173 paired_layers->push_back(paired_layer); |
| 1174 } else if (!twin_layer) { |
| 1175 paired_layer.active_layer = NULL; |
| 1176 paired_layer.pending_layer = layer; |
| 1177 paired_layers->push_back(paired_layer); |
| 1178 } |
| 1179 } |
| 1180 } |
| 1181 |
| 1182 TileManager::PairedPictureLayer::PairedPictureLayer() |
| 1183 : active_layer(NULL), pending_layer(NULL) {} |
| 1184 |
| 1185 TileManager::PairedPictureLayer::~PairedPictureLayer() {} |
| 1186 |
| 1187 TileManager::RasterTileIterator::RasterTileIterator(TileManager* tile_manager, |
| 1188 TreePriority tree_priority) |
| 1189 : tree_priority_(tree_priority), comparator_(tree_priority) { |
| 1190 std::vector<TileManager::PairedPictureLayer> paired_layers; |
| 1191 tile_manager->GetPairedPictureLayers(&paired_layers); |
| 1192 bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY; |
| 1193 |
| 1194 paired_iterators_.reserve(paired_layers.size()); |
| 1195 iterator_heap_.reserve(paired_layers.size()); |
| 1196 for (std::vector<TileManager::PairedPictureLayer>::iterator it = |
| 1197 paired_layers.begin(); |
| 1198 it != paired_layers.end(); |
| 1199 ++it) { |
| 1200 PairedPictureLayerIterator paired_iterator; |
| 1201 if (it->active_layer) { |
| 1202 paired_iterator.active_iterator = |
| 1203 PictureLayerImpl::LayerRasterTileIterator(it->active_layer, |
| 1204 prioritize_low_res); |
| 1205 } |
| 1206 |
| 1207 if (it->pending_layer) { |
| 1208 paired_iterator.pending_iterator = |
| 1209 PictureLayerImpl::LayerRasterTileIterator(it->pending_layer, |
| 1210 prioritize_low_res); |
| 1211 } |
| 1212 |
| 1213 if (paired_iterator.PeekTile(tree_priority_) != NULL) { |
| 1214 paired_iterators_.push_back(paired_iterator); |
| 1215 iterator_heap_.push_back(&paired_iterators_.back()); |
| 1216 } |
| 1217 } |
| 1218 |
| 1219 std::make_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1220 } |
| 1221 |
| 1222 TileManager::RasterTileIterator::~RasterTileIterator() {} |
| 1223 |
| 1224 TileManager::RasterTileIterator& TileManager::RasterTileIterator::operator++() { |
| 1225 DCHECK(*this); |
| 1226 |
| 1227 std::pop_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1228 PairedPictureLayerIterator* paired_iterator = iterator_heap_.back(); |
| 1229 iterator_heap_.pop_back(); |
| 1230 |
| 1231 paired_iterator->PopTile(tree_priority_); |
| 1232 if (paired_iterator->PeekTile(tree_priority_) != NULL) { |
| 1233 iterator_heap_.push_back(paired_iterator); |
| 1234 std::push_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1235 } |
| 1236 return *this; |
| 1237 } |
| 1238 |
| 1239 TileManager::RasterTileIterator::operator bool() const { |
| 1240 return !iterator_heap_.empty(); |
| 1241 } |
| 1242 |
| 1243 Tile* TileManager::RasterTileIterator::operator*() { |
| 1244 DCHECK(*this); |
| 1245 return iterator_heap_.front()->PeekTile(tree_priority_); |
| 1246 } |
| 1247 |
| 1248 TileManager::RasterTileIterator::PairedPictureLayerIterator:: |
| 1249 PairedPictureLayerIterator() {} |
| 1250 |
| 1251 TileManager::RasterTileIterator::PairedPictureLayerIterator:: |
| 1252 ~PairedPictureLayerIterator() {} |
| 1253 |
| 1254 Tile* TileManager::RasterTileIterator::PairedPictureLayerIterator::PeekTile( |
| 1255 TreePriority tree_priority) { |
| 1256 PictureLayerImpl::LayerRasterTileIterator* next_iterator = |
| 1257 NextTileIterator(tree_priority).first; |
| 1258 if (!next_iterator) |
| 1259 return NULL; |
| 1260 |
| 1261 DCHECK(*next_iterator); |
| 1262 DCHECK(std::find(returned_shared_tiles.begin(), |
| 1263 returned_shared_tiles.end(), |
| 1264 **next_iterator) == returned_shared_tiles.end()); |
| 1265 return **next_iterator; |
| 1266 } |
| 1267 |
| 1268 void TileManager::RasterTileIterator::PairedPictureLayerIterator::PopTile( |
| 1269 TreePriority tree_priority) { |
| 1270 PictureLayerImpl::LayerRasterTileIterator* next_iterator = |
| 1271 NextTileIterator(tree_priority).first; |
| 1272 DCHECK(next_iterator); |
| 1273 DCHECK(*next_iterator); |
| 1274 returned_shared_tiles.push_back(**next_iterator); |
| 1275 ++(*next_iterator); |
| 1276 |
| 1277 next_iterator = NextTileIterator(tree_priority).first; |
| 1278 while (next_iterator && |
| 1279 std::find(returned_shared_tiles.begin(), |
| 1280 returned_shared_tiles.end(), |
| 1281 **next_iterator) != returned_shared_tiles.end()) { |
| 1282 ++(*next_iterator); |
| 1283 next_iterator = NextTileIterator(tree_priority).first; |
| 1284 } |
| 1285 } |
| 1286 |
| 1287 std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree> |
| 1288 TileManager::RasterTileIterator::PairedPictureLayerIterator::NextTileIterator( |
| 1289 TreePriority tree_priority) { |
| 1290 // If both iterators are out of tiles, return NULL. |
| 1291 if (!active_iterator && !pending_iterator) { |
| 1292 return std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree>( |
| 1293 NULL, ACTIVE_TREE); |
| 1294 } |
| 1295 |
| 1296 // If we only have one iterator with tiles, return it. |
| 1297 if (!active_iterator) |
| 1298 return std::make_pair(&pending_iterator, PENDING_TREE); |
| 1299 if (!pending_iterator) |
| 1300 return std::make_pair(&active_iterator, ACTIVE_TREE); |
| 1301 |
| 1302 // Now both iterators have tiles, so we have to decide based on tree priority. |
| 1303 switch (tree_priority) { |
| 1304 case SMOOTHNESS_TAKES_PRIORITY: |
| 1305 return std::make_pair(&active_iterator, ACTIVE_TREE); |
| 1306 case NEW_CONTENT_TAKES_PRIORITY: |
| 1307 return std::make_pair(&pending_iterator, ACTIVE_TREE); |
| 1308 case SAME_PRIORITY_FOR_BOTH_TREES: { |
| 1309 Tile* active_tile = *active_iterator; |
| 1310 Tile* pending_tile = *pending_iterator; |
| 1311 if (active_tile == pending_tile) |
| 1312 return std::make_pair(&active_iterator, ACTIVE_TREE); |
| 1313 |
| 1314 const TilePriority& active_priority = active_tile->priority(ACTIVE_TREE); |
| 1315 const TilePriority& pending_priority = |
| 1316 pending_tile->priority(PENDING_TREE); |
| 1317 |
| 1318 if (active_priority.IsHigherPriorityThan(pending_priority)) |
| 1319 return std::make_pair(&active_iterator, ACTIVE_TREE); |
| 1320 return std::make_pair(&pending_iterator, PENDING_TREE); |
| 1321 } |
| 1322 default: |
| 1323 NOTREACHED(); |
| 1324 } |
| 1325 |
| 1326 NOTREACHED(); |
| 1327 // Keep the compiler happy. |
| 1328 return std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree>( |
| 1329 NULL, ACTIVE_TREE); |
| 1330 } |
| 1331 |
| 1332 TileManager::RasterTileIterator::RasterOrderComparator::RasterOrderComparator( |
| 1333 TreePriority tree_priority) |
| 1334 : tree_priority_(tree_priority) {} |
| 1335 |
| 1336 bool TileManager::RasterTileIterator::RasterOrderComparator::operator()( |
| 1337 PairedPictureLayerIterator* a, |
| 1338 PairedPictureLayerIterator* b) const { |
| 1339 std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree> a_pair = |
| 1340 a->NextTileIterator(tree_priority_); |
| 1341 DCHECK(a_pair.first); |
| 1342 DCHECK(*a_pair.first); |
| 1343 |
| 1344 std::pair<PictureLayerImpl::LayerRasterTileIterator*, WhichTree> b_pair = |
| 1345 b->NextTileIterator(tree_priority_); |
| 1346 DCHECK(b_pair.first); |
| 1347 DCHECK(*b_pair.first); |
| 1348 |
| 1349 Tile* a_tile = **a_pair.first; |
| 1350 Tile* b_tile = **b_pair.first; |
| 1351 |
| 1352 const TilePriority& a_priority = |
| 1353 a_tile->priority_for_tree_priority(tree_priority_); |
| 1354 const TilePriority& b_priority = |
| 1355 b_tile->priority_for_tree_priority(tree_priority_); |
| 1356 bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY; |
| 1357 |
| 1358 // Now we have to return true iff b is higher priority than a. |
| 1359 |
| 1360 // If the bin is the same but the resolution is not, then the order will be |
| 1361 // determined by whether we prioritize low res or not. |
| 1362 // TODO(vmpstr): Remove this when TilePriority is no longer a member of Tile |
| 1363 // class but instead produced by the iterators. |
| 1364 if (b_priority.priority_bin == a_priority.priority_bin && |
| 1365 b_priority.resolution != a_priority.resolution) { |
| 1366 // Non ideal resolution should be sorted lower than other resolutions. |
| 1367 if (a_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1368 return true; |
| 1369 |
| 1370 if (b_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1371 return false; |
| 1372 |
| 1373 if (prioritize_low_res) |
| 1374 return b_priority.resolution == LOW_RESOLUTION; |
| 1375 |
| 1376 return b_priority.resolution == HIGH_RESOLUTION; |
| 1377 } |
| 1378 |
| 1379 return b_priority.IsHigherPriorityThan(a_priority); |
| 1380 } |
| 1381 |
| 1382 TileManager::EvictionTileIterator::EvictionTileIterator() |
| 1383 : comparator_(SAME_PRIORITY_FOR_BOTH_TREES) {} |
| 1384 |
| 1385 TileManager::EvictionTileIterator::EvictionTileIterator( |
| 1386 TileManager* tile_manager, |
| 1387 TreePriority tree_priority) |
| 1388 : tree_priority_(tree_priority), comparator_(tree_priority) { |
| 1389 std::vector<TileManager::PairedPictureLayer> paired_layers; |
| 1390 |
| 1391 tile_manager->GetPairedPictureLayers(&paired_layers); |
| 1392 |
| 1393 paired_iterators_.reserve(paired_layers.size()); |
| 1394 iterator_heap_.reserve(paired_layers.size()); |
| 1395 for (std::vector<TileManager::PairedPictureLayer>::iterator it = |
| 1396 paired_layers.begin(); |
| 1397 it != paired_layers.end(); |
| 1398 ++it) { |
| 1399 PairedPictureLayerIterator paired_iterator; |
| 1400 if (it->active_layer) { |
| 1401 paired_iterator.active_iterator = |
| 1402 PictureLayerImpl::LayerEvictionTileIterator(it->active_layer, |
| 1403 tree_priority_); |
| 1404 } |
| 1405 |
| 1406 if (it->pending_layer) { |
| 1407 paired_iterator.pending_iterator = |
| 1408 PictureLayerImpl::LayerEvictionTileIterator(it->pending_layer, |
| 1409 tree_priority_); |
| 1410 } |
| 1411 |
| 1412 if (paired_iterator.PeekTile(tree_priority_) != NULL) { |
| 1413 paired_iterators_.push_back(paired_iterator); |
| 1414 iterator_heap_.push_back(&paired_iterators_.back()); |
| 1415 } |
| 1416 } |
| 1417 |
| 1418 std::make_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1419 } |
| 1420 |
| 1421 TileManager::EvictionTileIterator::~EvictionTileIterator() {} |
| 1422 |
| 1423 TileManager::EvictionTileIterator& TileManager::EvictionTileIterator:: |
| 1424 operator++() { |
| 1425 std::pop_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1426 PairedPictureLayerIterator* paired_iterator = iterator_heap_.back(); |
| 1427 iterator_heap_.pop_back(); |
| 1428 |
| 1429 paired_iterator->PopTile(tree_priority_); |
| 1430 if (paired_iterator->PeekTile(tree_priority_) != NULL) { |
| 1431 iterator_heap_.push_back(paired_iterator); |
| 1432 std::push_heap(iterator_heap_.begin(), iterator_heap_.end(), comparator_); |
| 1433 } |
| 1434 return *this; |
| 1435 } |
| 1436 |
| 1437 TileManager::EvictionTileIterator::operator bool() const { |
| 1438 return !iterator_heap_.empty(); |
| 1439 } |
| 1440 |
| 1441 Tile* TileManager::EvictionTileIterator::operator*() { |
| 1442 DCHECK(*this); |
| 1443 return iterator_heap_.front()->PeekTile(tree_priority_); |
| 1444 } |
| 1445 |
| 1446 TileManager::EvictionTileIterator::PairedPictureLayerIterator:: |
| 1447 PairedPictureLayerIterator() {} |
| 1448 |
| 1449 TileManager::EvictionTileIterator::PairedPictureLayerIterator:: |
| 1450 ~PairedPictureLayerIterator() {} |
| 1451 |
| 1452 Tile* TileManager::EvictionTileIterator::PairedPictureLayerIterator::PeekTile( |
| 1453 TreePriority tree_priority) { |
| 1454 PictureLayerImpl::LayerEvictionTileIterator* next_iterator = |
| 1455 NextTileIterator(tree_priority); |
| 1456 if (!next_iterator) |
| 1457 return NULL; |
| 1458 |
| 1459 DCHECK(*next_iterator); |
| 1460 DCHECK(std::find(returned_shared_tiles.begin(), |
| 1461 returned_shared_tiles.end(), |
| 1462 **next_iterator) == returned_shared_tiles.end()); |
| 1463 return **next_iterator; |
| 1464 } |
| 1465 |
| 1466 void TileManager::EvictionTileIterator::PairedPictureLayerIterator::PopTile( |
| 1467 TreePriority tree_priority) { |
| 1468 PictureLayerImpl::LayerEvictionTileIterator* next_iterator = |
| 1469 NextTileIterator(tree_priority); |
| 1470 DCHECK(next_iterator); |
| 1471 DCHECK(*next_iterator); |
| 1472 returned_shared_tiles.push_back(**next_iterator); |
| 1473 ++(*next_iterator); |
| 1474 |
| 1475 next_iterator = NextTileIterator(tree_priority); |
| 1476 while (next_iterator && |
| 1477 std::find(returned_shared_tiles.begin(), |
| 1478 returned_shared_tiles.end(), |
| 1479 **next_iterator) != returned_shared_tiles.end()) { |
| 1480 ++(*next_iterator); |
| 1481 next_iterator = NextTileIterator(tree_priority); |
| 1482 } |
| 1483 } |
| 1484 |
| 1485 PictureLayerImpl::LayerEvictionTileIterator* |
| 1486 TileManager::EvictionTileIterator::PairedPictureLayerIterator::NextTileIterator( |
| 1487 TreePriority tree_priority) { |
| 1488 // If both iterators are out of tiles, return NULL. |
| 1489 if (!active_iterator && !pending_iterator) |
| 1490 return NULL; |
| 1491 |
| 1492 // If we only have one iterator with tiles, return it. |
| 1493 if (!active_iterator) |
| 1494 return &pending_iterator; |
| 1495 if (!pending_iterator) |
| 1496 return &active_iterator; |
| 1497 |
| 1498 Tile* active_tile = *active_iterator; |
| 1499 Tile* pending_tile = *pending_iterator; |
| 1500 if (active_tile == pending_tile) |
| 1501 return &active_iterator; |
| 1502 |
| 1503 const TilePriority& active_priority = |
| 1504 active_tile->priority_for_tree_priority(tree_priority); |
| 1505 const TilePriority& pending_priority = |
| 1506 pending_tile->priority_for_tree_priority(tree_priority); |
| 1507 |
| 1508 if (pending_priority.IsHigherPriorityThan(active_priority)) |
| 1509 return &active_iterator; |
| 1510 return &pending_iterator; |
| 1511 } |
| 1512 |
| 1513 TileManager::EvictionTileIterator::EvictionOrderComparator:: |
| 1514 EvictionOrderComparator(TreePriority tree_priority) |
| 1515 : tree_priority_(tree_priority) {} |
| 1516 |
| 1517 bool TileManager::EvictionTileIterator::EvictionOrderComparator::operator()( |
| 1518 PairedPictureLayerIterator* a, |
| 1519 PairedPictureLayerIterator* b) const { |
| 1520 PictureLayerImpl::LayerEvictionTileIterator* a_iterator = |
| 1521 a->NextTileIterator(tree_priority_); |
| 1522 DCHECK(a_iterator); |
| 1523 DCHECK(*a_iterator); |
| 1524 |
| 1525 PictureLayerImpl::LayerEvictionTileIterator* b_iterator = |
| 1526 b->NextTileIterator(tree_priority_); |
| 1527 DCHECK(b_iterator); |
| 1528 DCHECK(*b_iterator); |
| 1529 |
| 1530 Tile* a_tile = **a_iterator; |
| 1531 Tile* b_tile = **b_iterator; |
| 1532 |
| 1533 const TilePriority& a_priority = |
| 1534 a_tile->priority_for_tree_priority(tree_priority_); |
| 1535 const TilePriority& b_priority = |
| 1536 b_tile->priority_for_tree_priority(tree_priority_); |
| 1537 bool prioritize_low_res = tree_priority_ == SMOOTHNESS_TAKES_PRIORITY; |
| 1538 |
| 1539 // Now we have to return true iff b is lower priority than a. |
| 1540 |
| 1541 // If the priority bin differs, b is lower priority if it has the higher |
| 1542 // priority bin. |
| 1543 if (a_priority.priority_bin != b_priority.priority_bin) |
| 1544 return b_priority.priority_bin > a_priority.priority_bin; |
| 1545 |
| 1546 // Otherwise if the resolution differs, then the order will be determined by |
| 1547 // whether we prioritize low res or not. |
| 1548 // TODO(vmpstr): Remove this when TilePriority is no longer a member of Tile |
| 1549 // class but instead produced by the iterators. |
| 1550 if (b_priority.resolution != a_priority.resolution) { |
| 1551 // Non ideal resolution should be sorted higher than other resolutions. |
| 1552 if (a_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1553 return false; |
| 1554 |
| 1555 if (b_priority.resolution == NON_IDEAL_RESOLUTION) |
| 1556 return true; |
| 1557 |
| 1558 if (prioritize_low_res) |
| 1559 return a_priority.resolution == LOW_RESOLUTION; |
| 1560 |
| 1561 return a_priority.resolution == HIGH_RESOLUTION; |
| 1562 } |
| 1563 |
| 1564 // Otherwise if the occlusion differs, b is lower priority if it is occluded. |
| 1565 bool a_is_occluded = a_tile->is_occluded_for_tree_priority(tree_priority_); |
| 1566 bool b_is_occluded = b_tile->is_occluded_for_tree_priority(tree_priority_); |
| 1567 if (a_is_occluded != b_is_occluded) |
| 1568 return b_is_occluded; |
| 1569 |
| 1570 // b is lower priorty if it is farther from visible. |
| 1571 return b_priority.distance_to_visible > a_priority.distance_to_visible; |
| 1572 } |
| 1573 |
1139 void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) { | 1574 void TileManager::SetRasterizerForTesting(Rasterizer* rasterizer) { |
1140 rasterizer_ = rasterizer; | 1575 rasterizer_ = rasterizer; |
1141 rasterizer_->SetClient(this); | 1576 rasterizer_->SetClient(this); |
1142 } | 1577 } |
1143 | 1578 |
1144 bool TileManager::IsReadyToActivate() const { | 1579 bool TileManager::IsReadyToActivate() const { |
1145 const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers(); | 1580 const std::vector<PictureLayerImpl*>& layers = client_->GetPictureLayers(); |
1146 | 1581 |
1147 for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin(); | 1582 for (std::vector<PictureLayerImpl*>::const_iterator it = layers.begin(); |
1148 it != layers.end(); | 1583 it != layers.end(); |
1149 ++it) { | 1584 ++it) { |
1150 if (!(*it)->AllTilesRequiredForActivationAreReadyToDraw()) | 1585 if (!(*it)->AllTilesRequiredForActivationAreReadyToDraw()) |
1151 return false; | 1586 return false; |
1152 } | 1587 } |
1153 | 1588 |
1154 return true; | 1589 return true; |
1155 } | 1590 } |
1156 | 1591 |
1157 void TileManager::CheckIfReadyToActivate() { | 1592 void TileManager::CheckIfReadyToActivate() { |
1158 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); | 1593 TRACE_EVENT0("cc", "TileManager::CheckIfReadyToActivate"); |
1159 | 1594 |
1160 rasterizer_->CheckForCompletedTasks(); | 1595 rasterizer_->CheckForCompletedTasks(); |
1161 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; | 1596 did_check_for_completed_tasks_since_last_schedule_tasks_ = true; |
1162 | 1597 |
1163 if (IsReadyToActivate()) | 1598 if (IsReadyToActivate()) |
1164 client_->NotifyReadyToActivate(); | 1599 client_->NotifyReadyToActivate(); |
1165 } | 1600 } |
1166 | 1601 |
1167 } // namespace cc | 1602 } // namespace cc |
OLD | NEW |