Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
22
24{
26 return (value + 3) & ~3;
27}
28}
29
31{
32public:
33 QSSGRenderPath() = default;
34 explicit inline QSSGRenderPath(const QString &p) noexcept
35 : m_path(p), m_key(qHash(p, QHashSeed::globalSeed())) {}
36
37 inline bool isNull() const { return m_path.isNull(); }
38 inline bool isEmpty() const { return m_path.isEmpty(); }
39 QString path() const { return m_path; }
40private:
41 friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &);
42 friend size_t qHash(const QSSGRenderPath &, size_t) Q_DECL_NOTHROW;
43 QString m_path;
44 size_t m_key = 0;
45};
46
47inline bool operator==(const QSSGRenderPath &p1, const QSSGRenderPath &p2)
48{
49 return (p1.m_key == p2.m_key) && (p1.m_path == p2.m_path);
50}
51
52inline size_t qHash(const QSSGRenderPath &path, size_t seed) Q_DECL_NOTHROW
53{
54 return (path.m_key) ? path.m_key : qHash(path.m_path, seed);
55}
56
58
59#endif
QSSGRenderPath(const QString &p) noexcept
QSSGRenderPath()=default
QString path() const
friend size_t qHash(const QSSGRenderPath &, size_t) Q_DECL_NOTHROW
bool isEmpty() const
bool isNull() const
friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
Definition qstring.h:192
bool isNull() const
Returns true if this string is null; otherwise returns false.
Definition qstring.h:994
QPixmap p2
QPixmap p1
[0]
constexpr quint32 nextMultipleOf4(quint32 value)
Combined button and popup list for selecting options.
#define Q_DECL_NOTHROW
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLsizei const GLchar *const * path
GLfloat GLfloat p
[1]
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
Definition qrandom.cpp:196
size_t qHash(const QSSGRenderPath &path, size_t seed) Q_DECL_NOTHROW
bool operator==(const QSSGRenderPath &p1, const QSSGRenderPath &p2)
unsigned int quint32
Definition qtypes.h:50
static Q_CORE_EXPORT QHashSeed globalSeed() noexcept
\threadsafe
Definition qhash.cpp:1216