xref: /aosp_15_r20/external/swiftshader/src/WSI/HeadlessSurfaceKHR.cpp (revision 03ce13f70fcc45d86ee91b7ee4cab1936a95046e)
1 // Copyright 2021 The SwiftShader Authors. All Rights Reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 //    http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #include "HeadlessSurfaceKHR.hpp"
16 
17 namespace vk {
18 
HeadlessSurfaceKHR(const VkHeadlessSurfaceCreateInfoEXT * pCreateInfo,void * mem)19 HeadlessSurfaceKHR::HeadlessSurfaceKHR(const VkHeadlessSurfaceCreateInfoEXT *pCreateInfo, void *mem)
20 {
21 }
22 
ComputeRequiredAllocationSize(const VkHeadlessSurfaceCreateInfoEXT * pCreateInfo)23 size_t HeadlessSurfaceKHR::ComputeRequiredAllocationSize(const VkHeadlessSurfaceCreateInfoEXT *pCreateInfo)
24 {
25 	return 0;
26 }
27 
destroySurface(const VkAllocationCallbacks * pAllocator)28 void HeadlessSurfaceKHR::destroySurface(const VkAllocationCallbacks *pAllocator)
29 {
30 }
31 
getSurfaceCapabilities(const void * pSurfaceInfoPNext,VkSurfaceCapabilitiesKHR * pSurfaceCapabilities,void * pSurfaceCapabilitiesPNext) const32 VkResult HeadlessSurfaceKHR::getSurfaceCapabilities(const void *pSurfaceInfoPNext, VkSurfaceCapabilitiesKHR *pSurfaceCapabilities, void *pSurfaceCapabilitiesPNext) const
33 {
34 	pSurfaceCapabilities->currentExtent = { 1280, 720 };
35 	pSurfaceCapabilities->minImageExtent = { 0, 0 };
36 	pSurfaceCapabilities->maxImageExtent = { 3840, 2160 };
37 
38 	setCommonSurfaceCapabilities(pSurfaceInfoPNext, pSurfaceCapabilities, pSurfaceCapabilitiesPNext);
39 	return VK_SUCCESS;
40 }
41 
attachImage(PresentImage * image)42 void HeadlessSurfaceKHR::attachImage(PresentImage *image)
43 {
44 }
45 
detachImage(PresentImage * image)46 void HeadlessSurfaceKHR::detachImage(PresentImage *image)
47 {
48 }
49 
present(PresentImage * image)50 VkResult HeadlessSurfaceKHR::present(PresentImage *image)
51 {
52 	return VK_SUCCESS;
53 }
54 
55 }  // namespace vk
56