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

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

Issue 256343002: The snap ratio is wrong (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « AUTHORS ('k') | no next file » | 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 #include <limits> 8 #include <limits>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
1044 // Always match the ideal device scale factor. 1044 // Always match the ideal device scale factor.
1045 if (raster_device_scale_ != ideal_device_scale_) 1045 if (raster_device_scale_ != ideal_device_scale_)
1046 return true; 1046 return true;
1047 1047
1048 return false; 1048 return false;
1049 } 1049 }
1050 1050
1051 float PictureLayerImpl::SnappedContentsScale(float scale) { 1051 float PictureLayerImpl::SnappedContentsScale(float scale) {
1052 // If a tiling exists within the max snapping ratio, snap to its scale. 1052 // If a tiling exists within the max snapping ratio, snap to its scale.
1053 float snapped_contents_scale = scale; 1053 float snapped_contents_scale = scale;
1054 float snapped_ratio = kSnapToExistingTilingRatio; 1054 float snapped_ratio = kMaxScaleRatioDuringPinch;
danakj 2014/04/29 17:30:04 This was purposely written as a separate constant.
1055 for (size_t i = 0; i < tilings_->num_tilings(); ++i) { 1055 for (size_t i = 0; i < tilings_->num_tilings(); ++i) {
1056 float tiling_contents_scale = tilings_->tiling_at(i)->contents_scale(); 1056 float tiling_contents_scale = tilings_->tiling_at(i)->contents_scale();
1057 float ratio = PositiveRatio(tiling_contents_scale, scale); 1057 float ratio = PositiveRatio(tiling_contents_scale, scale);
1058 if (ratio < snapped_ratio) { 1058 if (ratio < snapped_ratio) {
1059 snapped_contents_scale = tiling_contents_scale; 1059 snapped_contents_scale = tiling_contents_scale;
1060 snapped_ratio = ratio; 1060 snapped_ratio = ratio;
1061 } 1061 }
1062 } 1062 }
1063 return snapped_contents_scale; 1063 return snapped_contents_scale;
1064 } 1064 }
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 return iterator_index_ < iterators_.size(); 1517 return iterator_index_ < iterators_.size();
1518 } 1518 }
1519 1519
1520 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType( 1520 bool PictureLayerImpl::LayerEvictionTileIterator::IsCorrectType(
1521 PictureLayerTiling::TilingEvictionTileIterator* it) const { 1521 PictureLayerTiling::TilingEvictionTileIterator* it) const {
1522 return it->get_type() == iteration_stage_ && 1522 return it->get_type() == iteration_stage_ &&
1523 (**it)->required_for_activation() == required_for_activation_; 1523 (**it)->required_for_activation() == required_for_activation_;
1524 } 1524 }
1525 1525
1526 } // namespace cc 1526 } // namespace cc
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698