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 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 | 669 |
670 SanityCheckTilingState(); | 670 SanityCheckTilingState(); |
671 } | 671 } |
672 | 672 |
673 void PictureLayerImpl::SyncTiling( | 673 void PictureLayerImpl::SyncTiling( |
674 const PictureLayerTiling* tiling) { | 674 const PictureLayerTiling* tiling) { |
675 if (!CanHaveTilingWithScale(tiling->contents_scale())) | 675 if (!CanHaveTilingWithScale(tiling->contents_scale())) |
676 return; | 676 return; |
677 tilings_->AddTiling(tiling->contents_scale()); | 677 tilings_->AddTiling(tiling->contents_scale()); |
678 | 678 |
679 if (!layer_tree_impl()->needs_update_draw_properties()) { | 679 // If this tree needs update draw properties, then the tiling will |
| 680 // get updated prior to drawing or activation. If this tree does not |
| 681 // need update draw properties, then its transforms are up to date and |
| 682 // we can create tiles for this tiling immediately. |
| 683 if (!layer_tree_impl()->needs_update_draw_properties() && |
| 684 should_update_tile_priorities_) { |
680 // When the tree is up to date, the set of tilings must either be empty or | 685 // When the tree is up to date, the set of tilings must either be empty or |
681 // contain at least one high resolution tiling. (If it is up to date, | 686 // contain at least one high resolution tiling. (If it is up to date, |
682 // then it would be invalid to sync a tiling if it is the first tiling | 687 // then it would be invalid to sync a tiling if it is the first tiling |
683 // on the layer, since there would be no high resolution tiling.) | 688 // on the layer, since there would be no high resolution tiling.) |
684 SanityCheckTilingState(); | 689 SanityCheckTilingState(); |
685 // TODO(enne): temporary sanity CHECK for http://crbug.com/358350 | 690 // TODO(enne): temporary sanity CHECK for http://crbug.com/358350 |
686 CHECK_GT(tilings_->num_tilings(), 1u); | 691 CHECK_GT(tilings_->num_tilings(), 1u); |
| 692 |
| 693 UpdateTilePriorities(); |
687 } | 694 } |
688 | |
689 // If this tree needs update draw properties, then the tiling will | |
690 // get updated prior to drawing or activation. If this tree does not | |
691 // need update draw properties, then its transforms are up to date and | |
692 // we can create tiles for this tiling immediately. | |
693 if (!layer_tree_impl()->needs_update_draw_properties() && | |
694 should_update_tile_priorities_) | |
695 UpdateTilePriorities(); | |
696 } | 695 } |
697 | 696 |
698 void PictureLayerImpl::SetIsMask(bool is_mask) { | 697 void PictureLayerImpl::SetIsMask(bool is_mask) { |
699 if (is_mask_ == is_mask) | 698 if (is_mask_ == is_mask) |
700 return; | 699 return; |
701 is_mask_ = is_mask; | 700 is_mask_ = is_mask; |
702 if (tilings_) | 701 if (tilings_) |
703 tilings_->RemoveAllTiles(); | 702 tilings_->RemoveAllTiles(); |
704 } | 703 } |
705 | 704 |
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 return iterator_index_ < iterators_.size(); | 1516 return iterator_index_ < iterators_.size(); |
1518 } | 1517 } |
1519 | 1518 |
1520 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( | 1519 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( |
1521 PictureLayerTiling::TilingEvictionTileIterator* it) const { | 1520 PictureLayerTiling::TilingEvictionTileIterator* it) const { |
1522 return it->get_type() == iteration_stage_ && | 1521 return it->get_type() == iteration_stage_ && |
1523 (**it)->required_for_activation() == required_for_activation_; | 1522 (**it)->required_for_activation() == required_for_activation_; |
1524 } | 1523 } |
1525 | 1524 |
1526 } // namespace cc | 1525 } // namespace cc |
OLD | NEW |