| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 scoped_refptr<Layer> root_layer = Layer::Create(); | 672 scoped_refptr<Layer> root_layer = Layer::Create(); |
| 673 root_layer->SetBounds(gfx::Size(1, 1)); | 673 root_layer->SetBounds(gfx::Size(1, 1)); |
| 674 layer_tree_host()->SetRootLayer(root_layer); | 674 layer_tree_host()->SetRootLayer(root_layer); |
| 675 } | 675 } |
| 676 | 676 |
| 677 gfx::Size root_bounds = layer_tree_host()->root_layer()->bounds(); | 677 gfx::Size root_bounds = layer_tree_host()->root_layer()->bounds(); |
| 678 gfx::Size device_root_bounds = gfx::ScaleToCeiledSize( | 678 gfx::Size device_root_bounds = gfx::ScaleToCeiledSize( |
| 679 root_bounds, layer_tree_host()->device_scale_factor()); | 679 root_bounds, layer_tree_host()->device_scale_factor()); |
| 680 layer_tree_host()->SetViewportSize(device_root_bounds); | 680 layer_tree_host()->SetViewportSize(device_root_bounds); |
| 681 layer_tree_host()->root_layer()->SetIsDrawable(true); | 681 layer_tree_host()->root_layer()->SetIsDrawable(true); |
| 682 layer_tree_host()->SetElementIdsForTesting(); |
| 682 } | 683 } |
| 683 | 684 |
| 684 void LayerTreeTest::Timeout() { | 685 void LayerTreeTest::Timeout() { |
| 685 timed_out_ = true; | 686 timed_out_ = true; |
| 686 EndTest(); | 687 EndTest(); |
| 687 } | 688 } |
| 688 | 689 |
| 689 void LayerTreeTest::RealEndTest() { | 690 void LayerTreeTest::RealEndTest() { |
| 690 // TODO(mithro): Make this method only end when not inside an impl frame. | 691 // TODO(mithro): Make this method only end when not inside an impl frame. |
| 691 bool main_frame_will_happen = | 692 bool main_frame_will_happen = |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 DCHECK(task_runner_provider()->IsMainThread() || | 870 DCHECK(task_runner_provider()->IsMainThread() || |
| 870 task_runner_provider()->IsMainThreadBlocked()); | 871 task_runner_provider()->IsMainThreadBlocked()); |
| 871 return layer_tree_host_.get(); | 872 return layer_tree_host_.get(); |
| 872 } | 873 } |
| 873 | 874 |
| 874 Proxy* LayerTreeTest::proxy() { | 875 Proxy* LayerTreeTest::proxy() { |
| 875 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; | 876 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; |
| 876 } | 877 } |
| 877 | 878 |
| 878 } // namespace cc | 879 } // namespace cc |
| OLD | NEW |