| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/blink/web_layer_impl_fixed_bounds.h" | 6 #include "cc/blink/web_layer_impl_fixed_bounds.h" |
| 7 #include "cc/layers/picture_image_layer.h" | 7 #include "cc/layers/picture_image_layer.h" |
| 8 #include "cc/test/fake_layer_tree_host.h" | 8 #include "cc/test/fake_layer_tree_host.h" |
| 9 #include "cc/test/geometry_test_utils.h" | 9 #include "cc/test/geometry_test_utils.h" |
| 10 #include "cc/trees/layer_tree_host_common.h" | 10 #include "cc/trees/layer_tree_host_common.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 fixed_bounds_layer->setPosition(position); | 97 fixed_bounds_layer->setPosition(position); |
| 98 root_layer->addChild(fixed_bounds_layer); | 98 root_layer->addChild(fixed_bounds_layer); |
| 99 | 99 |
| 100 WebLayerImpl* normal_layer(new WebLayerImpl(cc::PictureImageLayer::Create())); | 100 WebLayerImpl* normal_layer(new WebLayerImpl(cc::PictureImageLayer::Create())); |
| 101 | 101 |
| 102 normal_layer->setBounds(bounds); | 102 normal_layer->setBounds(bounds); |
| 103 normal_layer->setTransform(transform.matrix()); | 103 normal_layer->setTransform(transform.matrix()); |
| 104 normal_layer->setPosition(position); | 104 normal_layer->setPosition(position); |
| 105 root_layer->addChild(normal_layer); | 105 root_layer->addChild(normal_layer); |
| 106 | 106 |
| 107 cc::FakeLayerTreeHostClient client(cc::FakeLayerTreeHostClient::DIRECT_3D); | 107 scoped_ptr<cc::FakeLayerTreeHost> host = cc::FakeLayerTreeHost::Create(); |
| 108 scoped_ptr<cc::FakeLayerTreeHost> host = | |
| 109 cc::FakeLayerTreeHost::Create(&client); | |
| 110 host->SetRootLayer(root_layer->layer()); | 108 host->SetRootLayer(root_layer->layer()); |
| 111 | 109 |
| 112 { | 110 { |
| 113 cc::RenderSurfaceLayerList render_surface_layer_list; | 111 cc::RenderSurfaceLayerList render_surface_layer_list; |
| 114 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 112 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 115 root_layer->layer(), kDeviceViewportSize, &render_surface_layer_list); | 113 root_layer->layer(), kDeviceViewportSize, &render_surface_layer_list); |
| 116 inputs.device_scale_factor = kDeviceScaleFactor; | 114 inputs.device_scale_factor = kDeviceScaleFactor; |
| 117 inputs.page_scale_factor = kPageScaleFactor; | 115 inputs.page_scale_factor = kPageScaleFactor; |
| 118 inputs.page_scale_application_layer = root_layer->layer(), | 116 inputs.page_scale_application_layer = root_layer->layer(), |
| 119 cc::LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 117 cc::LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 168 |
| 171 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); | 169 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); |
| 172 | 170 |
| 173 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to | 171 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to |
| 174 // WebLayerImpl. | 172 // WebLayerImpl. |
| 175 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); | 173 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); |
| 176 } | 174 } |
| 177 | 175 |
| 178 } // namespace | 176 } // namespace |
| 179 } // namespace cc_blink | 177 } // namespace cc_blink |
| OLD | NEW |