| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/aura/gpu_process_transport_factory.h" | 5 #include "content/browser/aura/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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); | 242 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); |
| 243 | 243 |
| 244 if (!context_provider.get()) { | 244 if (!context_provider.get()) { |
| 245 if (ui::Compositor::WasInitializedWithThread()) { | 245 if (ui::Compositor::WasInitializedWithThread()) { |
| 246 LOG(FATAL) << "Failed to create UI context, but can't use software" | 246 LOG(FATAL) << "Failed to create UI context, but can't use software" |
| 247 " compositing with browser threaded compositing. Aborting."; | 247 " compositing with browser threaded compositing. Aborting."; |
| 248 } | 248 } |
| 249 | 249 |
| 250 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface = | 250 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface = |
| 251 SoftwareBrowserCompositorOutputSurface::Create( | 251 SoftwareBrowserCompositorOutputSurface::Create( |
| 252 CreateSoftwareOutputDevice(compositor)); | 252 CreateSoftwareOutputDevice(compositor), |
| 253 base::MessageLoopProxy::current().get(), |
| 254 compositor->AsWeakPtr()); |
| 253 return surface.PassAs<cc::OutputSurface>(); | 255 return surface.PassAs<cc::OutputSurface>(); |
| 254 } | 256 } |
| 255 | 257 |
| 256 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = | 258 scoped_refptr<base::SingleThreadTaskRunner> compositor_thread_task_runner = |
| 257 ui::Compositor::GetCompositorMessageLoop(); | 259 ui::Compositor::GetCompositorMessageLoop(); |
| 258 if (!compositor_thread_task_runner.get()) | 260 if (!compositor_thread_task_runner.get()) |
| 259 compositor_thread_task_runner = base::MessageLoopProxy::current(); | 261 compositor_thread_task_runner = base::MessageLoopProxy::current(); |
| 260 | 262 |
| 261 // Here we know the GpuProcessHost has been set up, because we created a | 263 // Here we know the GpuProcessHost has been set up, because we created a |
| 262 // context. | 264 // context. |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 observer_list_, | 548 observer_list_, |
| 547 OnLostResources()); | 549 OnLostResources()); |
| 548 | 550 |
| 549 // Kill things that use the shared context before killing the shared context. | 551 // Kill things that use the shared context before killing the shared context. |
| 550 lost_gl_helper.reset(); | 552 lost_gl_helper.reset(); |
| 551 lost_offscreen_compositor_contexts = NULL; | 553 lost_offscreen_compositor_contexts = NULL; |
| 552 lost_shared_main_thread_contexts = NULL; | 554 lost_shared_main_thread_contexts = NULL; |
| 553 } | 555 } |
| 554 | 556 |
| 555 } // namespace content | 557 } // namespace content |
| OLD | NEW |