Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsgtexture_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 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_P_H
6
#
define
QSGTEXTURE_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtQuick
/
private
/
qtquickglobal_p
.
h
>
20
#
include
<
private
/
qobject_p
.
h
>
21
#
include
"qsgtexture.h"
22
23
QT_BEGIN_NAMESPACE
24
25
struct
QSGSamplerDescription
26
{
27
QSGTexture
::
Filtering
filtering
=
QSGTexture
::
Nearest
;
28
QSGTexture
::
Filtering
mipmapFiltering
=
QSGTexture
::
None
;
29
QSGTexture
::
WrapMode
horizontalWrap
=
QSGTexture
::
ClampToEdge
;
30
QSGTexture
::
WrapMode
verticalWrap
=
QSGTexture
::
ClampToEdge
;
31
QSGTexture
::
AnisotropyLevel
anisotropylevel
=
QSGTexture
::
AnisotropyNone
;
32
33
static
QSGSamplerDescription
fromTexture
(QSGTexture *t);
34
};
35
36
Q_DECLARE_TYPEINFO
(
QSGSamplerDescription
,
Q_RELOCATABLE_TYPE
);
37
38
bool
operator
==(
const
QSGSamplerDescription
&a,
const
QSGSamplerDescription
&b)
noexcept
;
39
bool
operator
!=(
const
QSGSamplerDescription
&a,
const
QSGSamplerDescription
&b)
noexcept
;
40
size_t
qHash
(
const
QSGSamplerDescription
&s, size_t seed = 0)
noexcept
;
41
42
#
if
QT_CONFIG
(
opengl
)
43
class
Q_QUICK_EXPORT QSGTexturePlatformOpenGL :
public
QNativeInterface::QSGOpenGLTexture
44
{
45
public
:
46
QSGTexturePlatformOpenGL(QSGTexture *t) : m_texture(t) { }
47
QSGTexture *m_texture;
48
49
GLuint nativeTexture()
const
override;
50
};
51
#
endif
52
53
#
ifdef
Q_OS_WIN
54
class
Q_QUICK_EXPORT QSGTexturePlatformD3D11 :
public
QNativeInterface::QSGD3D11Texture
55
{
56
public
:
57
QSGTexturePlatformD3D11(QSGTexture *t) : m_texture(t) { }
58
QSGTexture *m_texture;
59
60
void
*nativeTexture()
const
override;
61
};
62
class
Q_QUICK_EXPORT QSGTexturePlatformD3D12 :
public
QNativeInterface::QSGD3D12Texture
63
{
64
public
:
65
QSGTexturePlatformD3D12(QSGTexture *t) : m_texture(t) { }
66
QSGTexture *m_texture;
67
68
int
nativeResourceState()
const
override;
69
void
*nativeTexture()
const
override;
70
};
71
#
endif
72
73
#
if
QT_CONFIG
(
metal
)
74
class
Q_QUICK_EXPORT QSGTexturePlatformMetal :
public
QNativeInterface::QSGMetalTexture
75
{
76
public
:
77
QSGTexturePlatformMetal(QSGTexture *t) : m_texture(t) { }
78
QSGTexture *m_texture;
79
80
QT_OBJC_PROTOCOL(MTLTexture) nativeTexture()
const
override;
81
};
82
#
endif
83
84
#
if
QT_CONFIG
(
vulkan
)
85
class
Q_QUICK_EXPORT QSGTexturePlatformVulkan :
public
QNativeInterface::QSGVulkanTexture
86
{
87
public
:
88
QSGTexturePlatformVulkan(QSGTexture *t) : m_texture(t) { }
89
QSGTexture *m_texture;
90
91
VkImage nativeImage()
const
override;
92
VkImageLayout nativeImageLayout()
const
override;
93
};
94
#
endif
95
96
class
Q_QUICK_EXPORT
QSGTexturePrivate
:
public
QObjectPrivate
97
{
98
Q_DECLARE_PUBLIC(QSGTexture)
99
public
:
100
QSGTexturePrivate(QSGTexture *t);
101
static
QSGTexturePrivate *get(QSGTexture *t) {
return
t->d_func(); }
102
void
resetDirtySamplerOptions();
103
bool
hasDirtySamplerOptions()
const
;
104
105
uint wrapChanged : 1;
106
uint filteringChanged : 1;
107
uint anisotropyChanged : 1;
108
109
uint horizontalWrap : 2;
110
uint verticalWrap : 2;
111
uint mipmapMode : 2;
112
uint filterMode : 2;
113
uint anisotropyLevel: 3;
114
115
// While we could make QSGTexturePrivate implement all the interfaces, we
116
// rather choose to use separate objects to avoid clashes in the function
117
// names and signatures.
118
#
if
QT_CONFIG
(
opengl
)
119
QSGTexturePlatformOpenGL m_openglTextureAccessor;
120
#
endif
121
#
ifdef
Q_OS_WIN
122
QSGTexturePlatformD3D11 m_d3d11TextureAccessor;
123
QSGTexturePlatformD3D12 m_d3d12TextureAccessor;
124
#
endif
125
#
if
QT_CONFIG
(
metal
)
126
QSGTexturePlatformMetal m_metalTextureAccessor;
127
#
endif
128
#
if
QT_CONFIG
(
vulkan
)
129
QSGTexturePlatformVulkan m_vulkanTextureAccessor;
130
#
endif
131
};
132
133
Q_QUICK_EXPORT
bool
qsg_safeguard_texture
(QSGTexture *);
134
135
QT_END_NAMESPACE
136
137
#
endif
// QSGTEXTURE_P_H
QSGTexturePrivate
Definition
qsgtexture_p.h:97
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qt_debug_print_texture_count
static void qt_debug_print_texture_count()
Definition
qsgtexture.cpp:119
qt_debug_remove_texture
static void qt_debug_remove_texture(QSGTexture *texture)
Definition
qsgtexture.cpp:173
qt_debug_add_texture
static void qt_debug_add_texture(QSGTexture *texture)
Definition
qsgtexture.cpp:152
qHash
size_t qHash(const QSGSamplerDescription &s, size_t seed=0) noexcept
Definition
qsgtexture.cpp:53
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(QSGSamplerDescription, Q_RELOCATABLE_TYPE)
operator!=
bool operator!=(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
Definition
qsgtexture.cpp:48
qsg_safeguard_texture
Q_QUICK_EXPORT bool qsg_safeguard_texture(QSGTexture *)
operator==
bool operator==(const QSGSamplerDescription &a, const QSGSamplerDescription &b) noexcept
Definition
qsgtexture.cpp:39
QSGSamplerDescription
Definition
qsgtexture_p.h:26
QSGSamplerDescription::fromTexture
static QSGSamplerDescription fromTexture(QSGTexture *t)
Definition
qsgtexture.cpp:62
qtdeclarative
src
quick
scenegraph
coreapi
qsgtexture_p.h
Generated on
for Qt by
1.18.0