Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qsgtexture_platform.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QSGTEXTURE_PLATFORM_H
6#define QSGTEXTURE_PLATFORM_H
7
8#include <QtCore/qnativeinterface.h>
9#include <QtQuick/qquickwindow.h>
10
11#if QT_CONFIG(opengl)
12#include <QtGui/qopengl.h>
13#endif
14
15#if QT_CONFIG(vulkan)
16#include <QtGui/qvulkaninstance.h>
17#endif
18
19#if QT_CONFIG(metal) || defined(Q_QDOC)
20# if defined(__OBJC__) || defined(Q_QDOC)
22# define QT_OBJC_PROTOCOL(protocol) id<protocol>
23# else
24 typedef struct objc_object *id;
25# define QT_OBJC_PROTOCOL(protocol) id
26# endif
27#endif
28
30
31namespace QNativeInterface {
32
33#if QT_CONFIG(opengl) || defined(Q_QDOC)
34struct Q_QUICK_EXPORT QSGOpenGLTexture
35{
36 QT_DECLARE_NATIVE_INTERFACE(QSGOpenGLTexture, 1, QSGTexture)
37 virtual GLuint nativeTexture() const = 0;
38 static QSGTexture *fromNative(GLuint textureId,
39 QQuickWindow *window,
40 const QSize &size,
41 QQuickWindow::CreateTextureOptions options = {});
42 static QSGTexture *fromNativeExternalOES(GLuint textureId,
43 QQuickWindow *window,
44 const QSize &size,
45 QQuickWindow::CreateTextureOptions options = {});
46};
47#endif
48
49#if defined(Q_OS_WIN) || defined(Q_QDOC)
50struct Q_QUICK_EXPORT QSGD3D11Texture
51{
52 QT_DECLARE_NATIVE_INTERFACE(QSGD3D11Texture, 1, QSGTexture)
53 virtual void *nativeTexture() const = 0;
54 static QSGTexture *fromNative(void *texture,
55 QQuickWindow *window,
56 const QSize &size,
57 QQuickWindow::CreateTextureOptions options = {});
58};
59struct Q_QUICK_EXPORT QSGD3D12Texture
60{
61 QT_DECLARE_NATIVE_INTERFACE(QSGD3D12Texture, 1, QSGTexture)
62 virtual void *nativeTexture() const = 0;
63 virtual int nativeResourceState() const = 0;
64 static QSGTexture *fromNative(void *texture,
65 int resourceState,
66 QQuickWindow *window,
67 const QSize &size,
68 QQuickWindow::CreateTextureOptions options = {});
69};
70#endif
71
72#if QT_CONFIG(metal) || defined(Q_QDOC)
73struct Q_QUICK_EXPORT QSGMetalTexture
74{
75 QT_DECLARE_NATIVE_INTERFACE(QSGMetalTexture, 1, QSGTexture)
76 virtual QT_OBJC_PROTOCOL(MTLTexture) nativeTexture() const = 0;
77 static QSGTexture *fromNative(QT_OBJC_PROTOCOL(MTLTexture) texture,
78 QQuickWindow *window,
79 const QSize &size,
80 QQuickWindow::CreateTextureOptions options = {});
81};
82#endif
83
84#if QT_CONFIG(vulkan) || defined(Q_QDOC)
85struct Q_QUICK_EXPORT QSGVulkanTexture
86{
87 QT_DECLARE_NATIVE_INTERFACE(QSGVulkanTexture, 1, QSGTexture)
88 virtual VkImage nativeImage() const = 0;
89 virtual VkImageLayout nativeImageLayout() const = 0;
90 static QSGTexture *fromNative(VkImage image,
91 VkImageLayout layout,
92 QQuickWindow *window,
93 const QSize &size,
94 QQuickWindow::CreateTextureOptions options = {});
95};
96#endif
97
98} // QNativeInterface
99
100QT_END_NAMESPACE
101
102#endif // QSGTEXTURE_PLATFORM_H
The QSGDynamicTexture class serves as a baseclass for dynamically changing textures,...
Definition qsgtexture.h:101
\inmodule QtQuick
Definition qsgtexture.h:21
Combined button and popup list for selecting options.
static void qt_debug_print_texture_count()
static void qt_debug_remove_texture(QSGTexture *texture)
static void qt_debug_add_texture(QSGTexture *texture)
size_t qHash(const QSGSamplerDescription &s, size_t seed=0) noexcept
Q_DECLARE_TYPEINFO(QSGSamplerDescription, Q_RELOCATABLE_TYPE)
bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
Q_QUICK_EXPORT bool qsg_safeguard_texture(QSGTexture *)
bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
static QSGSamplerDescription fromTexture(QSGTexture *t)