| 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 ASSERT_FALSE(layer_tree_host_.get()); | 574 ASSERT_FALSE(layer_tree_host_.get()); |
| 575 client_.reset(); | 575 client_.reset(); |
| 576 if (timed_out_) { | 576 if (timed_out_) { |
| 577 FAIL() << "Test timed out"; | 577 FAIL() << "Test timed out"; |
| 578 return; | 578 return; |
| 579 } | 579 } |
| 580 AfterTest(); | 580 AfterTest(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface() { | 583 scoped_ptr<OutputSurface> LayerTreeTest::CreateOutputSurface() { |
| 584 scoped_ptr<FakeOutputSurface> output_surface; |
| 584 if (delegating_renderer_) | 585 if (delegating_renderer_) |
| 585 return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); | 586 output_surface = FakeOutputSurface::CreateDelegating3d(); |
| 586 return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); | 587 else |
| 588 output_surface = FakeOutputSurface::Create3d(); |
| 589 output_surface_ = output_surface.get(); |
| 590 return output_surface.PassAs<OutputSurface>(); |
| 587 } | 591 } |
| 588 | 592 |
| 589 scoped_refptr<cc::ContextProvider> LayerTreeTest:: | 593 scoped_refptr<cc::ContextProvider> LayerTreeTest:: |
| 590 OffscreenContextProviderForMainThread() { | 594 OffscreenContextProviderForMainThread() { |
| 591 if (!main_thread_contexts_.get() || | 595 if (!main_thread_contexts_.get() || |
| 592 main_thread_contexts_->DestroyedOnMainThread()) { | 596 main_thread_contexts_->DestroyedOnMainThread()) { |
| 593 main_thread_contexts_ = FakeContextProvider::Create(); | 597 main_thread_contexts_ = FakeContextProvider::Create(); |
| 594 if (!main_thread_contexts_->BindToCurrentThread()) | 598 if (!main_thread_contexts_->BindToCurrentThread()) |
| 595 main_thread_contexts_ = NULL; | 599 main_thread_contexts_ = NULL; |
| 596 } | 600 } |
| 597 return main_thread_contexts_; | 601 return main_thread_contexts_; |
| 598 } | 602 } |
| 599 | 603 |
| 600 scoped_refptr<cc::ContextProvider> LayerTreeTest:: | 604 scoped_refptr<cc::ContextProvider> LayerTreeTest:: |
| 601 OffscreenContextProviderForCompositorThread() { | 605 OffscreenContextProviderForCompositorThread() { |
| 602 if (!compositor_thread_contexts_.get() || | 606 if (!compositor_thread_contexts_.get() || |
| 603 compositor_thread_contexts_->DestroyedOnMainThread()) | 607 compositor_thread_contexts_->DestroyedOnMainThread()) |
| 604 compositor_thread_contexts_ = FakeContextProvider::Create(); | 608 compositor_thread_contexts_ = FakeContextProvider::Create(); |
| 605 return compositor_thread_contexts_; | 609 return compositor_thread_contexts_; |
| 606 } | 610 } |
| 607 | 611 |
| 608 } // namespace cc | 612 } // namespace cc |
| OLD | NEW |