| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "ui/compositor/compositor_constants.h" | 43 #include "ui/compositor/compositor_constants.h" |
| 44 #include "ui/compositor/compositor_switches.h" | 44 #include "ui/compositor/compositor_switches.h" |
| 45 #include "ui/gfx/geometry/size.h" | 45 #include "ui/gfx/geometry/size.h" |
| 46 #include "ui/gfx/native_widget_types.h" | 46 #include "ui/gfx/native_widget_types.h" |
| 47 | 47 |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 #include "content/browser/compositor/software_output_device_win.h" | 49 #include "content/browser/compositor/software_output_device_win.h" |
| 50 #elif defined(USE_OZONE) | 50 #elif defined(USE_OZONE) |
| 51 #include "content/browser/compositor/overlay_candidate_validator_ozone.h" | 51 #include "content/browser/compositor/overlay_candidate_validator_ozone.h" |
| 52 #include "content/browser/compositor/software_output_device_ozone.h" | 52 #include "content/browser/compositor/software_output_device_ozone.h" |
| 53 #include "ui/ozone/public/ozone_switches.h" | |
| 54 #include "ui/ozone/public/surface_factory_ozone.h" | 53 #include "ui/ozone/public/surface_factory_ozone.h" |
| 55 #elif defined(USE_X11) | 54 #elif defined(USE_X11) |
| 56 #include "content/browser/compositor/software_output_device_x11.h" | 55 #include "content/browser/compositor/software_output_device_x11.h" |
| 57 #elif defined(OS_MACOSX) | 56 #elif defined(OS_MACOSX) |
| 58 #include "content/browser/compositor/software_output_device_mac.h" | 57 #include "content/browser/compositor/software_output_device_mac.h" |
| 59 #endif | 58 #endif |
| 60 | 59 |
| 61 using cc::ContextProvider; | 60 using cc::ContextProvider; |
| 62 using gpu::gles2::GLES2Interface; | 61 using gpu::gles2::GLES2Interface; |
| 63 | 62 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 NOTREACHED(); | 114 NOTREACHED(); |
| 116 return scoped_ptr<cc::SoftwareOutputDevice>(); | 115 return scoped_ptr<cc::SoftwareOutputDevice>(); |
| 117 #endif | 116 #endif |
| 118 } | 117 } |
| 119 | 118 |
| 120 scoped_ptr<cc::OverlayCandidateValidator> CreateOverlayCandidateValidator( | 119 scoped_ptr<cc::OverlayCandidateValidator> CreateOverlayCandidateValidator( |
| 121 gfx::AcceleratedWidget widget) { | 120 gfx::AcceleratedWidget widget) { |
| 122 #if defined(USE_OZONE) | 121 #if defined(USE_OZONE) |
| 123 ui::OverlayCandidatesOzone* overlay_candidates = | 122 ui::OverlayCandidatesOzone* overlay_candidates = |
| 124 ui::SurfaceFactoryOzone::GetInstance()->GetOverlayCandidates(widget); | 123 ui::SurfaceFactoryOzone::GetInstance()->GetOverlayCandidates(widget); |
| 125 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 126 if (overlay_candidates && | 124 if (overlay_candidates && |
| 127 (command_line->HasSwitch(switches::kEnableHardwareOverlays) || | 125 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 128 command_line->HasSwitch(switches::kOzoneTestSingleOverlaySupport))) { | 126 switches::kEnableHardwareOverlays)) { |
| 129 return scoped_ptr<cc::OverlayCandidateValidator>( | 127 return scoped_ptr<cc::OverlayCandidateValidator>( |
| 130 new OverlayCandidateValidatorOzone(widget, overlay_candidates)); | 128 new OverlayCandidateValidatorOzone(widget, overlay_candidates)); |
| 131 } | 129 } |
| 132 #endif | 130 #endif |
| 133 return scoped_ptr<cc::OverlayCandidateValidator>(); | 131 return scoped_ptr<cc::OverlayCandidateValidator>(); |
| 134 } | 132 } |
| 135 | 133 |
| 136 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) { | 134 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) { |
| 137 #if defined(OS_CHROMEOS) | 135 #if defined(OS_CHROMEOS) |
| 138 // Software fallback does not happen on Chrome OS. | 136 // Software fallback does not happen on Chrome OS. |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 526 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
| 529 observer_list_, | 527 observer_list_, |
| 530 OnLostResources()); | 528 OnLostResources()); |
| 531 | 529 |
| 532 // Kill things that use the shared context before killing the shared context. | 530 // Kill things that use the shared context before killing the shared context. |
| 533 lost_gl_helper.reset(); | 531 lost_gl_helper.reset(); |
| 534 lost_shared_main_thread_contexts = NULL; | 532 lost_shared_main_thread_contexts = NULL; |
| 535 } | 533 } |
| 536 | 534 |
| 537 } // namespace content | 535 } // namespace content |
| OLD | NEW |