| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Make sure the lost context callback doesn't try to run during destruction. | 126 // Make sure the lost context callback doesn't try to run during destruction. |
| 127 callback_factory_.InvalidateWeakPtrs(); | 127 callback_factory_.InvalidateWeakPtrs(); |
| 128 | 128 |
| 129 task_graph_runner_->Shutdown(); | 129 task_graph_runner_->Shutdown(); |
| 130 if (raster_thread_) | 130 if (raster_thread_) |
| 131 raster_thread_->Join(); | 131 raster_thread_->Join(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 134 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
| 135 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { | 135 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { |
| 136 #if defined(OS_ANDROID) |
| 137 // TODO(mfomitchev): crbug.com/546716 |
| 138 return CreateContextCommon(scoped_refptr<GpuChannelHost>(nullptr), 0); |
| 139 #else |
| 136 CauseForGpuLaunch cause = | 140 CauseForGpuLaunch cause = |
| 137 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | 141 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
| 138 scoped_refptr<GpuChannelHost> gpu_channel_host( | 142 scoped_refptr<GpuChannelHost> gpu_channel_host( |
| 139 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); | 143 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); |
| 140 return CreateContextCommon(gpu_channel_host, 0); | 144 return CreateContextCommon(gpu_channel_host, 0); |
| 145 #endif // OS_ANDROID |
| 141 } | 146 } |
| 142 | 147 |
| 143 scoped_ptr<cc::SoftwareOutputDevice> | 148 scoped_ptr<cc::SoftwareOutputDevice> |
| 144 GpuProcessTransportFactory::CreateSoftwareOutputDevice( | 149 GpuProcessTransportFactory::CreateSoftwareOutputDevice( |
| 145 ui::Compositor* compositor) { | 150 ui::Compositor* compositor) { |
| 146 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
| 147 return scoped_ptr<cc::SoftwareOutputDevice>( | 152 return scoped_ptr<cc::SoftwareOutputDevice>( |
| 148 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); | 153 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); |
| 149 #elif defined(USE_OZONE) | 154 #elif defined(USE_OZONE) |
| 150 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( | 155 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 652 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 648 observer_list_, | 653 observer_list_, |
| 649 OnLostResources()); | 654 OnLostResources()); |
| 650 | 655 |
| 651 // Kill things that use the shared context before killing the shared context. | 656 // Kill things that use the shared context before killing the shared context. |
| 652 lost_gl_helper.reset(); | 657 lost_gl_helper.reset(); |
| 653 lost_shared_main_thread_contexts = NULL; | 658 lost_shared_main_thread_contexts = NULL; |
| 654 } | 659 } |
| 655 | 660 |
| 656 } // namespace content | 661 } // namespace content |
| OLD | NEW |