Chromium Code Reviews| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 // Make sure the lost context callback doesn't try to run during destruction. | 125 // Make sure the lost context callback doesn't try to run during destruction. |
| 126 callback_factory_.InvalidateWeakPtrs(); | 126 callback_factory_.InvalidateWeakPtrs(); |
| 127 | 127 |
| 128 task_graph_runner_->Shutdown(); | 128 task_graph_runner_->Shutdown(); |
| 129 if (raster_thread_) | 129 if (raster_thread_) |
| 130 raster_thread_->Join(); | 130 raster_thread_->Join(); |
| 131 } | 131 } |
| 132 | 132 |
| 133 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 133 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
| 134 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { | 134 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext() { |
| 135 #if defined(USE_AURA) | |
|
no sievers
2015/10/22 20:55:40
put if defined(OS_ANDROID) instead and TODO(crbug.
mfomitchev
2015/11/02 21:51:15
Done.
| |
| 136 // TODO(mfomitchev): hack | |
| 137 return CreateContextCommon(scoped_refptr<GpuChannelHost>(nullptr), 0); | |
| 138 #else | |
| 135 CauseForGpuLaunch cause = | 139 CauseForGpuLaunch cause = |
| 136 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; | 140 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; |
| 137 scoped_refptr<GpuChannelHost> gpu_channel_host( | 141 scoped_refptr<GpuChannelHost> gpu_channel_host( |
| 138 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); | 142 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); |
| 139 return CreateContextCommon(gpu_channel_host, 0); | 143 return CreateContextCommon(gpu_channel_host, 0); |
| 144 #endif // USE_AURA | |
| 140 } | 145 } |
| 141 | 146 |
| 142 scoped_ptr<cc::SoftwareOutputDevice> | 147 scoped_ptr<cc::SoftwareOutputDevice> |
| 143 GpuProcessTransportFactory::CreateSoftwareOutputDevice( | 148 GpuProcessTransportFactory::CreateSoftwareOutputDevice( |
| 144 ui::Compositor* compositor) { | 149 ui::Compositor* compositor) { |
| 145 #if defined(OS_WIN) | 150 #if defined(OS_WIN) |
| 146 return scoped_ptr<cc::SoftwareOutputDevice>( | 151 return scoped_ptr<cc::SoftwareOutputDevice>( |
| 147 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); | 152 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); |
| 148 #elif defined(USE_OZONE) | 153 #elif defined(USE_OZONE) |
| 149 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( | 154 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 633 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 638 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 634 observer_list_, | 639 observer_list_, |
| 635 OnLostResources()); | 640 OnLostResources()); |
| 636 | 641 |
| 637 // Kill things that use the shared context before killing the shared context. | 642 // Kill things that use the shared context before killing the shared context. |
| 638 lost_gl_helper.reset(); | 643 lost_gl_helper.reset(); |
| 639 lost_shared_main_thread_contexts = NULL; | 644 lost_shared_main_thread_contexts = NULL; |
| 640 } | 645 } |
| 641 | 646 |
| 642 } // namespace content | 647 } // namespace content |
| OLD | NEW |