| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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/vulkan_browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/vulkan_browser_compositor_output_surface.h" |
| 6 | 6 |
| 7 #include "cc/output/output_surface_client.h" | 7 #include "cc/output/output_surface_client.h" |
| 8 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 9 #include "gpu/vulkan/vulkan_surface.h" | 9 #include "gpu/vulkan/vulkan_surface.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 VulkanBrowserCompositorOutputSurface::VulkanBrowserCompositorOutputSurface( | 13 VulkanBrowserCompositorOutputSurface::VulkanBrowserCompositorOutputSurface( |
| 14 scoped_refptr<cc::VulkanContextProvider> context, | 14 scoped_refptr<cc::VulkanContextProvider> context, |
| 15 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 15 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, |
| 16 cc::SyntheticBeginFrameSource* begin_frame_source) | 16 cc::SyntheticBeginFrameSource* begin_frame_source) |
| 17 : BrowserCompositorOutputSurface(std::move(context), | 17 : BrowserCompositorOutputSurface(std::move(context), |
| 18 std::move(vsync_manager), | 18 update_vsync_parameters_callback, |
| 19 begin_frame_source), | 19 begin_frame_source), |
| 20 weak_ptr_factory_(this) {} | 20 weak_ptr_factory_(this) {} |
| 21 | 21 |
| 22 VulkanBrowserCompositorOutputSurface::~VulkanBrowserCompositorOutputSurface() { | 22 VulkanBrowserCompositorOutputSurface::~VulkanBrowserCompositorOutputSurface() { |
| 23 Destroy(); | 23 Destroy(); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool VulkanBrowserCompositorOutputSurface::Initialize( | 26 bool VulkanBrowserCompositorOutputSurface::Initialize( |
| 27 gfx::AcceleratedWidget widget) { | 27 gfx::AcceleratedWidget widget) { |
| 28 DCHECK(!surface_); | 28 DCHECK(!surface_); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 base::Bind(&VulkanBrowserCompositorOutputSurface::SwapBuffersAck, | 101 base::Bind(&VulkanBrowserCompositorOutputSurface::SwapBuffersAck, |
| 102 weak_ptr_factory_.GetWeakPtr())); | 102 weak_ptr_factory_.GetWeakPtr())); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void VulkanBrowserCompositorOutputSurface::SwapBuffersAck() { | 105 void VulkanBrowserCompositorOutputSurface::SwapBuffersAck() { |
| 106 DCHECK(client_); | 106 DCHECK(client_); |
| 107 client_->DidReceiveSwapBuffersAck(); | 107 client_->DidReceiveSwapBuffersAck(); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace content | 110 } // namespace content |
| OLD | NEW |