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

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

Issue 1321503002: cc: Do not create separate tilings for almost equal scale factors. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unrelated changes. Created 5 years, 2 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
« cc/base/math_util.cc ('K') | « cc/base/math_util_unittest.cc ('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 <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 } 935 }
936 936
937 void PictureLayerImpl::RecalculateRasterScales() { 937 void PictureLayerImpl::RecalculateRasterScales() {
938 float old_raster_contents_scale = raster_contents_scale_; 938 float old_raster_contents_scale = raster_contents_scale_;
939 float old_raster_page_scale = raster_page_scale_; 939 float old_raster_page_scale = raster_page_scale_;
940 float old_raster_source_scale = raster_source_scale_; 940 float old_raster_source_scale = raster_source_scale_;
941 941
942 raster_device_scale_ = ideal_device_scale_; 942 raster_device_scale_ = ideal_device_scale_;
943 raster_page_scale_ = ideal_page_scale_; 943 raster_page_scale_ = ideal_page_scale_;
944 raster_source_scale_ = ideal_source_scale_; 944 raster_source_scale_ = ideal_source_scale_;
945 raster_contents_scale_ = ideal_contents_scale_; 945 // Get fixed precision values to avoid creating extra tilings for scales
946 // which are almost equal.
947 raster_contents_scale_ =
948 MathUtil::RoundToFixedPrecision(ideal_contents_scale_);
946 949
947 // If we're not animating, or leaving an animation, and the 950 // If we're not animating, or leaving an animation, and the
948 // ideal_source_scale_ changes, then things are unpredictable, and we fix 951 // ideal_source_scale_ changes, then things are unpredictable, and we fix
949 // the raster_source_scale_ in place. 952 // the raster_source_scale_ in place.
950 if (old_raster_source_scale && 953 if (old_raster_source_scale &&
951 !draw_properties().screen_space_transform_is_animating && 954 !draw_properties().screen_space_transform_is_animating &&
952 !was_screen_space_transform_animating_ && 955 !was_screen_space_transform_animating_ &&
953 old_raster_source_scale != ideal_source_scale_) 956 old_raster_source_scale != ideal_source_scale_)
954 raster_source_scale_is_fixed_ = true; 957 raster_source_scale_is_fixed_ = true;
955 958
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 1266
1264 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1267 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1265 return !layer_tree_impl()->IsRecycleTree(); 1268 return !layer_tree_impl()->IsRecycleTree();
1266 } 1269 }
1267 1270
1268 bool PictureLayerImpl::HasValidTilePriorities() const { 1271 bool PictureLayerImpl::HasValidTilePriorities() const {
1269 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1272 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1270 } 1273 }
1271 1274
1272 } // namespace cc 1275 } // namespace cc
OLDNEW
« cc/base/math_util.cc ('K') | « cc/base/math_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698