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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/layers/painted_scrollbar_layer_impl.h" | 10 #include "cc/layers/painted_scrollbar_layer_impl.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 else | 93 else |
94 return (MaxTextureSize() - 1) / static_cast<float>(bounds().height()); | 94 return (MaxTextureSize() - 1) / static_cast<float>(bounds().height()); |
95 } | 95 } |
96 return scale; | 96 return scale; |
97 } | 97 } |
98 | 98 |
99 void PaintedScrollbarLayer::CalculateContentsScale( | 99 void PaintedScrollbarLayer::CalculateContentsScale( |
100 float ideal_contents_scale, | 100 float ideal_contents_scale, |
101 float device_scale_factor, | 101 float device_scale_factor, |
102 float page_scale_factor, | 102 float page_scale_factor, |
| 103 float maximum_animation_contents_scale, |
103 bool animating_transform_to_screen, | 104 bool animating_transform_to_screen, |
104 float* contents_scale_x, | 105 float* contents_scale_x, |
105 float* contents_scale_y, | 106 float* contents_scale_y, |
106 gfx::Size* content_bounds) { | 107 gfx::Size* content_bounds) { |
107 ContentsScalingLayer::CalculateContentsScale( | 108 ContentsScalingLayer::CalculateContentsScale( |
108 ClampScaleToMaxTextureSize(ideal_contents_scale), | 109 ClampScaleToMaxTextureSize(ideal_contents_scale), |
109 device_scale_factor, | 110 device_scale_factor, |
110 page_scale_factor, | 111 page_scale_factor, |
| 112 maximum_animation_contents_scale, |
111 animating_transform_to_screen, | 113 animating_transform_to_screen, |
112 contents_scale_x, | 114 contents_scale_x, |
113 contents_scale_y, | 115 contents_scale_y, |
114 content_bounds); | 116 content_bounds); |
115 } | 117 } |
116 | 118 |
117 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { | 119 void PaintedScrollbarLayer::PushPropertiesTo(LayerImpl* layer) { |
118 ContentsScalingLayer::PushPropertiesTo(layer); | 120 ContentsScalingLayer::PushPropertiesTo(layer); |
119 | 121 |
120 PushScrollClipPropertiesTo(layer); | 122 PushScrollClipPropertiesTo(layer); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 271 |
270 scrollbar_->PaintPart(&skcanvas, part, layer_rect); | 272 scrollbar_->PaintPart(&skcanvas, part, layer_rect); |
271 // Make sure that the pixels are no longer mutable to unavoid unnecessary | 273 // Make sure that the pixels are no longer mutable to unavoid unnecessary |
272 // allocation and copying. | 274 // allocation and copying. |
273 skbitmap.setImmutable(); | 275 skbitmap.setImmutable(); |
274 | 276 |
275 return UIResourceBitmap(skbitmap); | 277 return UIResourceBitmap(skbitmap); |
276 } | 278 } |
277 | 279 |
278 } // namespace cc | 280 } // namespace cc |
OLD | NEW |