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
qsgcompressedtexture_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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
4#ifndef QSGCOMPRESSEDTEXTURE_P_H
5#define QSGCOMPRESSEDTEXTURE_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qtexturefiledata_p.h>
19#include <private/qsgcontext_p.h>
20#include <private/qsgtexture_p.h>
21#include <rhi/qrhi.h>
22#include <QQuickTextureFactory>
23#include <QOpenGLFunctions>
24
26
27Q_DECLARE_LOGGING_CATEGORY(QSG_LOG_TEXTUREIO);
28
29class Q_QUICK_EXPORT QSGCompressedTexture : public QSGTexture
30{
32public:
34 virtual ~QSGCompressedTexture();
35
36 QSize textureSize() const override;
37 bool hasAlphaChannel() const override;
38 bool hasMipmaps() const override;
39
40 qint64 comparisonKey() const override;
41 QRhiTexture *rhiTexture() const override;
42 void commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) override;
43
44 QTextureFileData textureData() const;
45
51 static FormatInfo formatInfo(quint32 glTextureFormat);
52 static bool formatIsOpaque(quint32 glTextureFormat);
53
54protected:
57 QRhiTexture *m_texture = nullptr;
58 bool m_hasAlpha = false;
59 bool m_uploaded = false;
60};
61
63 class Manager;
64}
65
67{
68public:
70 QSGTexture *createTexture(QQuickWindow *) const override;
71 int textureByteCount() const override;
72 QSize textureSize() const override;
73
74 const QTextureFileData *textureData() const { return &m_textureData; }
75
76protected:
78};
79
81
82#endif // QSGCOMPRESSEDTEXTURE_P_H
The QQuickTextureFactory class provides an interface for loading custom textures from QML....
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\inmodule QtGui
Definition qrhi.h:1731
\inmodule QtGui
Definition qrhi.h:895
Format
Specifies the texture format.
Definition qrhi.h:914
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
const QTextureFileData * textureData() const
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
#define Q_DECLARE_LOGGING_CATEGORY(name)
#define Q_OBJECT
unsigned int quint32
Definition qtypes.h:50
long long qint64
Definition qtypes.h:60