OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_image_layer_impl.h" | 5 #include "cc/layers/picture_image_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/debug/debug_colors.h" | 9 #include "cc/debug/debug_colors.h" |
10 #include "cc/trees/layer_tree_impl.h" | 10 #include "cc/trees/layer_tree_impl.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 SkColor* color, float* width) const { | 51 SkColor* color, float* width) const { |
52 *color = DebugColors::ImageLayerBorderColor(); | 52 *color = DebugColors::ImageLayerBorderColor(); |
53 *width = DebugColors::ImageLayerBorderWidth(layer_tree_impl()); | 53 *width = DebugColors::ImageLayerBorderWidth(layer_tree_impl()); |
54 } | 54 } |
55 | 55 |
56 bool PictureImageLayerImpl::ShouldAdjustRasterScale( | 56 bool PictureImageLayerImpl::ShouldAdjustRasterScale( |
57 bool animating_transform_to_screen) const { | 57 bool animating_transform_to_screen) const { |
58 return false; | 58 return false; |
59 } | 59 } |
60 | 60 |
61 void PictureImageLayerImpl::CalculateRasterContentsScale( | 61 void PictureImageLayerImpl::RecalculateRasterScales( |
62 bool animating_transform_to_screen, | 62 bool animating_transform_to_screen) { |
63 float* raster_contents_scale, | 63 // Defaults from PictureLayerImpl. |
64 float* low_res_raster_contents_scale) const { | 64 PictureLayerImpl::RecalculateRasterScales(animating_transform_to_screen); |
| 65 |
65 // Don't scale images during rastering to ensure image quality, save memory | 66 // Don't scale images during rastering to ensure image quality, save memory |
66 // and avoid frequent re-rastering on change of scale. | 67 // and avoid frequent re-rastering on change of scale. |
67 *raster_contents_scale = std::max(1.f, MinimumContentsScale()); | 68 raster_contents_scale_ = std::max(1.f, MinimumContentsScale()); |
68 // We don't need low res tiles. | 69 // We don't need low res tiles. |
69 *low_res_raster_contents_scale = *raster_contents_scale; | 70 low_res_raster_contents_scale_ = raster_contents_scale_; |
70 } | 71 } |
71 | 72 |
72 } // namespace cc | 73 } // namespace cc |
OLD | NEW |