blob: 56540fe495570764d962f02e912f51d6b76cdac2 [file] [log] [blame]
Hernan Liatisc6eb41b2019-02-22 11:12:59 -08001// Copyright 2018 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#ifndef SWIFTSHADER_XLIBSURFACEKHR_HPP
16#define SWIFTSHADER_XLIBSURFACEKHR_HPP
17
Nicolas Capens37c024a2019-03-01 13:39:57 -050018#include "Vulkan/VkObject.hpp"
Hernan Liatisc6eb41b2019-02-22 11:12:59 -080019#include "libX11.hpp"
20#include "VkSurfaceKHR.hpp"
21
22namespace vk {
23
24class XlibSurfaceKHR : public SurfaceKHR, public ObjectBase<XlibSurfaceKHR, VkSurfaceKHR> {
25public:
26 XlibSurfaceKHR(const VkXlibSurfaceCreateInfoKHR *pCreateInfo, void *mem);
27
28 ~XlibSurfaceKHR() = delete;
29
30 void destroySurface(const VkAllocationCallbacks *pAllocator) override;
31
32 static size_t ComputeRequiredAllocationSize(const VkXlibSurfaceCreateInfoKHR *pCreateInfo);
33
34 void getSurfaceCapabilities(VkSurfaceCapabilitiesKHR *pSurfaceCapabilities) const override;
35
36private:
37 Display *pDisplay;
38 Window window;
39
40};
41
42}
43#endif //SWIFTSHADER_XLIBSURFACEKHR_HPP