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 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 // The analysis step is however expensive and is not justified when doing | 1131 // The analysis step is however expensive and is not justified when doing |
1132 // gpu rasterization where there is no upload. | 1132 // gpu rasterization where there is no upload. |
1133 // | 1133 // |
1134 // Additionally, we do not want to do the analysis if the layer that produced | 1134 // Additionally, we do not want to do the analysis if the layer that produced |
1135 // this tile is narrow, since more likely than not the tile would not be | 1135 // this tile is narrow, since more likely than not the tile would not be |
1136 // solid. We use the picture pile size as a proxy for layer size, since it | 1136 // solid. We use the picture pile size as a proxy for layer size, since it |
1137 // represents the recorded (and thus rasterizable) content. | 1137 // represents the recorded (and thus rasterizable) content. |
1138 // Note that this last optimization is a heuristic that ensures that we don't | 1138 // Note that this last optimization is a heuristic that ensures that we don't |
1139 // spend too much time analyzing tiles on a multitude of small layers, as it | 1139 // spend too much time analyzing tiles on a multitude of small layers, as it |
1140 // is likely that these layers have some non-solid content. | 1140 // is likely that these layers have some non-solid content. |
1141 gfx::Size pile_size = tile->picture_pile()->size(); | 1141 gfx::Size pile_size = tile->picture_pile()->tiling_rect().size(); |
1142 bool analyze_picture = !tile->use_gpu_rasterization() && | 1142 bool analyze_picture = !tile->use_gpu_rasterization() && |
1143 std::min(pile_size.width(), pile_size.height()) >= | 1143 std::min(pile_size.width(), pile_size.height()) >= |
1144 kMinDimensionsForAnalysis; | 1144 kMinDimensionsForAnalysis; |
1145 | 1145 |
1146 return make_scoped_refptr( | 1146 return make_scoped_refptr( |
1147 new RasterTaskImpl(const_resource, | 1147 new RasterTaskImpl(const_resource, |
1148 tile->picture_pile(), | 1148 tile->picture_pile(), |
1149 tile->content_rect(), | 1149 tile->content_rect(), |
1150 tile->contents_scale(), | 1150 tile->contents_scale(), |
1151 mts.raster_mode, | 1151 mts.raster_mode, |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 | 1648 |
1649 if (b_priority.resolution != a_priority.resolution) { | 1649 if (b_priority.resolution != a_priority.resolution) { |
1650 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || | 1650 return (prioritize_low_res && b_priority.resolution == LOW_RESOLUTION) || |
1651 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || | 1651 (!prioritize_low_res && b_priority.resolution == HIGH_RESOLUTION) || |
1652 (a_priority.resolution == NON_IDEAL_RESOLUTION); | 1652 (a_priority.resolution == NON_IDEAL_RESOLUTION); |
1653 } | 1653 } |
1654 return a_priority.IsHigherPriorityThan(b_priority); | 1654 return a_priority.IsHigherPriorityThan(b_priority); |
1655 } | 1655 } |
1656 | 1656 |
1657 } // namespace cc | 1657 } // namespace cc |
OLD | NEW |