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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 NOTREACHED(); | 211 NOTREACHED(); |
212 return std::unique_ptr<cc::SoftwareOutputDevice>(); | 212 return std::unique_ptr<cc::SoftwareOutputDevice>(); |
213 #endif | 213 #endif |
214 } | 214 } |
215 | 215 |
216 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 216 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
217 CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) { | 217 CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) { |
218 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 218 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
219 validator; | 219 validator; |
220 #if defined(USE_OZONE) | 220 #if defined(USE_OZONE) |
221 std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates = | |
222 ui::OzonePlatform::GetInstance() | |
223 ->GetOverlayManager() | |
224 ->CreateOverlayCandidates(widget); | |
225 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 221 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
226 if (overlay_candidates && | 222 if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { |
227 (command_line->HasSwitch(switches::kEnableHardwareOverlays) || | 223 std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates = |
228 command_line->HasSwitch(switches::kOzoneTestSingleOverlaySupport))) { | 224 ui::OzonePlatform::GetInstance() |
| 225 ->GetOverlayManager() |
| 226 ->CreateOverlayCandidates(widget); |
229 validator.reset( | 227 validator.reset( |
230 new display_compositor::CompositorOverlayCandidateValidatorOzone( | 228 new display_compositor::CompositorOverlayCandidateValidatorOzone( |
231 std::move(overlay_candidates))); | 229 std::move(overlay_candidates))); |
232 } | 230 } |
233 #elif defined(OS_MACOSX) | 231 #elif defined(OS_MACOSX) |
234 // Overlays are only supported through the remote layer API. | 232 // Overlays are only supported through the remote layer API. |
235 if (ui::RemoteLayerAPISupported()) { | 233 if (ui::RemoteLayerAPISupported()) { |
236 static bool overlays_disabled_at_command_line = | 234 static bool overlays_disabled_at_command_line = |
237 IsCALayersDisabledFromCommandLine(); | 235 IsCALayersDisabledFromCommandLine(); |
238 const bool ca_layers_disabled = | 236 const bool ca_layers_disabled = |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 shared_vulkan_context_provider_ = | 814 shared_vulkan_context_provider_ = |
817 cc::VulkanInProcessContextProvider::Create(); | 815 cc::VulkanInProcessContextProvider::Create(); |
818 } | 816 } |
819 | 817 |
820 shared_vulkan_context_provider_initialized_ = true; | 818 shared_vulkan_context_provider_initialized_ = true; |
821 } | 819 } |
822 return shared_vulkan_context_provider_; | 820 return shared_vulkan_context_provider_; |
823 } | 821 } |
824 | 822 |
825 } // namespace content | 823 } // namespace content |
OLD | NEW |