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