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
qssgrendererutil_p.h
Go to the documentation of this file.
1
// Copyright (C) 2008-2012 NVIDIA Corporation.
2
// Copyright (C) 2019 The Qt Company Ltd.
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
// Qt-Security score:significant reason:default
5
6
7
#
ifndef
QSSG_RENDERER_UTIL_H
8
#
define
QSSG_RENDERER_UTIL_H
9
10
//
11
// W A R N I N G
12
// -------------
13
//
14
// This file is not part of the Qt API. It exists purely as an
15
// implementation detail. This header file may change from version to
16
// version without notice, or even be removed.
17
//
18
// We mean it.
19
//
20
21
#
include
<
QtQuick3DUtils
/
private
/
qssgrenderbasetypes_p
.
h
>
22
23
QT_BEGIN_NAMESPACE
24
25
namespace
QSSGRendererUtil
26
{
27
inline
constexpr
quint32
nextMultipleOf4
(quint32 value) {
28
return
(value + 3) & ~3;
29
}
30
}
31
32
class
QSSGRenderPath
33
{
34
public
:
35
QSSGRenderPath
() =
default
;
36
explicit
inline
QSSGRenderPath
(
const
QString &p,
const
QString &lightmapKey = {})
noexcept
37
:
m_path
(
p
),
m_lightmapKey
(
lightmapKey
),
m_key
(
qHash
(
p
+
lightmapKey
,
QHashSeed
::
globalSeed
()))
38
{
39
}
40
41
inline
bool
isNull
()
const
{
return
m_path.isNull(); }
42
inline
bool
isEmpty
()
const
{
return
m_path.isEmpty(); }
43
QString
path
()
const
{
return
m_path; }
44
private
:
45
friend
bool
operator
==(
const
QSSGRenderPath
&,
const
QSSGRenderPath
&);
46
friend
size_t
qHash
(
const
QSSGRenderPath
&,
size_t
)
Q_DECL_NOTHROW
;
47
QString m_path;
48
QString m_lightmapKey;
49
size_t m_key = 0;
50
};
51
52
inline
bool
operator
==(
const
QSSGRenderPath
&p1,
const
QSSGRenderPath
&p2)
53
{
54
return
(p1.m_key == p2.m_key) && (p1.m_path == p2.m_path) && (p1.m_lightmapKey == p2.m_lightmapKey);
55
}
56
57
inline
size_t qHash(
const
QSSGRenderPath &path, size_t seed) Q_DECL_NOTHROW
58
{
59
return
(path.m_key) ? path.m_key : qHash(path.m_path + path.m_lightmapKey, seed);
60
}
61
62
QT_END_NAMESPACE
63
64
#
endif
QSSGRenderPath
Definition
qssgrendererutil_p.h:33
QSSGRenderPath::QSSGRenderPath
QSSGRenderPath()=default
QSSGRenderPath::qHash
friend size_t qHash(const QSSGRenderPath &, size_t) Q_DECL_NOTHROW
Definition
qssgrendererutil_p.h:57
QSSGRenderPath::path
QString path() const
Definition
qssgrendererutil_p.h:43
QSSGRenderPath::QSSGRenderPath
QSSGRenderPath(const QString &p, const QString &lightmapKey={}) noexcept
Definition
qssgrendererutil_p.h:36
QSSGRenderPath::operator==
friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &)
Definition
qssgrendererutil_p.h:52
QSSGRenderPath::isEmpty
bool isEmpty() const
Definition
qssgrendererutil_p.h:42
QSSGRenderPath::isNull
bool isNull() const
Definition
qssgrendererutil_p.h:41
QSSGRendererUtil
Definition
qssgrendererutil_p.h:26
QSSGRendererUtil::nextMultipleOf4
constexpr quint32 nextMultipleOf4(quint32 value)
Definition
qssgrendererutil_p.h:27
qtquick3d
src
runtimerender
qssgrendererutil_p.h
Generated on
for Qt by
1.16.1