| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 display_surface.Pass(), manager, compositor->task_runner())); | 202 display_surface.Pass(), manager, compositor->task_runner())); |
| 203 | 203 |
| 204 scoped_refptr<cc::ContextProvider> offscreen_context_provider; | 204 scoped_refptr<cc::ContextProvider> offscreen_context_provider; |
| 205 if (context_provider.get()) { | 205 if (context_provider.get()) { |
| 206 offscreen_context_provider = ContextProviderCommandBuffer::Create( | 206 offscreen_context_provider = ContextProviderCommandBuffer::Create( |
| 207 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(), | 207 GpuProcessTransportFactory::CreateOffscreenCommandBufferContext(), |
| 208 "Offscreen-Compositor"); | 208 "Offscreen-Compositor"); |
| 209 } | 209 } |
| 210 scoped_ptr<SurfaceDisplayOutputSurface> output_surface( | 210 scoped_ptr<SurfaceDisplayOutputSurface> output_surface( |
| 211 new SurfaceDisplayOutputSurface(manager, | 211 new SurfaceDisplayOutputSurface(manager, |
| 212 next_surface_id_namespace_++, | 212 compositor->surface_id_allocator(), |
| 213 offscreen_context_provider)); | 213 offscreen_context_provider)); |
| 214 output_surface->set_display(display_client->display()); | 214 output_surface->set_display(display_client->display()); |
| 215 data->display_client = display_client.Pass(); | 215 data->display_client = display_client.Pass(); |
| 216 return output_surface.PassAs<cc::OutputSurface>(); | 216 return output_surface.PassAs<cc::OutputSurface>(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 if (!context_provider.get()) { | 219 if (!context_provider.get()) { |
| 220 if (compositor_thread_.get()) { | 220 if (compositor_thread_.get()) { |
| 221 LOG(FATAL) << "Failed to create UI context, but can't use software" | 221 LOG(FATAL) << "Failed to create UI context, but can't use software" |
| 222 " compositing with browser threaded compositing. Aborting."; | 222 " compositing with browser threaded compositing. Aborting."; |
| 223 } | 223 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 460 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 461 observer_list_, | 461 observer_list_, |
| 462 OnLostResources()); | 462 OnLostResources()); |
| 463 | 463 |
| 464 // Kill things that use the shared context before killing the shared context. | 464 // Kill things that use the shared context before killing the shared context. |
| 465 lost_gl_helper.reset(); | 465 lost_gl_helper.reset(); |
| 466 lost_shared_main_thread_contexts = NULL; | 466 lost_shared_main_thread_contexts = NULL; |
| 467 } | 467 } |
| 468 | 468 |
| 469 } // namespace content | 469 } // namespace content |
| OLD | NEW |