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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( | 271 GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive( |
272 gpu::DISABLE_OVERLAY_CA_LAYERS); | 272 gpu::DISABLE_OVERLAY_CA_LAYERS); |
273 validator.reset( | 273 validator.reset( |
274 new display_compositor::CompositorOverlayCandidateValidatorMac( | 274 new display_compositor::CompositorOverlayCandidateValidatorMac( |
275 ca_layers_disabled)); | 275 ca_layers_disabled)); |
276 } | 276 } |
277 #elif defined(OS_ANDROID) | 277 #elif defined(OS_ANDROID) |
278 validator.reset( | 278 validator.reset( |
279 new display_compositor::CompositorOverlayCandidateValidatorAndroid()); | 279 new display_compositor::CompositorOverlayCandidateValidatorAndroid()); |
280 #elif defined(OS_WIN) | 280 #elif defined(OS_WIN) |
281 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 281 validator = base::MakeUnique< |
282 if (command_line->HasSwitch(switches::kEnableHardwareOverlays)) { | 282 display_compositor::CompositorOverlayCandidateValidatorWin>(); |
283 validator = base::MakeUnique< | |
284 display_compositor::CompositorOverlayCandidateValidatorWin>(); | |
285 } | |
286 #endif | 283 #endif |
287 | 284 |
288 return validator; | 285 return validator; |
289 } | 286 } |
290 | 287 |
291 static bool ShouldCreateGpuCompositorFrameSink(ui::Compositor* compositor) { | 288 static bool ShouldCreateGpuCompositorFrameSink(ui::Compositor* compositor) { |
292 #if defined(OS_CHROMEOS) | 289 #if defined(OS_CHROMEOS) |
293 // Software fallback does not happen on Chrome OS. | 290 // Software fallback does not happen on Chrome OS. |
294 return true; | 291 return true; |
295 #endif | 292 #endif |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 CreateOverlayCandidateValidator(compositor->widget()), | 518 CreateOverlayCandidateValidator(compositor->widget()), |
522 GL_TEXTURE_2D, GL_RGB, | 519 GL_TEXTURE_2D, GL_RGB, |
523 display::DisplaySnapshot::PrimaryFormat(), | 520 display::DisplaySnapshot::PrimaryFormat(), |
524 GetGpuMemoryBufferManager()); | 521 GetGpuMemoryBufferManager()); |
525 gpu_vsync_control = gpu_output_surface.get(); | 522 gpu_vsync_control = gpu_output_surface.get(); |
526 display_output_surface = std::move(gpu_output_surface); | 523 display_output_surface = std::move(gpu_output_surface); |
527 #endif | 524 #endif |
528 } else { | 525 } else { |
529 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 526 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
530 validator; | 527 validator; |
531 #if !defined(OS_MACOSX) | 528 #if defined(OS_WIN) |
| 529 if (capabilities.dc_layers) |
| 530 validator = CreateOverlayCandidateValidator(compositor->widget()); |
| 531 #elif !defined(OS_MACOSX) |
532 // Overlays are only supported on surfaceless output surfaces on Mac. | 532 // Overlays are only supported on surfaceless output surfaces on Mac. |
533 validator = CreateOverlayCandidateValidator(compositor->widget()); | 533 validator = CreateOverlayCandidateValidator(compositor->widget()); |
534 #endif | 534 #endif |
535 auto gpu_output_surface = | 535 auto gpu_output_surface = |
536 base::MakeUnique<GpuBrowserCompositorOutputSurface>( | 536 base::MakeUnique<GpuBrowserCompositorOutputSurface>( |
537 context_provider, vsync_callback, std::move(validator)); | 537 context_provider, vsync_callback, std::move(validator)); |
538 gpu_vsync_control = gpu_output_surface.get(); | 538 gpu_vsync_control = gpu_output_surface.get(); |
539 display_output_surface = std::move(gpu_output_surface); | 539 display_output_surface = std::move(gpu_output_surface); |
540 } | 540 } |
541 } | 541 } |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 shared_vulkan_context_provider_ = | 923 shared_vulkan_context_provider_ = |
924 cc::VulkanInProcessContextProvider::Create(); | 924 cc::VulkanInProcessContextProvider::Create(); |
925 } | 925 } |
926 | 926 |
927 shared_vulkan_context_provider_initialized_ = true; | 927 shared_vulkan_context_provider_initialized_ = true; |
928 } | 928 } |
929 return shared_vulkan_context_provider_; | 929 return shared_vulkan_context_provider_; |
930 } | 930 } |
931 | 931 |
932 } // namespace content | 932 } // namespace content |
OLD | NEW |