| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_test.h" | 5 #include "cc/test/layer_tree_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 scoped_refptr<Layer> root_layer = Layer::Create(); | 683 scoped_refptr<Layer> root_layer = Layer::Create(); |
| 684 root_layer->SetBounds(gfx::Size(1, 1)); | 684 root_layer->SetBounds(gfx::Size(1, 1)); |
| 685 layer_tree_host()->SetRootLayer(root_layer); | 685 layer_tree_host()->SetRootLayer(root_layer); |
| 686 } | 686 } |
| 687 | 687 |
| 688 gfx::Size root_bounds = layer_tree_host()->root_layer()->bounds(); | 688 gfx::Size root_bounds = layer_tree_host()->root_layer()->bounds(); |
| 689 gfx::Size device_root_bounds = gfx::ScaleToCeiledSize( | 689 gfx::Size device_root_bounds = gfx::ScaleToCeiledSize( |
| 690 root_bounds, layer_tree_host()->device_scale_factor()); | 690 root_bounds, layer_tree_host()->device_scale_factor()); |
| 691 layer_tree_host()->SetViewportSize(device_root_bounds); | 691 layer_tree_host()->SetViewportSize(device_root_bounds); |
| 692 layer_tree_host()->root_layer()->SetIsDrawable(true); | 692 layer_tree_host()->root_layer()->SetIsDrawable(true); |
| 693 layer_tree_host()->SetElementIdsForTesting(); |
| 693 } | 694 } |
| 694 | 695 |
| 695 void LayerTreeTest::Timeout() { | 696 void LayerTreeTest::Timeout() { |
| 696 timed_out_ = true; | 697 timed_out_ = true; |
| 697 EndTest(); | 698 EndTest(); |
| 698 } | 699 } |
| 699 | 700 |
| 700 void LayerTreeTest::RealEndTest() { | 701 void LayerTreeTest::RealEndTest() { |
| 701 // TODO(mithro): Make this method only end when not inside an impl frame. | 702 // TODO(mithro): Make this method only end when not inside an impl frame. |
| 702 bool main_frame_will_happen = | 703 bool main_frame_will_happen = |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 DCHECK(task_runner_provider()->IsMainThread() || | 888 DCHECK(task_runner_provider()->IsMainThread() || |
| 888 task_runner_provider()->IsMainThreadBlocked()); | 889 task_runner_provider()->IsMainThreadBlocked()); |
| 889 return layer_tree_host_.get(); | 890 return layer_tree_host_.get(); |
| 890 } | 891 } |
| 891 | 892 |
| 892 Proxy* LayerTreeTest::proxy() { | 893 Proxy* LayerTreeTest::proxy() { |
| 893 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; | 894 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; |
| 894 } | 895 } |
| 895 | 896 |
| 896 } // namespace cc | 897 } // namespace cc |
| OLD | NEW |