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 #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 Loading... |
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 Loading... |
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 |
OLD | NEW |