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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 validator = CreateOverlayCandidateValidator(compositor->widget()); | 532 validator = CreateOverlayCandidateValidator(compositor->widget()); |
533 #endif | 533 #endif |
534 if (!use_mus) { | 534 if (!use_mus) { |
535 display_output_surface = | 535 display_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 support_stencil); | 538 support_stencil); |
539 } else { | 539 } else { |
540 #if defined(USE_AURA) | 540 #if defined(USE_AURA) |
541 std::unique_ptr<MusBrowserCompositorOutputSurface> mus_output_surface; | 541 std::unique_ptr<MusBrowserCompositorOutputSurface> mus_output_surface; |
542 if (compositor->window()) { | 542 aura::WindowTreeHost* host = |
543 // TODO(mfomitchev): Remove this clause once we complete the switch | 543 aura::WindowTreeHost::GetForAcceleratedWidget( |
544 // to Aura-Mus. | 544 compositor->widget()); |
545 mus_output_surface = | 545 mus_output_surface = |
546 base::MakeUnique<MusBrowserCompositorOutputSurface>( | 546 base::MakeUnique<MusBrowserCompositorOutputSurface>( |
547 compositor->window(), context_provider, | 547 host->window(), context_provider, GetGpuMemoryBufferManager(), |
548 GetGpuMemoryBufferManager(), vsync_callback, | 548 vsync_callback, std::move(validator)); |
549 std::move(validator)); | |
550 } else { | |
551 aura::WindowTreeHost* host = | |
552 aura::WindowTreeHost::GetForAcceleratedWidget( | |
553 compositor->widget()); | |
554 mus_output_surface = | |
555 base::MakeUnique<MusBrowserCompositorOutputSurface>( | |
556 host->window(), context_provider, | |
557 GetGpuMemoryBufferManager(), vsync_callback, | |
558 std::move(validator)); | |
559 } | |
560 // We use the ExternalBeginFrameSource provided by the output surface | 549 // We use the ExternalBeginFrameSource provided by the output surface |
561 // instead of our own synthetic one. | 550 // instead of our own synthetic one. |
562 synthetic_begin_frame_source.reset(); | 551 synthetic_begin_frame_source.reset(); |
563 begin_frame_source = mus_output_surface->GetBeginFrameSource(); | 552 begin_frame_source = mus_output_surface->GetBeginFrameSource(); |
564 DCHECK(begin_frame_source); | 553 DCHECK(begin_frame_source); |
565 display_output_surface = std::move(mus_output_surface); | 554 display_output_surface = std::move(mus_output_surface); |
566 #else | 555 #else |
567 NOTREACHED(); | 556 NOTREACHED(); |
568 #endif | 557 #endif |
569 } | 558 } |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 shared_vulkan_context_provider_ = | 911 shared_vulkan_context_provider_ = |
923 cc::VulkanInProcessContextProvider::Create(); | 912 cc::VulkanInProcessContextProvider::Create(); |
924 } | 913 } |
925 | 914 |
926 shared_vulkan_context_provider_initialized_ = true; | 915 shared_vulkan_context_provider_initialized_ = true; |
927 } | 916 } |
928 return shared_vulkan_context_provider_; | 917 return shared_vulkan_context_provider_; |
929 } | 918 } |
930 | 919 |
931 } // namespace content | 920 } // namespace content |
OLD | NEW |