| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 namespace content { | 63 namespace content { |
| 64 | 64 |
| 65 struct GpuProcessTransportFactory::PerCompositorData { | 65 struct GpuProcessTransportFactory::PerCompositorData { |
| 66 int surface_id; | 66 int surface_id; |
| 67 scoped_refptr<ReflectorImpl> reflector; | 67 scoped_refptr<ReflectorImpl> reflector; |
| 68 scoped_ptr<OnscreenDisplayClient> display_client; | 68 scoped_ptr<OnscreenDisplayClient> display_client; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 GpuProcessTransportFactory::GpuProcessTransportFactory() | 71 GpuProcessTransportFactory::GpuProcessTransportFactory() |
| 72 : callback_factory_(this), | 72 : next_surface_id_namespace_(1u), |
| 73 next_surface_id_namespace_(1u) { | 73 callback_factory_(this) { |
| 74 output_surface_proxy_ = new BrowserCompositorOutputSurfaceProxy( | 74 output_surface_proxy_ = new BrowserCompositorOutputSurfaceProxy( |
| 75 &output_surface_map_); | 75 &output_surface_map_); |
| 76 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
| 77 bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch( | 77 bool use_thread = !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 78 switches::kUIDisableThreadedCompositing); | 78 switches::kUIDisableThreadedCompositing); |
| 79 #else | 79 #else |
| 80 bool use_thread = false; | 80 bool use_thread = false; |
| 81 #endif | 81 #endif |
| 82 if (use_thread) { | 82 if (use_thread) { |
| 83 compositor_thread_.reset(new base::Thread("Browser Compositor")); | 83 compositor_thread_.reset(new base::Thread("Browser Compositor")); |
| (...skipping 388 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 |