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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 void DidCommitAndDrawFrame() override { | 320 void DidCommitAndDrawFrame() override { |
321 test_hooks_->DidCommitAndDrawFrame(); | 321 test_hooks_->DidCommitAndDrawFrame(); |
322 } | 322 } |
323 | 323 |
324 void DidCompleteSwapBuffers() override { | 324 void DidCompleteSwapBuffers() override { |
325 test_hooks_->DidCompleteSwapBuffers(); | 325 test_hooks_->DidCompleteSwapBuffers(); |
326 } | 326 } |
327 | 327 |
328 void DidPostSwapBuffers() override {} | 328 void DidPostSwapBuffers() override {} |
329 void DidAbortSwapBuffers() override {} | 329 void DidAbortSwapBuffers() override {} |
| 330 void ScheduleComposite() override { test_hooks_->ScheduleComposite(); } |
330 | 331 |
331 private: | 332 private: |
332 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) | 333 explicit LayerTreeHostClientForTesting(TestHooks* test_hooks) |
333 : test_hooks_(test_hooks) {} | 334 : test_hooks_(test_hooks) {} |
334 | 335 |
335 TestHooks* test_hooks_; | 336 TestHooks* test_hooks_; |
336 }; | 337 }; |
337 | 338 |
338 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. | 339 // Adapts LayerTreeHost for test. Injects LayerTreeHostImplForTesting. |
339 class LayerTreeHostForTesting : public LayerTreeHost { | 340 class LayerTreeHostForTesting : public LayerTreeHost { |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 return -1; | 715 return -1; |
715 } | 716 } |
716 | 717 |
717 void LayerTreeTest::DestroyLayerTreeHost() { | 718 void LayerTreeTest::DestroyLayerTreeHost() { |
718 if (layer_tree_host_ && layer_tree_host_->root_layer()) | 719 if (layer_tree_host_ && layer_tree_host_->root_layer()) |
719 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); | 720 layer_tree_host_->root_layer()->SetLayerTreeHost(NULL); |
720 layer_tree_host_ = nullptr; | 721 layer_tree_host_ = nullptr; |
721 } | 722 } |
722 | 723 |
723 } // namespace cc | 724 } // namespace cc |
OLD | NEW |