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/output/context_provider.h" | 7 #include "cc/output/context_provider.h" |
8 #include "cc/test/test_web_graphics_context_3d.h" | 8 #include "cc/test/test_web_graphics_context_3d.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 10 matching lines...) Expand all Loading... |
21 if (use_software_rendering_) { | 21 if (use_software_rendering_) { |
22 if (use_delegating_renderer_) { | 22 if (use_delegating_renderer_) { |
23 return FakeOutputSurface::CreateDelegatingSoftware( | 23 return FakeOutputSurface::CreateDelegatingSoftware( |
24 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); | 24 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); |
25 } | 25 } |
26 | 26 |
27 return FakeOutputSurface::CreateSoftware( | 27 return FakeOutputSurface::CreateSoftware( |
28 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); | 28 make_scoped_ptr(new SoftwareOutputDevice)).PassAs<OutputSurface>(); |
29 } | 29 } |
30 | 30 |
31 WebKit::WebGraphicsContext3D::Attributes attrs; | 31 if (use_delegating_renderer_) |
32 if (use_delegating_renderer_) { | 32 return FakeOutputSurface::CreateDelegating3d().PassAs<OutputSurface>(); |
33 return FakeOutputSurface::CreateDelegating3d( | |
34 TestWebGraphicsContext3D::Create(attrs) | |
35 .PassAs<WebKit::WebGraphicsContext3D>()) | |
36 .PassAs<OutputSurface>(); | |
37 } | |
38 | 33 |
39 return FakeOutputSurface::Create3d( | 34 return CreateFakeOutputSurface(); |
40 TestWebGraphicsContext3D::Create(attrs) | |
41 .PassAs<WebKit::WebGraphicsContext3D>()) | |
42 .PassAs<OutputSurface>(); | |
43 } | 35 } |
44 | 36 |
45 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: | 37 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: |
46 OffscreenContextProviderForMainThread() { | 38 OffscreenContextProviderForMainThread() { |
47 if (!main_thread_contexts_.get() || | 39 if (!main_thread_contexts_.get() || |
48 main_thread_contexts_->DestroyedOnMainThread()) { | 40 main_thread_contexts_->DestroyedOnMainThread()) { |
49 main_thread_contexts_ = FakeContextProvider::Create(); | 41 main_thread_contexts_ = FakeContextProvider::Create(); |
50 if (!main_thread_contexts_->BindToCurrentThread()) | 42 if (!main_thread_contexts_->BindToCurrentThread()) |
51 main_thread_contexts_ = NULL; | 43 main_thread_contexts_ = NULL; |
52 } | 44 } |
53 return main_thread_contexts_; | 45 return main_thread_contexts_; |
54 } | 46 } |
55 | 47 |
56 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: | 48 scoped_refptr<cc::ContextProvider> FakeLayerTreeHostClient:: |
57 OffscreenContextProviderForCompositorThread() { | 49 OffscreenContextProviderForCompositorThread() { |
58 if (!compositor_thread_contexts_.get() || | 50 if (!compositor_thread_contexts_.get() || |
59 compositor_thread_contexts_->DestroyedOnMainThread()) | 51 compositor_thread_contexts_->DestroyedOnMainThread()) |
60 compositor_thread_contexts_ = FakeContextProvider::Create(); | 52 compositor_thread_contexts_ = FakeContextProvider::Create(); |
61 return compositor_thread_contexts_; | 53 return compositor_thread_contexts_; |
62 } | 54 } |
63 | 55 |
64 } // namespace cc | 56 } // namespace cc |
OLD | NEW |