| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "ui/compositor/compositor.h" | 52 #include "ui/compositor/compositor.h" |
| 53 #include "ui/compositor/compositor_constants.h" | 53 #include "ui/compositor/compositor_constants.h" |
| 54 #include "ui/compositor/compositor_switches.h" | 54 #include "ui/compositor/compositor_switches.h" |
| 55 #include "ui/compositor/layer.h" | 55 #include "ui/compositor/layer.h" |
| 56 #include "ui/display/types/display_snapshot.h" | 56 #include "ui/display/types/display_snapshot.h" |
| 57 #include "ui/gfx/geometry/size.h" | 57 #include "ui/gfx/geometry/size.h" |
| 58 | 58 |
| 59 #if defined(USE_AURA) | 59 #if defined(USE_AURA) |
| 60 #include "content/browser/compositor/mus_browser_compositor_output_surface.h" | 60 #include "content/browser/compositor/mus_browser_compositor_output_surface.h" |
| 61 #include "content/public/common/service_manager_connection.h" | 61 #include "content/public/common/service_manager_connection.h" |
| 62 #include "ui/aura/window_tree_host.h" |
| 62 #endif | 63 #endif |
| 63 | 64 |
| 64 #if defined(OS_WIN) | 65 #if defined(OS_WIN) |
| 65 #include "content/browser/compositor/software_output_device_win.h" | 66 #include "content/browser/compositor/software_output_device_win.h" |
| 66 #include "ui/gfx/win/rendering_window_manager.h" | 67 #include "ui/gfx/win/rendering_window_manager.h" |
| 67 #elif defined(USE_OZONE) | 68 #elif defined(USE_OZONE) |
| 68 #include "components/display_compositor/compositor_overlay_candidate_validator_o
zone.h" | 69 #include "components/display_compositor/compositor_overlay_candidate_validator_o
zone.h" |
| 69 #include "content/browser/compositor/software_output_device_ozone.h" | 70 #include "content/browser/compositor/software_output_device_ozone.h" |
| 70 #include "ui/ozone/public/overlay_candidates_ozone.h" | 71 #include "ui/ozone/public/overlay_candidates_ozone.h" |
| 71 #include "ui/ozone/public/overlay_manager_ozone.h" | 72 #include "ui/ozone/public/overlay_manager_ozone.h" |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 if (!use_mus) | 505 if (!use_mus) |
| 505 validator = CreateOverlayCandidateValidator(compositor->widget()); | 506 validator = CreateOverlayCandidateValidator(compositor->widget()); |
| 506 #endif | 507 #endif |
| 507 if (!use_mus) { | 508 if (!use_mus) { |
| 508 display_output_surface = | 509 display_output_surface = |
| 509 base::MakeUnique<GpuBrowserCompositorOutputSurface>( | 510 base::MakeUnique<GpuBrowserCompositorOutputSurface>( |
| 510 context_provider, compositor->vsync_manager(), | 511 context_provider, compositor->vsync_manager(), |
| 511 begin_frame_source.get(), std::move(validator)); | 512 begin_frame_source.get(), std::move(validator)); |
| 512 } else { | 513 } else { |
| 513 #if defined(USE_AURA) | 514 #if defined(USE_AURA) |
| 514 display_output_surface = | 515 if (compositor->window()) { |
| 515 base::MakeUnique<MusBrowserCompositorOutputSurface>( | 516 // TODO(mfomitchev): Remove this clause once we complete the switch |
| 516 compositor->window(), context_provider, | 517 // to Aura-Mus. |
| 517 GetGpuMemoryBufferManager(), compositor->vsync_manager(), | 518 display_output_surface = |
| 518 begin_frame_source.get(), std::move(validator)); | 519 base::MakeUnique<MusBrowserCompositorOutputSurface>( |
| 520 compositor->window(), context_provider, |
| 521 GetGpuMemoryBufferManager(), compositor->vsync_manager(), |
| 522 begin_frame_source.get(), std::move(validator)); |
| 523 } else { |
| 524 aura::WindowTreeHost* host = |
| 525 aura::WindowTreeHost::GetForAcceleratedWidget( |
| 526 compositor->widget()); |
| 527 display_output_surface = |
| 528 base::MakeUnique<MusBrowserCompositorOutputSurface>( |
| 529 host->window(), context_provider, |
| 530 GetGpuMemoryBufferManager(), compositor->vsync_manager(), |
| 531 begin_frame_source.get(), std::move(validator)); |
| 532 } |
| 519 #else | 533 #else |
| 520 NOTREACHED(); | 534 NOTREACHED(); |
| 521 #endif | 535 #endif |
| 522 } | 536 } |
| 523 } | 537 } |
| 524 } | 538 } |
| 525 } | 539 } |
| 526 | 540 |
| 527 data->display_output_surface = display_output_surface.get(); | 541 data->display_output_surface = display_output_surface.get(); |
| 528 data->begin_frame_source = begin_frame_source.get(); | 542 data->begin_frame_source = begin_frame_source.get(); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 shared_vulkan_context_provider_ = | 882 shared_vulkan_context_provider_ = |
| 869 cc::VulkanInProcessContextProvider::Create(); | 883 cc::VulkanInProcessContextProvider::Create(); |
| 870 } | 884 } |
| 871 | 885 |
| 872 shared_vulkan_context_provider_initialized_ = true; | 886 shared_vulkan_context_provider_initialized_ = true; |
| 873 } | 887 } |
| 874 return shared_vulkan_context_provider_; | 888 return shared_vulkan_context_provider_; |
| 875 } | 889 } |
| 876 | 890 |
| 877 } // namespace content | 891 } // namespace content |
| OLD | NEW |