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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 divisor = 2; | 760 divisor = 2; |
761 if (content_bounds.width() <= viewport_width / 4) | 761 if (content_bounds.width() <= viewport_width / 4) |
762 divisor = 1; | 762 divisor = 1; |
763 default_tile_height = | 763 default_tile_height = |
764 MathUtil::UncheckedRoundUp(viewport_height, divisor) / divisor; | 764 MathUtil::UncheckedRoundUp(viewport_height, divisor) / divisor; |
765 | 765 |
766 // Grow default sizes to account for overlapping border texels. | 766 // Grow default sizes to account for overlapping border texels. |
767 default_tile_width += 2 * PictureLayerTiling::kBorderTexels; | 767 default_tile_width += 2 * PictureLayerTiling::kBorderTexels; |
768 default_tile_height += 2 * PictureLayerTiling::kBorderTexels; | 768 default_tile_height += 2 * PictureLayerTiling::kBorderTexels; |
769 | 769 |
770 // Round GPU default tile sizes to a multiple of kTileRoundUp. This | |
771 // helps prevent rounding errors in our CA path. crbug.com/632274 | |
772 default_tile_width = | |
773 MathUtil::UncheckedRoundUp(default_tile_width, kTileRoundUp); | |
774 default_tile_height = | |
775 MathUtil::UncheckedRoundUp(default_tile_height, kTileRoundUp); | |
776 | |
777 default_tile_height = | 770 default_tile_height = |
778 std::max(default_tile_height, kMinHeightForGpuRasteredTile); | 771 std::max(default_tile_height, kMinHeightForGpuRasteredTile); |
779 } else { | 772 } else { |
780 // For CPU rasterization we use tile-size settings. | 773 // For CPU rasterization we use tile-size settings. |
781 const LayerTreeSettings& settings = layer_tree_impl()->settings(); | 774 const LayerTreeSettings& settings = layer_tree_impl()->settings(); |
782 int max_untiled_content_width = settings.max_untiled_layer_size.width(); | 775 int max_untiled_content_width = settings.max_untiled_layer_size.width(); |
783 int max_untiled_content_height = settings.max_untiled_layer_size.height(); | 776 int max_untiled_content_height = settings.max_untiled_layer_size.height(); |
784 default_tile_width = settings.default_tile_size.width(); | 777 default_tile_width = settings.default_tile_size.width(); |
785 default_tile_height = settings.default_tile_size.height(); | 778 default_tile_height = settings.default_tile_size.height(); |
786 | 779 |
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { | 1336 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { |
1344 return !layer_tree_impl()->IsRecycleTree(); | 1337 return !layer_tree_impl()->IsRecycleTree(); |
1345 } | 1338 } |
1346 | 1339 |
1347 bool PictureLayerImpl::HasValidTilePriorities() const { | 1340 bool PictureLayerImpl::HasValidTilePriorities() const { |
1348 return IsOnActiveOrPendingTree() && | 1341 return IsOnActiveOrPendingTree() && |
1349 is_drawn_render_surface_layer_list_member(); | 1342 is_drawn_render_surface_layer_list_member(); |
1350 } | 1343 } |
1351 | 1344 |
1352 } // namespace cc | 1345 } // namespace cc |
OLD | NEW |