| 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface( | 218 scoped_ptr<SoftwareBrowserCompositorOutputSurface> surface( |
| 219 new SoftwareBrowserCompositorOutputSurface( | 219 new SoftwareBrowserCompositorOutputSurface( |
| 220 output_surface_proxy_, | 220 output_surface_proxy_, |
| 221 CreateSoftwareOutputDevice(compositor), | 221 CreateSoftwareOutputDevice(compositor), |
| 222 per_compositor_data_[compositor]->surface_id, | 222 per_compositor_data_[compositor]->surface_id, |
| 223 &output_surface_map_, | 223 &output_surface_map_, |
| 224 compositor->vsync_manager())); | 224 compositor->vsync_manager())); |
| 225 return surface.PassAs<cc::OutputSurface>(); | 225 return surface.PassAs<cc::OutputSurface>(); |
| 226 } | 226 } |
| 227 | 227 |
| 228 scoped_ptr<BrowserCompositorOutputSurface> surface( | 228 scoped_ptr<BrowserCompositorOutputSurface> surface; |
| 229 new GpuBrowserCompositorOutputSurface( | 229 #if defined(USE_OZONE) |
| 230 context_provider, | 230 if (ui::SurfaceFactoryOzone::GetInstance()->CanShowPrimaryPlaneAsOverlay()) { |
| 231 per_compositor_data_[compositor]->surface_id, | 231 NOTIMPLEMENTED(); |
| 232 &output_surface_map_, | 232 return scoped_ptr<cc::OutputSurface>(); // TODO(achaulk) implementation. |
| 233 compositor->vsync_manager(), | 233 } |
| 234 CreateOverlayCandidateValidator(compositor->widget()))); | 234 #endif |
| 235 if (!surface) |
| 236 surface.reset(new GpuBrowserCompositorOutputSurface( |
| 237 context_provider, |
| 238 per_compositor_data_[compositor]->surface_id, |
| 239 &output_surface_map_, |
| 240 compositor->vsync_manager(), |
| 241 CreateOverlayCandidateValidator(compositor->widget()))); |
| 242 |
| 235 if (data->reflector.get()) | 243 if (data->reflector.get()) |
| 236 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get()); | 244 data->reflector->ReattachToOutputSurfaceFromMainThread(surface.get()); |
| 237 | 245 |
| 238 return surface.PassAs<cc::OutputSurface>(); | 246 return surface.PassAs<cc::OutputSurface>(); |
| 239 } | 247 } |
| 240 | 248 |
| 241 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( | 249 scoped_refptr<ui::Reflector> GpuProcessTransportFactory::CreateReflector( |
| 242 ui::Compositor* source, | 250 ui::Compositor* source, |
| 243 ui::Layer* target) { | 251 ui::Layer* target) { |
| 244 PerCompositorData* data = per_compositor_data_[source]; | 252 PerCompositorData* data = per_compositor_data_[source]; |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 461 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 454 observer_list_, | 462 observer_list_, |
| 455 OnLostResources()); | 463 OnLostResources()); |
| 456 | 464 |
| 457 // 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. |
| 458 lost_gl_helper.reset(); | 466 lost_gl_helper.reset(); |
| 459 lost_shared_main_thread_contexts = NULL; | 467 lost_shared_main_thread_contexts = NULL; |
| 460 } | 468 } |
| 461 | 469 |
| 462 } // namespace content | 470 } // namespace content |
| OLD | NEW |