| 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( | 533 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( |
| 534 compositor->widget()); | 534 compositor->widget()); |
| 535 #endif | 535 #endif |
| 536 | 536 |
| 537 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 537 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| 538 begin_frame_source.get(), compositor->task_runner().get(), | 538 begin_frame_source.get(), compositor->task_runner().get(), |
| 539 display_output_surface->capabilities().max_frames_pending)); | 539 display_output_surface->capabilities().max_frames_pending)); |
| 540 | 540 |
| 541 // The Display owns and uses the |display_output_surface| created above. | 541 // The Display owns and uses the |display_output_surface| created above. |
| 542 data->display = base::MakeUnique<cc::Display>( | 542 data->display = base::MakeUnique<cc::Display>( |
| 543 HostSharedBitmapManager::current(), | 543 HostSharedBitmapManager::current(), GetGpuMemoryBufferManager(), |
| 544 GetGpuMemoryBufferManager(), | 544 compositor->GetRendererSettings(), compositor->frame_sink_id(), |
| 545 compositor->GetRendererSettings(), std::move(begin_frame_source), | 545 std::move(begin_frame_source), std::move(display_output_surface), |
| 546 std::move(display_output_surface), std::move(scheduler), | 546 std::move(scheduler), base::MakeUnique<cc::TextureMailboxDeleter>( |
| 547 base::MakeUnique<cc::TextureMailboxDeleter>( | 547 compositor->task_runner().get())); |
| 548 compositor->task_runner().get())); | |
| 549 | 548 |
| 550 // The |delegated_output_surface| is given back to the compositor, it | 549 // The |delegated_output_surface| is given back to the compositor, it |
| 551 // delegates to the Display as its root surface. Importantly, it shares the | 550 // delegates to the Display as its root surface. Importantly, it shares the |
| 552 // same ContextProvider as the Display's output surface. | 551 // same ContextProvider as the Display's output surface. |
| 553 auto compositor_frame_sink = | 552 auto compositor_frame_sink = |
| 554 vulkan_context_provider | 553 vulkan_context_provider |
| 555 ? base::MakeUnique<cc::DirectCompositorFrameSink>( | 554 ? base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 556 compositor->frame_sink_id(), surface_manager_.get(), | 555 compositor->frame_sink_id(), surface_manager_.get(), |
| 557 data->display.get(), | 556 data->display.get(), |
| 558 static_cast<scoped_refptr<cc::VulkanContextProvider>>( | 557 static_cast<scoped_refptr<cc::VulkanContextProvider>>( |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 shared_vulkan_context_provider_ = | 867 shared_vulkan_context_provider_ = |
| 869 cc::VulkanInProcessContextProvider::Create(); | 868 cc::VulkanInProcessContextProvider::Create(); |
| 870 } | 869 } |
| 871 | 870 |
| 872 shared_vulkan_context_provider_initialized_ = true; | 871 shared_vulkan_context_provider_initialized_ = true; |
| 873 } | 872 } |
| 874 return shared_vulkan_context_provider_; | 873 return shared_vulkan_context_provider_; |
| 875 } | 874 } |
| 876 | 875 |
| 877 } // namespace content | 876 } // namespace content |
| OLD | NEW |