| 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/painted_scrollbar_layer.h" | 5 #include "cc/layers/painted_scrollbar_layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 UpdateProperty(0, &thumb_length_); | 183 UpdateProperty(0, &thumb_length_); |
| 184 } | 184 } |
| 185 } | 185 } |
| 186 | 186 |
| 187 void PaintedScrollbarLayer::UpdateInternalContentScale() { | 187 void PaintedScrollbarLayer::UpdateInternalContentScale() { |
| 188 float scale = layer_tree_host()->device_scale_factor(); | 188 float scale = layer_tree_host()->device_scale_factor(); |
| 189 if (layer_tree_host() | 189 if (layer_tree_host() |
| 190 ->settings() | 190 ->settings() |
| 191 .layer_transforms_should_scale_layer_contents) { | 191 .layer_transforms_should_scale_layer_contents) { |
| 192 gfx::Transform transform; | 192 gfx::Transform transform; |
| 193 transform = draw_property_utils::DrawTransform( | 193 transform = draw_property_utils::ScreenSpaceTransform( |
| 194 this, layer_tree_host()->property_trees()->transform_tree); | 194 this, layer_tree_host()->property_trees()->transform_tree); |
| 195 | 195 |
| 196 gfx::Vector2dF transform_scales = | 196 gfx::Vector2dF transform_scales = |
| 197 MathUtil::ComputeTransform2dScaleComponents(transform, scale); | 197 MathUtil::ComputeTransform2dScaleComponents(transform, scale); |
| 198 scale = std::max(transform_scales.x(), transform_scales.y()); | 198 scale = std::max(transform_scales.x(), transform_scales.y()); |
| 199 } | 199 } |
| 200 bool changed = false; | 200 bool changed = false; |
| 201 changed |= UpdateProperty(ClampScaleToMaxTextureSize(scale), | 201 changed |= UpdateProperty(ClampScaleToMaxTextureSize(scale), |
| 202 &internal_contents_scale_); | 202 &internal_contents_scale_); |
| 203 changed |= | 203 changed |= |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 301 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
| 302 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 302 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
| 303 // allocation and copying. | 303 // allocation and copying. |
| 304 skbitmap.setImmutable(); | 304 skbitmap.setImmutable(); |
| 305 | 305 |
| 306 return UIResourceBitmap(skbitmap); | 306 return UIResourceBitmap(skbitmap); |
| 307 } | 307 } |
| 308 | 308 |
| 309 } // namespace cc | 309 } // namespace cc |
| OLD | NEW |