| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 next_surface_id_namespace_++, |
| 213 offscreen_context_provider)); | 213 offscreen_context_provider)); |
| 214 display_client->set_surface_output_surface(output_surface.get()); |
| 214 output_surface->set_display(display_client->display()); | 215 output_surface->set_display(display_client->display()); |
| 215 data->display_client = display_client.Pass(); | 216 data->display_client = display_client.Pass(); |
| 216 return output_surface.PassAs<cc::OutputSurface>(); | 217 return output_surface.PassAs<cc::OutputSurface>(); |
| 217 } | 218 } |
| 218 | 219 |
| 219 if (!context_provider.get()) { | 220 if (!context_provider.get()) { |
| 220 if (compositor_thread_.get()) { | 221 if (compositor_thread_.get()) { |
| 221 LOG(FATAL) << "Failed to create UI context, but can't use software" | 222 LOG(FATAL) << "Failed to create UI context, but can't use software" |
| 222 " compositing with browser threaded compositing. Aborting."; | 223 " compositing with browser threaded compositing. Aborting."; |
| 223 } | 224 } |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 461 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 461 observer_list_, | 462 observer_list_, |
| 462 OnLostResources()); | 463 OnLostResources()); |
| 463 | 464 |
| 464 // Kill things that use the shared context before killing the shared context. | 465 // Kill things that use the shared context before killing the shared context. |
| 465 lost_gl_helper.reset(); | 466 lost_gl_helper.reset(); |
| 466 lost_shared_main_thread_contexts = NULL; | 467 lost_shared_main_thread_contexts = NULL; |
| 467 } | 468 } |
| 468 | 469 |
| 469 } // namespace content | 470 } // namespace content |
| OLD | NEW |