| 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/contents_scaling_layer.h" | 5 #include "cc/contents_scaling_layer.h" |
| 6 #include "ui/gfx/size_conversions.h" | 6 #include "ui/gfx/size_conversions.h" |
| 7 | 7 |
| 8 namespace cc { | 8 namespace cc { |
| 9 | 9 |
| 10 gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float
scaleY) const { | 10 gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float
scaleY) const { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 | 34 |
| 35 void ContentsScalingLayer::didUpdateBounds() { | 35 void ContentsScalingLayer::didUpdateBounds() { |
| 36 drawProperties().content_bounds = computeContentBoundsForScale( | 36 drawProperties().content_bounds = computeContentBoundsForScale( |
| 37 contentsScaleX(), | 37 contentsScaleX(), |
| 38 contentsScaleY()); | 38 contentsScaleY()); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ContentsScalingLayer::update( | 41 void ContentsScalingLayer::update( |
| 42 ResourceUpdateQueue& queue, | 42 ResourceUpdateQueue& queue, |
| 43 const OcclusionTracker* occlusion, | 43 const OcclusionTracker* occlusion, |
| 44 RenderingStats& stats) { | 44 RenderingStats* stats) { |
| 45 if (drawProperties().contents_scale_x == last_update_contents_scale_x_ && | 45 if (drawProperties().contents_scale_x == last_update_contents_scale_x_ && |
| 46 drawProperties().contents_scale_y == last_update_contents_scale_y_) | 46 drawProperties().contents_scale_y == last_update_contents_scale_y_) |
| 47 return; | 47 return; |
| 48 | 48 |
| 49 last_update_contents_scale_x_ = drawProperties().contents_scale_x; | 49 last_update_contents_scale_x_ = drawProperties().contents_scale_x; |
| 50 last_update_contents_scale_y_ = drawProperties().contents_scale_y; | 50 last_update_contents_scale_y_ = drawProperties().contents_scale_y; |
| 51 // Invalidate the whole layer if scale changed. | 51 // Invalidate the whole layer if scale changed. |
| 52 setNeedsDisplayRect(gfx::Rect(bounds())); | 52 setNeedsDisplayRect(gfx::Rect(bounds())); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace cc | 55 } // namespace cc |
| OLD | NEW |