| 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/trees/layer_tree_host_common.h" | 11 #include "cc/trees/layer_tree_host_common.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "third_party/WebKit/public/platform/WebFloatPoint.h" | 13 #include "third_party/WebKit/public/platform/WebFloatPoint.h" |
| 13 #include "third_party/WebKit/public/platform/WebSize.h" | 14 #include "third_party/WebKit/public/platform/WebSize.h" |
| 14 #include "third_party/skia/include/utils/SkMatrix44.h" | 15 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 15 #include "ui/gfx/geometry/point3_f.h" | 16 #include "ui/gfx/geometry/point3_f.h" |
| 16 | 17 |
| 17 using blink::WebFloatPoint; | 18 using blink::WebFloatPoint; |
| 18 using blink::WebSize; | 19 using blink::WebSize; |
| 19 | 20 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 99 |
| 99 WebLayerImpl* normal_layer( | 100 WebLayerImpl* normal_layer( |
| 100 new WebLayerImpl(cc::PictureImageLayer::Create(cc::LayerSettings()))); | 101 new WebLayerImpl(cc::PictureImageLayer::Create(cc::LayerSettings()))); |
| 101 | 102 |
| 102 normal_layer->setBounds(bounds); | 103 normal_layer->setBounds(bounds); |
| 103 normal_layer->setTransform(transform.matrix()); | 104 normal_layer->setTransform(transform.matrix()); |
| 104 normal_layer->setPosition(position); | 105 normal_layer->setPosition(position); |
| 105 root_layer->addChild(normal_layer); | 106 root_layer->addChild(normal_layer); |
| 106 | 107 |
| 107 cc::FakeLayerTreeHostClient client(cc::FakeLayerTreeHostClient::DIRECT_3D); | 108 cc::FakeLayerTreeHostClient client(cc::FakeLayerTreeHostClient::DIRECT_3D); |
| 109 cc::TestTaskGraphRunner task_graph_runner; |
| 108 scoped_ptr<cc::FakeLayerTreeHost> host = | 110 scoped_ptr<cc::FakeLayerTreeHost> host = |
| 109 cc::FakeLayerTreeHost::Create(&client); | 111 cc::FakeLayerTreeHost::Create(&client, &task_graph_runner); |
| 110 host->SetRootLayer(root_layer->layer()); | 112 host->SetRootLayer(root_layer->layer()); |
| 111 | 113 |
| 112 { | 114 { |
| 113 cc::RenderSurfaceLayerList render_surface_layer_list; | 115 cc::RenderSurfaceLayerList render_surface_layer_list; |
| 114 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( | 116 cc::LayerTreeHostCommon::CalcDrawPropsMainInputsForTesting inputs( |
| 115 root_layer->layer(), kDeviceViewportSize, &render_surface_layer_list); | 117 root_layer->layer(), kDeviceViewportSize, &render_surface_layer_list); |
| 116 inputs.device_scale_factor = kDeviceScaleFactor; | 118 inputs.device_scale_factor = kDeviceScaleFactor; |
| 117 inputs.page_scale_factor = kPageScaleFactor; | 119 inputs.page_scale_factor = kPageScaleFactor; |
| 118 inputs.page_scale_layer = root_layer->layer(), | 120 inputs.page_scale_layer = root_layer->layer(), |
| 119 cc::LayerTreeHostCommon::CalculateDrawProperties(&inputs); | 121 cc::LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 | 172 |
| 171 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); | 173 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0, 0), transform); |
| 172 | 174 |
| 173 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to | 175 // With non-zero anchor point, WebLayerImplFixedBounds will fall back to |
| 174 // WebLayerImpl. | 176 // WebLayerImpl. |
| 175 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); | 177 CompareFixedBoundsLayerAndNormalLayer(WebFloatPoint(0.4f, 0.6f), transform); |
| 176 } | 178 } |
| 177 | 179 |
| 178 } // namespace | 180 } // namespace |
| 179 } // namespace cc_blink | 181 } // namespace cc_blink |
| OLD | NEW |