| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 #endif | 230 #endif |
| 231 } | 231 } |
| 232 | 232 |
| 233 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 233 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 234 CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) { | 234 CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) { |
| 235 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 235 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 236 validator; | 236 validator; |
| 237 #if defined(USE_OZONE) | 237 #if defined(USE_OZONE) |
| 238 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 238 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 239 if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { | 239 if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { |
| 240 std::string enable_overlay_flag = |
| 241 command_line->GetSwitchValueASCII(switches::kEnableHardwareOverlays); |
| 240 std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates = | 242 std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates = |
| 241 ui::OzonePlatform::GetInstance() | 243 ui::OzonePlatform::GetInstance() |
| 242 ->GetOverlayManager() | 244 ->GetOverlayManager() |
| 243 ->CreateOverlayCandidates(widget); | 245 ->CreateOverlayCandidates(widget); |
| 244 validator.reset( | 246 validator.reset( |
| 245 new display_compositor::CompositorOverlayCandidateValidatorOzone( | 247 new display_compositor::CompositorOverlayCandidateValidatorOzone( |
| 246 std::move(overlay_candidates))); | 248 std::move(overlay_candidates), |
| 249 enable_overlay_flag == "single-fullscreen")); |
| 247 } | 250 } |
| 248 #elif defined(OS_MACOSX) | 251 #elif defined(OS_MACOSX) |
| 249 // Overlays are only supported through the remote layer API. | 252 // Overlays are only supported through the remote layer API. |
| 250 if (ui::RemoteLayerAPISupported()) { | 253 if (ui::RemoteLayerAPISupported()) { |
| 251 static bool overlays_disabled_at_command_line = | 254 static bool overlays_disabled_at_command_line = |
| 252 IsCALayersDisabledFromCommandLine(); | 255 IsCALayersDisabledFromCommandLine(); |
| 253 const bool ca_layers_disabled = | 256 const bool ca_layers_disabled = |
| 254 overlays_disabled_at_command_line || | 257 overlays_disabled_at_command_line || |
| 255 GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( | 258 GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( |
| 256 gpu::DISABLE_OVERLAY_CA_LAYERS); | 259 gpu::DISABLE_OVERLAY_CA_LAYERS); |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 891 shared_vulkan_context_provider_ = | 894 shared_vulkan_context_provider_ = |
| 892 cc::VulkanInProcessContextProvider::Create(); | 895 cc::VulkanInProcessContextProvider::Create(); |
| 893 } | 896 } |
| 894 | 897 |
| 895 shared_vulkan_context_provider_initialized_ = true; | 898 shared_vulkan_context_provider_initialized_ = true; |
| 896 } | 899 } |
| 897 return shared_vulkan_context_provider_; | 900 return shared_vulkan_context_provider_; |
| 898 } | 901 } |
| 899 | 902 |
| 900 } // namespace content | 903 } // namespace content |
| OLD | NEW |