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/test/test_task_graph_runner.h" | 10 #include "cc/test/test_task_graph_runner.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 fixed_bounds_layer->setPosition(position); | 98 fixed_bounds_layer->setPosition(position); |
99 root_layer->addChild(fixed_bounds_layer); | 99 root_layer->addChild(fixed_bounds_layer); |
100 | 100 |
101 WebLayerImpl* normal_layer(new WebLayerImpl(cc::PictureImageLayer::Create())); | 101 WebLayerImpl* normal_layer(new WebLayerImpl(cc::PictureImageLayer::Create())); |
102 | 102 |
103 normal_layer->setBounds(bounds); | 103 normal_layer->setBounds(bounds); |
104 normal_layer->setTransform(transform.matrix()); | 104 normal_layer->setTransform(transform.matrix()); |
105 normal_layer->setPosition(position); | 105 normal_layer->setPosition(position); |
106 root_layer->addChild(normal_layer); | 106 root_layer->addChild(normal_layer); |
107 | 107 |
108 cc::FakeLayerTreeHostClient client(cc::FakeLayerTreeHostClient::DIRECT_3D); | 108 cc::FakeLayerTreeHostClient client; |
109 cc::TestTaskGraphRunner task_graph_runner; | 109 cc::TestTaskGraphRunner task_graph_runner; |
110 std::unique_ptr<cc::FakeLayerTreeHost> host = | 110 std::unique_ptr<cc::FakeLayerTreeHost> host = |
111 cc::FakeLayerTreeHost::Create(&client, &task_graph_runner); | 111 cc::FakeLayerTreeHost::Create(&client, &task_graph_runner); |
112 host->SetRootLayer(root_layer->layer()); | 112 host->SetRootLayer(root_layer->layer()); |
113 | 113 |
114 { | 114 { |
115 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 115 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
116 root_layer->layer(), kDeviceViewportSize); | 116 root_layer->layer(), kDeviceViewportSize); |
117 inputs.device_scale_factor = kDeviceScaleFactor; | 117 inputs.device_scale_factor = kDeviceScaleFactor; |
118 inputs.page_scale_factor = kPageScaleFactor; | 118 inputs.page_scale_factor = kPageScaleFactor; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); | 171 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); |
172 | 172 |
173 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to | 173 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to |
174 // WebLayerImpl. | 174 // WebLayerImpl. |
175 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); | 175 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); |
176 } | 176 } |
177 | 177 |
178 } // namespace | 178 } // namespace |
179 } // namespace cc_blink | 179 } // namespace cc_blink |
OLD | NEW |