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