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/contents_scaling_layer.h" | 5 #include "cc/layers/contents_scaling_layer.h" |
6 #include "ui/gfx/size_conversions.h" | 6 #include "ui/gfx/geometry/size_conversions.h" |
7 | 7 |
8 namespace cc { | 8 namespace cc { |
9 | 9 |
10 gfx::Size ContentsScalingLayer::ComputeContentBoundsForScale( | 10 gfx::Size ContentsScalingLayer::ComputeContentBoundsForScale( |
11 float scale_x, | 11 float scale_x, |
12 float scale_y) const { | 12 float scale_y) const { |
13 return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale_x, scale_y)); | 13 return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale_x, scale_y)); |
14 } | 14 } |
15 | 15 |
16 ContentsScalingLayer::ContentsScalingLayer() | 16 ContentsScalingLayer::ContentsScalingLayer() |
(...skipping 24 matching lines...) Expand all Loading... |
41 return updated; | 41 return updated; |
42 | 42 |
43 last_update_contents_scale_x_ = draw_properties().contents_scale_x; | 43 last_update_contents_scale_x_ = draw_properties().contents_scale_x; |
44 last_update_contents_scale_y_ = draw_properties().contents_scale_y; | 44 last_update_contents_scale_y_ = draw_properties().contents_scale_y; |
45 // Invalidate the whole layer if scale changed. | 45 // Invalidate the whole layer if scale changed. |
46 SetNeedsDisplayRect(gfx::Rect(paint_properties().bounds)); | 46 SetNeedsDisplayRect(gfx::Rect(paint_properties().bounds)); |
47 return updated; | 47 return updated; |
48 } | 48 } |
49 | 49 |
50 } // namespace cc | 50 } // namespace cc |
OLD | NEW |