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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 // tilings during the last draw call on the active layer. | 874 // tilings during the last draw call on the active layer. |
875 if (tilings_->num_tilings() <= 2 && | 875 if (tilings_->num_tilings() <= 2 && |
876 twin_layer_->tilings_->num_tilings() <= tilings_->num_tilings()) { | 876 twin_layer_->tilings_->num_tilings() <= tilings_->num_tilings()) { |
877 twin_low_res = low_res ? GetTwinTiling(low_res) : NULL; | 877 twin_low_res = low_res ? GetTwinTiling(low_res) : NULL; |
878 twin_high_res = high_res ? GetTwinTiling(high_res) : NULL; | 878 twin_high_res = high_res ? GetTwinTiling(high_res) : NULL; |
879 } | 879 } |
880 | 880 |
881 // If this layer and its twin have different transforms, then don't compare | 881 // If this layer and its twin have different transforms, then don't compare |
882 // them and only allow activating to high res tiles, since tiles on each | 882 // them and only allow activating to high res tiles, since tiles on each |
883 // layer will be in different places on screen. | 883 // layer will be in different places on screen. |
884 if (twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || | 884 if (layer_tree_impl()->RequiresHighResToDraw() || |
885 bounds() != twin_layer_->bounds() || | 885 bounds() != twin_layer_->bounds() || |
886 draw_properties().screen_space_transform != | 886 draw_properties().screen_space_transform != |
887 twin_layer_->draw_properties().screen_space_transform) { | 887 twin_layer_->draw_properties().screen_space_transform) { |
888 twin_high_res = NULL; | 888 twin_high_res = NULL; |
889 twin_low_res = NULL; | 889 twin_low_res = NULL; |
890 } | 890 } |
891 } | 891 } |
892 | 892 |
893 // As a second pass, mark as required any visible high res tiles not filled in | 893 // As a second pass, mark as required any visible high res tiles not filled in |
894 // by acceptable non-ideal tiles from the first pass. | 894 // by acceptable non-ideal tiles from the first pass. |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1783 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1784 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1784 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1785 return tiling_range.end - 1 - current_tiling_range_offset; | 1785 return tiling_range.end - 1 - current_tiling_range_offset; |
1786 } | 1786 } |
1787 } | 1787 } |
1788 NOTREACHED(); | 1788 NOTREACHED(); |
1789 return 0; | 1789 return 0; |
1790 } | 1790 } |
1791 | 1791 |
1792 } // namespace cc | 1792 } // namespace cc |
OLD | NEW |