| 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 const scoped_refptr<cc::VulkanContextProvider>& context, | 14 const scoped_refptr<cc::VulkanContextProvider>& context, |
| 15 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 15 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 16 base::SingleThreadTaskRunner* task_runner) | 16 cc::SyntheticBeginFrameSource* begin_frame_source) |
| 17 : BrowserCompositorOutputSurface(context, vsync_manager, task_runner) {} | 17 : BrowserCompositorOutputSurface(context, |
| 18 vsync_manager, |
| 19 begin_frame_source) {} |
| 18 | 20 |
| 19 VulkanBrowserCompositorOutputSurface::~VulkanBrowserCompositorOutputSurface() { | 21 VulkanBrowserCompositorOutputSurface::~VulkanBrowserCompositorOutputSurface() { |
| 20 Destroy(); | 22 Destroy(); |
| 21 } | 23 } |
| 22 | 24 |
| 23 bool VulkanBrowserCompositorOutputSurface::Initialize( | 25 bool VulkanBrowserCompositorOutputSurface::Initialize( |
| 24 gfx::AcceleratedWidget widget) { | 26 gfx::AcceleratedWidget widget) { |
| 25 DCHECK(!surface_); | 27 DCHECK(!surface_); |
| 26 std::unique_ptr<gpu::VulkanSurface> surface( | 28 std::unique_ptr<gpu::VulkanSurface> surface( |
| 27 gpu::VulkanSurface::CreateViewSurface(widget)); | 29 gpu::VulkanSurface::CreateViewSurface(widget)); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 50 } | 52 } |
| 51 | 53 |
| 52 void VulkanBrowserCompositorOutputSurface::SwapBuffers( | 54 void VulkanBrowserCompositorOutputSurface::SwapBuffers( |
| 53 cc::CompositorFrame* frame) { | 55 cc::CompositorFrame* frame) { |
| 54 surface_->SwapBuffers(); | 56 surface_->SwapBuffers(); |
| 55 PostSwapBuffersComplete(); | 57 PostSwapBuffersComplete(); |
| 56 client_->DidSwapBuffers(); | 58 client_->DidSwapBuffers(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 } // namespace content | 61 } // namespace content |
| OLD | NEW |