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 | 8 |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 int max_size = layer_tree_impl()->MaxTextureSize(); | 486 int max_size = layer_tree_impl()->MaxTextureSize(); |
487 return gfx::Size( | 487 return gfx::Size( |
488 std::min(max_size, content_bounds.width()), | 488 std::min(max_size, content_bounds.width()), |
489 std::min(max_size, content_bounds.height())); | 489 std::min(max_size, content_bounds.height())); |
490 } | 490 } |
491 | 491 |
492 int max_texture_size = | 492 int max_texture_size = |
493 layer_tree_impl()->resource_provider()->max_texture_size(); | 493 layer_tree_impl()->resource_provider()->max_texture_size(); |
494 | 494 |
495 gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size; | 495 gfx::Size default_tile_size = layer_tree_impl()->settings().default_tile_size; |
496 default_tile_size.ClampToMax(gfx::Size(max_texture_size, max_texture_size)); | 496 default_tile_size.SetToMin(gfx::Size(max_texture_size, max_texture_size)); |
497 | 497 |
498 gfx::Size max_untiled_content_size = | 498 gfx::Size max_untiled_content_size = |
499 layer_tree_impl()->settings().max_untiled_layer_size; | 499 layer_tree_impl()->settings().max_untiled_layer_size; |
500 max_untiled_content_size.ClampToMax( | 500 max_untiled_content_size.SetToMin( |
501 gfx::Size(max_texture_size, max_texture_size)); | 501 gfx::Size(max_texture_size, max_texture_size)); |
502 | 502 |
503 bool any_dimension_too_large = | 503 bool any_dimension_too_large = |
504 content_bounds.width() > max_untiled_content_size.width() || | 504 content_bounds.width() > max_untiled_content_size.width() || |
505 content_bounds.height() > max_untiled_content_size.height(); | 505 content_bounds.height() > max_untiled_content_size.height(); |
506 | 506 |
507 bool any_dimension_one_tile = | 507 bool any_dimension_one_tile = |
508 content_bounds.width() <= default_tile_size.width() || | 508 content_bounds.width() <= default_tile_size.width() || |
509 content_bounds.height() <= default_tile_size.height(); | 509 content_bounds.height() <= default_tile_size.height(); |
510 | 510 |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 state->Set("tilings", tilings_->AsValue().release()); | 1014 state->Set("tilings", tilings_->AsValue().release()); |
1015 state->Set("pictures", pile_->AsValue().release()); | 1015 state->Set("pictures", pile_->AsValue().release()); |
1016 state->Set("invalidation", invalidation_.AsValue().release()); | 1016 state->Set("invalidation", invalidation_.AsValue().release()); |
1017 } | 1017 } |
1018 | 1018 |
1019 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { | 1019 size_t PictureLayerImpl::GPUMemoryUsageInBytes() const { |
1020 return tilings_->GPUMemoryUsageInBytes(); | 1020 return tilings_->GPUMemoryUsageInBytes(); |
1021 } | 1021 } |
1022 | 1022 |
1023 } // namespace cc | 1023 } // namespace cc |
OLD | NEW |