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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 } | 1371 } |
1372 | 1372 |
1373 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1373 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1374 return !layer_tree_impl()->IsRecycleTree(); | 1374 return !layer_tree_impl()->IsRecycleTree(); |
1375 } | 1375 } |
1376 | 1376 |
1377 bool PictureLayerImpl::HasValidTilePriorities() const { | 1377 bool PictureLayerImpl::HasValidTilePriorities() const { |
1378 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); | 1378 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); |
1379 } | 1379 } |
1380 | 1380 |
1381 bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { | 1381 bool PictureLayerImpl::AllTilesRequiredAreReadyToDraw( |
1382 if (!layer_tree_impl()->IsPendingTree()) | 1382 TileRequirementCheck is_tile_required_callback) const { |
1383 return true; | |
1384 | |
1385 if (!HasValidTilePriorities()) | 1383 if (!HasValidTilePriorities()) |
1386 return true; | 1384 return true; |
1387 | 1385 |
1388 if (!tilings_) | 1386 if (!tilings_) |
1389 return true; | 1387 return true; |
1390 | 1388 |
1391 if (visible_rect_for_tile_priority_.IsEmpty()) | 1389 if (visible_rect_for_tile_priority_.IsEmpty()) |
1392 return true; | 1390 return true; |
1393 | 1391 |
1394 gfx::Rect rect = GetViewportForTilePriorityInContentSpace(); | 1392 gfx::Rect rect = GetViewportForTilePriorityInContentSpace(); |
(...skipping 11 matching lines...) Expand all Loading... |
1406 // A null tile (i.e. missing recording) can just be skipped. | 1404 // A null tile (i.e. missing recording) can just be skipped. |
1407 // TODO(vmpstr): Verify this is true if we create tiles in raster | 1405 // TODO(vmpstr): Verify this is true if we create tiles in raster |
1408 // iterators. | 1406 // iterators. |
1409 if (!tile) | 1407 if (!tile) |
1410 continue; | 1408 continue; |
1411 | 1409 |
1412 // We can't check tile->required_for_activation, because that value might | 1410 // We can't check tile->required_for_activation, because that value might |
1413 // be out of date. It is updated in the raster/eviction iterators. | 1411 // be out of date. It is updated in the raster/eviction iterators. |
1414 // TODO(vmpstr): Remove the comment once you can't access this information | 1412 // TODO(vmpstr): Remove the comment once you can't access this information |
1415 // from the tile. | 1413 // from the tile. |
1416 if (tiling->IsTileRequiredForActivation(tile) && !tile->IsReadyToDraw()) { | 1414 if ((tiling->*is_tile_required_callback)(tile) && |
1417 TRACE_EVENT_INSTANT0("cc", | 1415 !tile->IsReadyToDraw()) { |
1418 "PictureLayerImpl::" | 1416 TRACE_EVENT_INSTANT0("cc", "Tile required, but not ready to draw.", |
1419 "AllTilesRequiredForActivationAreReadyToDraw not " | |
1420 "ready to activate", | |
1421 TRACE_EVENT_SCOPE_THREAD); | 1417 TRACE_EVENT_SCOPE_THREAD); |
1422 return false; | 1418 return false; |
1423 } | 1419 } |
1424 } | 1420 } |
1425 } | 1421 } |
1426 | 1422 |
1427 return true; | 1423 return true; |
1428 } | 1424 } |
1429 | 1425 |
| 1426 bool PictureLayerImpl::AllTilesRequiredForActivationAreReadyToDraw() const { |
| 1427 if (!layer_tree_impl()->IsPendingTree()) |
| 1428 return true; |
| 1429 |
| 1430 return AllTilesRequiredAreReadyToDraw( |
| 1431 &PictureLayerTiling::IsTileRequiredForActivationIfVisible); |
| 1432 } |
| 1433 |
| 1434 bool PictureLayerImpl::AllTilesRequiredForDrawAreReadyToDraw() const { |
| 1435 if (!layer_tree_impl()->IsActiveTree()) |
| 1436 return true; |
| 1437 |
| 1438 return AllTilesRequiredAreReadyToDraw( |
| 1439 &PictureLayerTiling::IsTileRequiredForDrawIfVisible); |
| 1440 } |
| 1441 |
1430 PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator() | 1442 PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator() |
1431 : layer_(nullptr), current_stage_(arraysize(stages_)) { | 1443 : layer_(nullptr), current_stage_(arraysize(stages_)) { |
1432 } | 1444 } |
1433 | 1445 |
1434 PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator( | 1446 PictureLayerImpl::LayerRasterTileIterator::LayerRasterTileIterator( |
1435 PictureLayerImpl* layer, | 1447 PictureLayerImpl* layer, |
1436 bool prioritize_low_res) | 1448 bool prioritize_low_res) |
1437 : layer_(layer), current_stage_(0) { | 1449 : layer_(layer), current_stage_(0) { |
1438 DCHECK(layer_); | 1450 DCHECK(layer_); |
1439 | 1451 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1705 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1694 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1706 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1695 return tiling_range.end - 1 - current_tiling_range_offset; | 1707 return tiling_range.end - 1 - current_tiling_range_offset; |
1696 } | 1708 } |
1697 } | 1709 } |
1698 NOTREACHED(); | 1710 NOTREACHED(); |
1699 return 0; | 1711 return 0; |
1700 } | 1712 } |
1701 | 1713 |
1702 } // namespace cc | 1714 } // namespace cc |
OLD | NEW |