summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration/compositor/vulkan-server/vulkanwrapper.h
blob: a2f55fd75e6a1272ff0786a3d74185351eee6f69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef VULKANWRAPPER_H
#define VULKANWRAPPER_H

#include <QOpenGLContext>

QT_BEGIN_NAMESPACE

class VulkanWrapper;
struct VulkanImageWrapper;
class VulkanWrapperPrivate;

class QOpenGLContext;
class QImage;

class VulkanWrapper
{
public:
    VulkanWrapper(QOpenGLContext *glContext);

    VulkanImageWrapper *createTextureImage(const QImage &img);
    VulkanImageWrapper *createTextureImageFromData(const uchar *pixels, uint bufferSize, const QSize &size, uint glInternalFormat);
    int getImageInfo(const VulkanImageWrapper *imgWrapper, int *memSize, int *w = nullptr, int *h = nullptr);
    void freeTextureImage(VulkanImageWrapper *imageWrapper);

private:
    VulkanWrapperPrivate *d_ptr;
};

QT_END_NAMESPACE

#endif // VULKANWRAPPER_H