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
25
QT_BEGIN_NAMESPACE
26
27
Q_DECLARE_LOGGING_CATEGORY
(QSG_LOG_TEXTUREIO);
28
29
class
Q_QUICK_EXPORT
QSGCompressedTexture
:
public
QSGTexture
30
{
31
Q_OBJECT
32
public
:
33
QSGCompressedTexture
(
const
QTextureFileData
& texData);
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
46
struct
FormatInfo
47
{
48
QRhiTexture::Format
rhiFormat
;
49
bool
isSRGB
;
50
};
51
static
FormatInfo
formatInfo(
quint32
glTextureFormat);
52
static
bool
formatIsOpaque(
quint32
glTextureFormat);
53
54
protected
:
55
QTextureFileData
m_textureData
;
56
QSize
m_size
;
57
QRhiTexture
*m_texture =
nullptr
;
58
bool
m_hasAlpha =
false
;
59
bool
m_uploaded =
false
;
60
};
61
62
namespace
QSGOpenGLAtlasTexture
{
63
class
Manager;
64
}
65
66
class
Q_QUICK_EXPORT
QSGCompressedTextureFactory
:
public
QQuickTextureFactory
67
{
68
public
:
69
QSGCompressedTextureFactory
(
const
QTextureFileData
& texData);
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
76
protected
:
77
QTextureFileData
m_textureData
;
78
};
79
80
QT_END_NAMESPACE
81
82
#endif
// QSGCOMPRESSEDTEXTURE_P_H
QQuickTextureFactory
The QQuickTextureFactory class provides an interface for loading custom textures from QML....
Definition
qquickimageprovider.h:22
QQuickWindow
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
Definition
qquickwindow.h:42
QRhiResourceUpdateBatch
\inmodule QtGui
Definition
qrhi.h:1731
QRhiTexture
\inmodule QtGui
Definition
qrhi.h:895
QRhiTexture::Format
Format
Specifies the texture format.
Definition
qrhi.h:914
QRhi
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition
qrhi.h:1804
QSGCompressedTextureFactory
Definition
qsgcompressedtexture_p.h:67
QSGCompressedTextureFactory::m_textureData
QTextureFileData m_textureData
Definition
qsgcompressedtexture_p.h:77
QSGCompressedTextureFactory::textureData
const QTextureFileData * textureData() const
Definition
qsgcompressedtexture_p.h:74
QSGCompressedTexture
Definition
qsgcompressedtexture_p.h:30
QSGCompressedTexture::m_size
QSize m_size
Definition
qsgcompressedtexture_p.h:56
QSGCompressedTexture::m_textureData
QTextureFileData m_textureData
Definition
qsgcompressedtexture_p.h:55
QSGTexture
\inmodule QtQuick
Definition
qsgtexture.h:20
QSize
\inmodule QtCore
Definition
qsize.h:25
QTextureFileData
Definition
qtexturefiledata_p.h:31
QSGOpenGLAtlasTexture
Definition
qsgcompressedtexture_p.h:62
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qstandardpaths_haiku.cpp:21
QT_END_NAMESPACE
Definition
qsharedpointer.cpp:1590
Q_DECLARE_LOGGING_CATEGORY
#define Q_DECLARE_LOGGING_CATEGORY(name)
Definition
qloggingcategory.h:106
qrhi.h
Q_OBJECT
#define Q_OBJECT
Definition
qtmetamacros.h:119
quint32
unsigned int quint32
Definition
qtypes.h:50
qint64
long long qint64
Definition
qtypes.h:60
QSGCompressedTexture::FormatInfo
Definition
qsgcompressedtexture_p.h:47
QSGCompressedTexture::FormatInfo::isSRGB
bool isSRGB
Definition
qsgcompressedtexture_p.h:49
QSGCompressedTexture::FormatInfo::rhiFormat
QRhiTexture::Format rhiFormat
Definition
qsgcompressedtexture_p.h:48
qtdeclarative
src
quick
scenegraph
compressedtexture
qsgcompressedtexture_p.h
Generated by
1.10.0