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 "gpu/vulkan/vulkan_surface.h" | 5 #include "gpu/vulkan/vulkan_surface.h" |
6 | 6 |
7 #include <vulkan/vulkan.h> | 7 #include <vulkan/vulkan.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "gpu/vulkan/vulkan_command_buffer.h" | 10 #include "gpu/vulkan/vulkan_command_buffer.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 protected: | 141 protected: |
142 gfx::AcceleratedWidget window_; | 142 gfx::AcceleratedWidget window_; |
143 gfx::Size size_; | 143 gfx::Size size_; |
144 VkSurfaceKHR surface_ = VK_NULL_HANDLE; | 144 VkSurfaceKHR surface_ = VK_NULL_HANDLE; |
145 VkSurfaceFormatKHR surface_format_ = {}; | 145 VkSurfaceFormatKHR surface_format_ = {}; |
146 VulkanDeviceQueue* device_queue_ = nullptr; | 146 VulkanDeviceQueue* device_queue_ = nullptr; |
147 VulkanSwapChain swap_chain_; | 147 VulkanSwapChain swap_chain_; |
148 }; | 148 }; |
149 | 149 |
150 // static | |
151 bool VulkanSurface::InitializeOneOff() { | |
152 if (!InitializeVulkan()) | |
153 return false; | |
154 | |
155 return true; | |
156 } | |
157 | |
158 VulkanSurface::~VulkanSurface() {} | 150 VulkanSurface::~VulkanSurface() {} |
159 | 151 |
160 // static | 152 // static |
161 std::unique_ptr<VulkanSurface> VulkanSurface::CreateViewSurface( | 153 std::unique_ptr<VulkanSurface> VulkanSurface::CreateViewSurface( |
162 gfx::AcceleratedWidget window) { | 154 gfx::AcceleratedWidget window) { |
163 return std::unique_ptr<VulkanSurface>(new VulkanWSISurface(window)); | 155 return std::unique_ptr<VulkanSurface>(new VulkanWSISurface(window)); |
164 } | 156 } |
165 | 157 |
166 VulkanSurface::VulkanSurface() {} | 158 VulkanSurface::VulkanSurface() {} |
167 | 159 |
168 } // namespace gpu | 160 } // namespace gpu |
OLD | NEW |