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/debug/trace_event_argument.h" | 10 #include "base/debug/trace_event_argument.h" |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
860 // active layer is also missing when both this layer and its twin have | 860 // active layer is also missing when both this layer and its twin have |
861 // "simple" sets of tilings: only 2 tilings (high and low) or only 1 high | 861 // "simple" sets of tilings: only 2 tilings (high and low) or only 1 high |
862 // res tiling. This avoids having to iterate/track coverage of non-ideal | 862 // res tiling. This avoids having to iterate/track coverage of non-ideal |
863 // tilings during the last draw call on the active layer. | 863 // tilings during the last draw call on the active layer. |
864 if (tilings_->num_tilings() <= 2 && | 864 if (tilings_->num_tilings() <= 2 && |
865 twin_layer_->tilings_->num_tilings() <= tilings_->num_tilings()) { | 865 twin_layer_->tilings_->num_tilings() <= tilings_->num_tilings()) { |
866 twin_low_res = low_res ? GetTwinTiling(low_res) : NULL; | 866 twin_low_res = low_res ? GetTwinTiling(low_res) : NULL; |
867 twin_high_res = high_res ? GetTwinTiling(high_res) : NULL; | 867 twin_high_res = high_res ? GetTwinTiling(high_res) : NULL; |
868 } | 868 } |
869 | 869 |
870 // When there is a race between activation+drawing and rasterizing, | |
871 // for tiles without twins, we should prevent the active tree from | |
872 // drawing these tiles. | |
873 if (twin_high_res && !twin_high_res->tiles_size()) { | |
874 layer_tree_impl()->SetRequiresHighResToDraw(); | |
sohanjg
2014/09/08 13:45:16
we should SetRequiresHighResToDraw, on the twin la
| |
875 } | |
876 | |
870 // If this layer and its twin have different transforms, then don't compare | 877 // If this layer and its twin have different transforms, then don't compare |
871 // them and only allow activating to high res tiles, since tiles on each | 878 // them and only allow activating to high res tiles, since tiles on each |
872 // layer will be in different places on screen. | 879 // layer will be in different places on screen. |
873 if (twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || | 880 if (twin_layer_->layer_tree_impl()->RequiresHighResToDraw() || |
874 bounds() != twin_layer_->bounds() || | 881 bounds() != twin_layer_->bounds() || |
875 draw_properties().screen_space_transform != | 882 draw_properties().screen_space_transform != |
876 twin_layer_->draw_properties().screen_space_transform) { | 883 twin_layer_->draw_properties().screen_space_transform) { |
877 twin_high_res = NULL; | 884 twin_high_res = NULL; |
878 twin_low_res = NULL; | 885 twin_low_res = NULL; |
879 } | 886 } |
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1751 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); | 1758 PictureLayerTilingSet::TilingRange tiling_range = CurrentTilingRange(); |
1752 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; | 1759 size_t current_tiling_range_offset = current_tiling_ - tiling_range.start; |
1753 return tiling_range.end - 1 - current_tiling_range_offset; | 1760 return tiling_range.end - 1 - current_tiling_range_offset; |
1754 } | 1761 } |
1755 } | 1762 } |
1756 NOTREACHED(); | 1763 NOTREACHED(); |
1757 return 0; | 1764 return 0; |
1758 } | 1765 } |
1759 | 1766 |
1760 } // namespace cc | 1767 } // namespace cc |
OLD | NEW |