OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/fake_layer_tree_host_client.h" | 5 #include "cc/test/fake_layer_tree_host_client.h" |
6 | 6 |
7 #include "cc/debug/test_web_graphics_context_3d.h" | 7 #include "cc/debug/test_web_graphics_context_3d.h" |
8 #include "cc/output/context_provider.h" | 8 #include "cc/output/context_provider.h" |
9 #include "cc/test/fake_output_surface.h" | 9 #include "cc/test/fake_output_surface.h" |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 return FakeOutputSurface::CreateDelegatingSoftware( | 25 return FakeOutputSurface::CreateDelegatingSoftware( |
26 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); | 26 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); |
27 } | 27 } |
28 | 28 |
29 return FakeOutputSurface::CreateSoftware( | 29 return FakeOutputSurface::CreateSoftware( |
30 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); | 30 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); |
31 } | 31 } |
32 | 32 |
33 if (use_delegating_renderer_) | 33 if (use_delegating_renderer_) |
34 return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); | 34 return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); |
35 | 35 return FakeOutputSurface::Create3d().PassAs<OutputSurface>(); |
36 return CreateFakeOutputSurface(); | |
37 } | 36 } |
38 | 37 |
39 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: | 38 scoped_refptr<ContextProvider> FakeLayerTreeHostClient:: |
40 OffscreenContextProviderForMainThread() { | 39 OffscreenContextProviderForMainThread() { |
41 if (!main_thread_contexts_.get() || | 40 if (!main_thread_contexts_.get() || |
42 main_thread_contexts_->DestroyedOnMainThread()) { | 41 main_thread_contexts_->DestroyedOnMainThread()) { |
43 main_thread_contexts_ = TestContextProvider::Create(); | 42 main_thread_contexts_ = TestContextProvider::Create(); |
44 if (!main_thread_contexts_->BindToCurrentThread()) | 43 if (main_thread_contexts_ && !main_thread_contexts_->BindToCurrentThread()) |
45 main_thread_contexts_ = NULL; | 44 main_thread_contexts_ = NULL; |
46 } | 45 } |
47 return main_thread_contexts_; | 46 return main_thread_contexts_; |
48 } | 47 } |
49 | 48 |
50 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: | 49 scoped_refptr<ContextProvider> FakeLayerTreeHostClient:: |
51 OffscreenContextProviderForCompositorThread() { | 50 OffscreenContextProviderForCompositorThread() { |
52 if (!compositor_thread_contexts_.get() || | 51 if (!compositor_thread_contexts_.get() || |
53 compositor_thread_contexts_->DestroyedOnMainThread()) | 52 compositor_thread_contexts_->DestroyedOnMainThread()) |
54 compositor_thread_contexts_ = TestContextProvider::Create(); | 53 compositor_thread_contexts_ = TestContextProvider::Create(); |
55 return compositor_thread_contexts_; | 54 return compositor_thread_contexts_; |
56 } | 55 } |
57 | 56 |
58 } // namespace cc | 57 } // namespace cc |
OLD | NEW |