| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( | 571 gfx::RenderingWindowManager::GetInstance()->DoSetParentOnChild( |
| 572 compositor->widget()); | 572 compositor->widget()); |
| 573 #endif | 573 #endif |
| 574 | 574 |
| 575 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 575 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
| 576 begin_frame_source.get(), compositor->task_runner().get(), | 576 begin_frame_source.get(), compositor->task_runner().get(), |
| 577 display_output_surface->capabilities().max_frames_pending)); | 577 display_output_surface->capabilities().max_frames_pending)); |
| 578 | 578 |
| 579 // The Display owns and uses the |display_output_surface| created above. | 579 // The Display owns and uses the |display_output_surface| created above. |
| 580 data->display = base::MakeUnique<cc::Display>( | 580 data->display = base::MakeUnique<cc::Display>( |
| 581 surface_manager_.get(), HostSharedBitmapManager::current(), | 581 HostSharedBitmapManager::current(), |
| 582 BrowserGpuMemoryBufferManager::current(), | 582 BrowserGpuMemoryBufferManager::current(), |
| 583 compositor->GetRendererSettings(), | 583 compositor->GetRendererSettings(), std::move(begin_frame_source), |
| 584 compositor->surface_id_allocator()->client_id(), | 584 std::move(display_output_surface), std::move(scheduler), |
| 585 std::move(begin_frame_source), std::move(display_output_surface), | 585 base::MakeUnique<cc::TextureMailboxDeleter>( |
| 586 std::move(scheduler), base::MakeUnique<cc::TextureMailboxDeleter>( | 586 compositor->task_runner().get())); |
| 587 compositor->task_runner().get())); | |
| 588 | 587 |
| 589 // The |delegated_output_surface| is given back to the compositor, it | 588 // The |delegated_output_surface| is given back to the compositor, it |
| 590 // delegates to the Display as its root surface. Importantly, it shares the | 589 // delegates to the Display as its root surface. Importantly, it shares the |
| 591 // same ContextProvider as the Display's output surface. | 590 // same ContextProvider as the Display's output surface. |
| 592 std::unique_ptr<cc::SurfaceDisplayOutputSurface> delegated_output_surface( | 591 std::unique_ptr<cc::SurfaceDisplayOutputSurface> delegated_output_surface( |
| 593 vulkan_context_provider | 592 vulkan_context_provider |
| 594 ? new cc::SurfaceDisplayOutputSurface( | 593 ? new cc::SurfaceDisplayOutputSurface( |
| 595 surface_manager_.get(), compositor->surface_id_allocator(), | 594 surface_manager_.get(), compositor->surface_id_allocator(), |
| 596 data->display.get(), | 595 data->display.get(), |
| 597 static_cast<scoped_refptr<cc::VulkanContextProvider>>( | 596 static_cast<scoped_refptr<cc::VulkanContextProvider>>( |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 894 shared_vulkan_context_provider_ = | 893 shared_vulkan_context_provider_ = |
| 895 cc::VulkanInProcessContextProvider::Create(); | 894 cc::VulkanInProcessContextProvider::Create(); |
| 896 } | 895 } |
| 897 | 896 |
| 898 shared_vulkan_context_provider_initialized_ = true; | 897 shared_vulkan_context_provider_initialized_ = true; |
| 899 } | 898 } |
| 900 return shared_vulkan_context_provider_; | 899 return shared_vulkan_context_provider_; |
| 901 } | 900 } |
| 902 | 901 |
| 903 } // namespace content | 902 } // namespace content |
| OLD | NEW |