| 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 <vector> | 5 #include <vector> |
| 6 #include "cc/layers/picture_image_layer.h" | 6 #include "cc/layers/picture_image_layer.h" |
| 7 #include "cc/test/geometry_test_utils.h" | 7 #include "cc/test/geometry_test_utils.h" |
| 8 #include "cc/trees/layer_tree_host_common.h" | 8 #include "cc/trees/layer_tree_host_common.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 10 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 normal_layer->setAnchorPoint(anchor_point); | 124 normal_layer->setAnchorPoint(anchor_point); |
| 125 normal_layer->setTransform(transform.matrix()); | 125 normal_layer->setTransform(transform.matrix()); |
| 126 normal_layer->setSublayerTransform(sublayer_transform.matrix()); | 126 normal_layer->setSublayerTransform(sublayer_transform.matrix()); |
| 127 normal_layer->setPosition(position); | 127 normal_layer->setPosition(position); |
| 128 root_layer->addChild(normal_layer); | 128 root_layer->addChild(normal_layer); |
| 129 | 129 |
| 130 std::vector<scoped_refptr<cc::Layer> > render_surface_layer_list; | 130 std::vector<scoped_refptr<cc::Layer> > render_surface_layer_list; |
| 131 cc::LayerTreeHostCommon::CalculateDrawProperties( | 131 cc::LayerTreeHostCommon::CalculateDrawProperties( |
| 132 root_layer->layer(), | 132 root_layer->layer(), |
| 133 kDeviceViewportSize, | 133 kDeviceViewportSize, |
| 134 gfx::Transform(), |
| 134 kDeviceScaleFactor, | 135 kDeviceScaleFactor, |
| 135 kPageScaleFactor, | 136 kPageScaleFactor, |
| 136 root_layer->layer(), | 137 root_layer->layer(), |
| 137 kMaxTextureSize, | 138 kMaxTextureSize, |
| 138 false, // can_use_lcd_text | 139 false, // can_use_lcd_text |
| 139 false, // can_adjust_raster_scales | 140 false, // can_adjust_raster_scales |
| 140 &render_surface_layer_list); | 141 &render_surface_layer_list); |
| 141 ExpectEqualLayerRectsInTarget(normal_layer->layer(), | 142 ExpectEqualLayerRectsInTarget(normal_layer->layer(), |
| 142 fixed_bounds_layer->layer()); | 143 fixed_bounds_layer->layer()); |
| 143 ExpectEqualLayerRectsInTarget(sublayer_under_normal_layer->layer(), | 144 ExpectEqualLayerRectsInTarget(sublayer_under_normal_layer->layer(), |
| 144 sublayer_under_fixed_bounds_layer->layer()); | 145 sublayer_under_fixed_bounds_layer->layer()); |
| 145 | 146 |
| 146 // Change of fixed bounds should not affect the target geometries. | 147 // Change of fixed bounds should not affect the target geometries. |
| 147 fixed_bounds_layer->SetFixedBounds(gfx::Size(fixed_bounds.width() / 2, | 148 fixed_bounds_layer->SetFixedBounds(gfx::Size(fixed_bounds.width() / 2, |
| 148 fixed_bounds.height() * 2)); | 149 fixed_bounds.height() * 2)); |
| 149 cc::LayerTreeHostCommon::CalculateDrawProperties( | 150 cc::LayerTreeHostCommon::CalculateDrawProperties( |
| 150 root_layer->layer(), | 151 root_layer->layer(), |
| 151 kDeviceViewportSize, | 152 kDeviceViewportSize, |
| 153 gfx::Transform(), |
| 152 kDeviceScaleFactor, | 154 kDeviceScaleFactor, |
| 153 kPageScaleFactor, | 155 kPageScaleFactor, |
| 154 root_layer->layer(), | 156 root_layer->layer(), |
| 155 kMaxTextureSize, | 157 kMaxTextureSize, |
| 156 false, // can_use_lcd_text | 158 false, // can_use_lcd_text |
| 157 false, // can_adjust_raster_scales | 159 false, // can_adjust_raster_scales |
| 158 &render_surface_layer_list); | 160 &render_surface_layer_list); |
| 159 ExpectEqualLayerRectsInTarget(normal_layer->layer(), | 161 ExpectEqualLayerRectsInTarget(normal_layer->layer(), |
| 160 fixed_bounds_layer->layer()); | 162 fixed_bounds_layer->layer()); |
| 161 ExpectEqualLayerRectsInTarget(sublayer_under_normal_layer->layer(), | 163 ExpectEqualLayerRectsInTarget(sublayer_under_normal_layer->layer(), |
| (...skipping 29 matching lines...) Expand all Loading... |
| 191 | 193 |
| 192 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to | 194 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to |
| 193 // WebLayerImpl. | 195 // WebLayerImpl. |
| 194 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), | 196 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), |
| 195 transform, | 197 transform, |
| 196 sublayer_transform); | 198 sublayer_transform); |
| 197 } | 199 } |
| 198 | 200 |
| 199 } // namespace | 201 } // namespace |
| 200 } // namespace webkit | 202 } // namespace webkit |
| OLD | NEW |