| 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 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 609 output_surface = FakeOutputSurface::Create3d(); | 609 output_surface = FakeOutputSurface::Create3d(); |
| 610 output_surface_ = output_surface.get(); | 610 output_surface_ = output_surface.get(); |
| 611 return output_surface.PassAs<OutputSurface>(); | 611 return output_surface.PassAs<OutputSurface>(); |
| 612 } | 612 } |
| 613 | 613 |
| 614 scoped_refptr<cc::ContextProvider> LayerTreeTest:: | 614 scoped_refptr<cc::ContextProvider> LayerTreeTest:: |
| 615 OffscreenContextProviderForMainThread() { | 615 OffscreenContextProviderForMainThread() { |
| 616 if (!main_thread_contexts_.get() || | 616 if (!main_thread_contexts_.get() || |
| 617 main_thread_contexts_->DestroyedOnMainThread()) { | 617 main_thread_contexts_->DestroyedOnMainThread()) { |
| 618 main_thread_contexts_ = TestContextProvider::Create(); | 618 main_thread_contexts_ = TestContextProvider::Create(); |
| 619 if (!main_thread_contexts_->BindToCurrentThread()) | 619 if (main_thread_contexts_ && !main_thread_contexts_->BindToCurrentThread()) |
| 620 main_thread_contexts_ = NULL; | 620 main_thread_contexts_ = NULL; |
| 621 } | 621 } |
| 622 return main_thread_contexts_; | 622 return main_thread_contexts_; |
| 623 } | 623 } |
| 624 | 624 |
| 625 scoped_refptr<cc::ContextProvider> LayerTreeTest:: | 625 scoped_refptr<cc::ContextProvider> LayerTreeTest:: |
| 626 OffscreenContextProviderForCompositorThread() { | 626 OffscreenContextProviderForCompositorThread() { |
| 627 if (!compositor_thread_contexts_.get() || | 627 if (!compositor_thread_contexts_.get() || |
| 628 compositor_thread_contexts_->DestroyedOnMainThread()) | 628 compositor_thread_contexts_->DestroyedOnMainThread()) |
| 629 compositor_thread_contexts_ = TestContextProvider::Create(); | 629 compositor_thread_contexts_ = TestContextProvider::Create(); |
| 630 return compositor_thread_contexts_; | 630 return compositor_thread_contexts_; |
| 631 } | 631 } |
| 632 | 632 |
| 633 } // namespace cc | 633 } // namespace cc |
| OLD | NEW |