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 "cc/animation/animation.h" | 8 #include "cc/animation/animation.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/layer_animation_controller.h" | 10 #include "cc/animation/layer_animation_controller.h" |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 // Source frames start at 0, so this is invalid. | 871 // Source frames start at 0, so this is invalid. |
872 return -1; | 872 return -1; |
873 } | 873 } |
874 | 874 |
875 void LayerTreeTest::DestroyLayerTreeHost() { | 875 void LayerTreeTest::DestroyLayerTreeHost() { |
876 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 876 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
877 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 877 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
878 layer_tree_host_ = nullptr; | 878 layer_tree_host_ = nullptr; |
879 } | 879 } |
880 | 880 |
| 881 LayerTreeHost* LayerTreeTest::layer_tree_host() { |
| 882 // We check for a null proxy here as we sometimes ask for the layer tree host |
| 883 // when the proxy does not exist, often for checking settings after a test has |
| 884 // completed. For example, LTHPixelResourceTest::RunPixelResourceTest. See |
| 885 // elsewhere in this file for other examples. |
| 886 DCHECK(!proxy() || proxy()->IsMainThread() || proxy()->IsMainThreadBlocked()); |
| 887 return layer_tree_host_.get(); |
| 888 } |
| 889 |
881 } // namespace cc | 890 } // namespace cc |
OLD | NEW |