OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 DCHECK(per_compositor_data_.empty()); | 115 DCHECK(per_compositor_data_.empty()); |
116 | 116 |
117 // Make sure the lost context callback doesn't try to run during destruction. | 117 // Make sure the lost context callback doesn't try to run during destruction. |
118 callback_factory_.InvalidateWeakPtrs(); | 118 callback_factory_.InvalidateWeakPtrs(); |
119 | 119 |
120 task_graph_runner_->Shutdown(); | 120 task_graph_runner_->Shutdown(); |
121 } | 121 } |
122 | 122 |
123 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 123 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
124 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { | 124 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { |
125 #if defined(OS_ANDROID) | |
126 return CreateContextCommon(scoped_refptr<GpuChannelHost>(nullptr), 0); | |
127 #else | |
128 CauseForGpuLaunch cause = | 125 CauseForGpuLaunch cause = |
129 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | 126 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
130 scoped_refptr<GpuChannelHost> gpu_channel_host( | 127 scoped_refptr<GpuChannelHost> gpu_channel_host( |
131 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); | 128 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); |
132 return CreateContextCommon(gpu_channel_host, 0); | 129 return CreateContextCommon(gpu_channel_host, 0); |
133 #endif // OS_ANDROID | |
134 } | 130 } |
135 | 131 |
136 scoped_ptr<cc::SoftwareOutputDevice> | 132 scoped_ptr<cc::SoftwareOutputDevice> |
137 GpuProcessTransportFactory::CreateSoftwareOutputDevice( | 133 GpuProcessTransportFactory::CreateSoftwareOutputDevice( |
138 ui::Compositor* compositor) { | 134 ui::Compositor* compositor) { |
139 #if defined(MOJO_RUNNER_CLIENT) | 135 #if defined(MOJO_RUNNER_CLIENT) |
140 if (IsRunningInMojoShell()) { | 136 if (IsRunningInMojoShell()) { |
141 return scoped_ptr<cc::SoftwareOutputDevice>( | 137 return scoped_ptr<cc::SoftwareOutputDevice>( |
142 new SoftwareOutputDeviceMus(compositor)); | 138 new SoftwareOutputDeviceMus(compositor)); |
143 } | 139 } |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 647 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
652 observer_list_, | 648 observer_list_, |
653 OnLostResources()); | 649 OnLostResources()); |
654 | 650 |
655 // Kill things that use the shared context before killing the shared context. | 651 // Kill things that use the shared context before killing the shared context. |
656 lost_gl_helper.reset(); | 652 lost_gl_helper.reset(); |
657 lost_shared_main_thread_contexts = NULL; | 653 lost_shared_main_thread_contexts = NULL; |
658 } | 654 } |
659 | 655 |
660 } // namespace content | 656 } // namespace content |
OLD | NEW |