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