Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(540)

Side by Side Diff: cc/layers/picture_layer_impl.cc

Issue 14367021: Rename ClampToMin and ClampToMax (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/scrollbar_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/layer_impl.cc ('k') | cc/layers/scrollbar_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698