| 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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( | 547 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( |
| 548 compositor->widget()); | 548 compositor->widget()); |
| 549 #endif | 549 #endif |
| 550 | 550 |
| 551 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 551 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| 552 begin_frame_source.get(), compositor->task_runner().get(), | 552 begin_frame_source.get(), compositor->task_runner().get(), |
| 553 display_output_surface->capabilities().max_frames_pending)); | 553 display_output_surface->capabilities().max_frames_pending)); |
| 554 | 554 |
| 555 // The Display owns and uses the |display_output_surface| created above. | 555 // The Display owns and uses the |display_output_surface| created above. |
| 556 data->display = base::MakeUnique<cc::Display>( | 556 data->display = base::MakeUnique<cc::Display>( |
| 557 HostSharedBitmapManager::current(), | 557 HostSharedBitmapManager::current(), GetGpuMemoryBufferManager(), |
| 558 GetGpuMemoryBufferManager(), | 558 compositor->GetRendererSettings(), compositor->frame_sink_id(), |
| 559 compositor->GetRendererSettings(), std::move(begin_frame_source), | 559 std::move(begin_frame_source), std::move(display_output_surface), |
| 560 std::move(display_output_surface), std::move(scheduler), | 560 std::move(scheduler), base::MakeUnique<cc::TextureMailboxDeleter>( |
| 561 base::MakeUnique<cc::TextureMailboxDeleter>( | 561 compositor->task_runner().get())); |
| 562 compositor->task_runner().get())); | |
| 563 | 562 |
| 564 // The |delegated_output_surface| is given back to the compositor, it | 563 // The |delegated_output_surface| is given back to the compositor, it |
| 565 // delegates to the Display as its root surface. Importantly, it shares the | 564 // delegates to the Display as its root surface. Importantly, it shares the |
| 566 // same ContextProvider as the Display's output surface. | 565 // same ContextProvider as the Display's output surface. |
| 567 auto compositor_frame_sink = | 566 auto compositor_frame_sink = |
| 568 vulkan_context_provider | 567 vulkan_context_provider |
| 569 ? base::MakeUnique<cc::DirectCompositorFrameSink>( | 568 ? base::MakeUnique<cc::DirectCompositorFrameSink>( |
| 570 compositor->frame_sink_id(), surface_manager_.get(), | 569 compositor->frame_sink_id(), surface_manager_.get(), |
| 571 data->display.get(), | 570 data->display.get(), |
| 572 static_cast<scoped_refptr<cc::VulkanContextProvider>>( | 571 static_cast<scoped_refptr<cc::VulkanContextProvider>>( |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 shared_vulkan_context_provider_ = | 881 shared_vulkan_context_provider_ = |
| 883 cc::VulkanInProcessContextProvider::Create(); | 882 cc::VulkanInProcessContextProvider::Create(); |
| 884 } | 883 } |
| 885 | 884 |
| 886 shared_vulkan_context_provider_initialized_ = true; | 885 shared_vulkan_context_provider_initialized_ = true; |
| 887 } | 886 } |
| 888 return shared_vulkan_context_provider_; | 887 return shared_vulkan_context_provider_; |
| 889 } | 888 } |
| 890 | 889 |
| 891 } // namespace content | 890 } // namespace content |
| OLD | NEW |