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
5#ifndef QSSG_RENDERER_UTIL_H
6#define QSSG_RENDERER_UTIL_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 <QtQuick3DUtils/private/qssgrenderbasetypes_p.h>
20
21QT_BEGIN_NAMESPACE
22
24{
25inline constexpr quint32 nextMultipleOf4(quint32 value) {
26 return (value + 3) & ~3;
27}
28}
29
31{
32public:
33 QSSGRenderPath() = default;
34 explicit inline QSSGRenderPath(const QString &p, const QString &lightmapKey = {}) noexcept
36 {
37 }
38
39 inline bool isNull() const { return m_path.isNull(); }
40 inline bool isEmpty() const { return m_path.isEmpty(); }
41 QString path() const { return m_path; }
42private:
43 friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &);
45 QString m_path;
46 QString m_lightmapKey;
47 size_t m_key = 0;
48};
49
50inline bool operator==(const QSSGRenderPath &p1, const QSSGRenderPath &p2)
51{
52 return (p1.m_key == p2.m_key) && (p1.m_path == p2.m_path) && (p1.m_lightmapKey == p2.m_lightmapKey);
53}
54
55inline size_t qHash(const QSSGRenderPath &path, size_t seed) Q_DECL_NOTHROW
56{
57 return (path.m_key) ? path.m_key : qHash(path.m_path + path.m_lightmapKey, seed);
58}
59
60QT_END_NAMESPACE
61
62#endif
QSSGRenderPath()=default
friend size_t qHash(const QSSGRenderPath &, size_t) Q_DECL_NOTHROW
QString path() const
QSSGRenderPath(const QString &p, const QString &lightmapKey={}) noexcept
friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &)
bool isEmpty() const
bool isNull() const
constexpr quint32 nextMultipleOf4(quint32 value)