| 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 15 matching lines...) Expand all Loading... |
| 26 LayerTreeImpl* tree_impl) { | 26 LayerTreeImpl* tree_impl) { |
| 27 return PictureImageLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); | 27 return PictureImageLayerImpl::Create(tree_impl, id()).PassAs<LayerImpl>(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void PictureImageLayerImpl::GetDebugBorderProperties( | 30 void PictureImageLayerImpl::GetDebugBorderProperties( |
| 31 SkColor* color, float* width) const { | 31 SkColor* color, float* width) const { |
| 32 *color = DebugColors::ImageLayerBorderColor(); | 32 *color = DebugColors::ImageLayerBorderColor(); |
| 33 *width = DebugColors::ImageLayerBorderWidth(layer_tree_impl()); | 33 *width = DebugColors::ImageLayerBorderWidth(layer_tree_impl()); |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool PictureImageLayerImpl::ShouldAdjustRasterScale( | 36 bool PictureImageLayerImpl::ShouldAdjustRasterScale() const { |
| 37 bool animating_transform_to_screen) const { | |
| 38 return false; | 37 return false; |
| 39 } | 38 } |
| 40 | 39 |
| 41 void PictureImageLayerImpl::RecalculateRasterScales( | 40 void PictureImageLayerImpl::RecalculateRasterScales() { |
| 42 bool animating_transform_to_screen, | |
| 43 float maximum_animation_contents_scale) { | |
| 44 // Defaults from PictureLayerImpl. | |
| 45 PictureLayerImpl::RecalculateRasterScales(animating_transform_to_screen, | |
| 46 maximum_animation_contents_scale); | |
| 47 | |
| 48 // Don't scale images during rastering to ensure image quality, save memory | 41 // Don't scale images during rastering to ensure image quality, save memory |
| 49 // and avoid frequent re-rastering on change of scale. | 42 // and avoid frequent re-rastering on change of scale. |
| 50 raster_contents_scale_ = std::max(1.f, MinimumContentsScale()); | 43 raster_page_scale_ = 1.f; |
| 44 raster_device_scale_ = 1.f; |
| 45 raster_source_scale_ = std::max(1.f, MinimumContentsScale()); |
| 46 raster_contents_scale_ = raster_source_scale_; |
| 51 // We don't need low res tiles. | 47 // We don't need low res tiles. |
| 52 low_res_raster_contents_scale_ = raster_contents_scale_; | 48 low_res_raster_contents_scale_ = raster_contents_scale_; |
| 53 } | 49 } |
| 54 | 50 |
| 55 void PictureImageLayerImpl::UpdateIdealScales() { | 51 void PictureImageLayerImpl::UpdateIdealScales() { |
| 56 ideal_contents_scale_ = 1.f; | 52 ideal_contents_scale_ = 1.f; |
| 57 ideal_page_scale_ = 1.f; | 53 ideal_page_scale_ = 1.f; |
| 58 ideal_device_scale_ = 1.f; | 54 ideal_device_scale_ = 1.f; |
| 59 ideal_source_scale_ = 1.f; | 55 ideal_source_scale_ = 1.f; |
| 60 } | 56 } |
| 61 | 57 |
| 62 } // namespace cc | 58 } // namespace cc |
| OLD | NEW |