| 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 "cc/test/layer_tree_json_parser.h" | 5 #include "cc/test/layer_tree_json_parser.h" |
| 6 | 6 |
| 7 #include "cc/layers/layer.h" | 7 #include "cc/layers/layer.h" |
| 8 #include "cc/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
| 9 #include "cc/test/fake_layer_tree_host.h" | 9 #include "cc/test/fake_layer_tree_host.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 LayerTreeImpl* tree = host_impl.active_tree(); | 71 LayerTreeImpl* tree = host_impl.active_tree(); |
| 72 | 72 |
| 73 scoped_ptr<LayerImpl> root_impl(LayerImpl::Create(tree, 1)); | 73 scoped_ptr<LayerImpl> root_impl(LayerImpl::Create(tree, 1)); |
| 74 scoped_ptr<LayerImpl> parent(LayerImpl::Create(tree, 2)); | 74 scoped_ptr<LayerImpl> parent(LayerImpl::Create(tree, 2)); |
| 75 scoped_ptr<LayerImpl> child(LayerImpl::Create(tree, 3)); | 75 scoped_ptr<LayerImpl> child(LayerImpl::Create(tree, 3)); |
| 76 | 76 |
| 77 root_impl->SetBounds(gfx::Size(100, 100)); | 77 root_impl->SetBounds(gfx::Size(100, 100)); |
| 78 parent->SetBounds(gfx::Size(50, 50)); | 78 parent->SetBounds(gfx::Size(50, 50)); |
| 79 child->SetBounds(gfx::Size(40, 40)); | 79 child->SetBounds(gfx::Size(40, 40)); |
| 80 | 80 |
| 81 parent->SetPosition(gfx::Point(25, 25)); | 81 parent->SetPosition(gfx::PointF(25.f, 25.f)); |
| 82 | 82 |
| 83 child->SetHaveWheelEventHandlers(true); | 83 child->SetHaveWheelEventHandlers(true); |
| 84 child->SetHaveScrollEventHandlers(true); | 84 child->SetHaveScrollEventHandlers(true); |
| 85 | 85 |
| 86 parent->AddChild(child.Pass()); | 86 parent->AddChild(child.Pass()); |
| 87 root_impl->AddChild(parent.Pass()); | 87 root_impl->AddChild(parent.Pass()); |
| 88 tree->SetRootLayer(root_impl.Pass()); | 88 tree->SetRootLayer(root_impl.Pass()); |
| 89 | 89 |
| 90 std::string json = host_impl.LayerTreeAsJson(); | 90 std::string json = host_impl.LayerTreeAsJson(); |
| 91 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); | 91 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 115 root_impl->AddChild(touch_layer.Pass()); | 115 root_impl->AddChild(touch_layer.Pass()); |
| 116 tree->SetRootLayer(root_impl.Pass()); | 116 tree->SetRootLayer(root_impl.Pass()); |
| 117 | 117 |
| 118 std::string json = host_impl.LayerTreeAsJson(); | 118 std::string json = host_impl.LayerTreeAsJson(); |
| 119 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); | 119 scoped_refptr<Layer> root = ParseTreeFromJson(json, NULL); |
| 120 ASSERT_TRUE(root.get()); | 120 ASSERT_TRUE(root.get()); |
| 121 EXPECT_TRUE(LayerTreesMatch(host_impl.RootLayer(), root.get())); | 121 EXPECT_TRUE(LayerTreesMatch(host_impl.RootLayer(), root.get())); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace cc | 124 } // namespace cc |
| OLD | NEW |