Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qsgcompressedatlastexture_p.h
Go to the documentation of this file.
1
// Copyright (C) 2018 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
// Qt-Security score:significant reason:default
4
5
#
ifndef
QSGCOMPRESSEDATLASTEXTURE_P_H
6
#
define
QSGCOMPRESSEDATLASTEXTURE_P_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
<
QtCore
/
QSize
>
20
21
#
include
<
QtQuick
/
QSGTexture
>
22
#
include
<
QtQuick
/
private
/
qsgareaallocator_p
.
h
>
23
#
include
<
QtQuick
/
private
/
qsgrhiatlastexture_p
.
h
>
24
25
QT_BEGIN_NAMESPACE
26
27
class
QSGCompressedTextureFactory;
28
29
namespace
QSGCompressedAtlasTexture
{
30
31
class
Texture
;
32
33
class
Atlas
:
public
QSGRhiAtlasTexture
::
AtlasBase
34
{
35
public
:
36
Atlas
(QSGDefaultRenderContext *rc,
const
QSize &size, uint format);
37
~
Atlas
();
38
39
bool
generateTexture
()
override
;
40
void
enqueueTextureUpload
(QSGRhiAtlasTexture::TextureBase *t,
41
QRhiResourceUpdateBatch *rcub)
override
;
42
43
Texture
*
create
(QByteArrayView data,
const
QSize &size);
44
45
uint
format
()
const
{
return
m_format; }
46
47
private
:
48
uint m_format;
49
};
50
51
class
Texture
:
public
QSGRhiAtlasTexture
::
TextureBase
52
{
53
Q_OBJECT
54
public
:
55
Texture
(
Atlas
*
atlas
,
const
QRect
&
textureRect
,
QByteArrayView
data
,
const
QSize
&
size
);
56
~
Texture
();
57
58
QSize
textureSize
()
const
override
{
return
m_size; }
59
bool
hasAlphaChannel
()
const
override
;
60
bool
hasMipmaps
()
const
override
{
return
false
; }
61
62
QRectF
normalizedTextureSubRect
()
const
override
{
return
m_texture_coords_rect; }
63
64
QSGTexture
*
removedFromAtlas
(QRhiResourceUpdateBatch *)
const
override
;
65
66
const
QByteArray
&
data
()
const
{
return
m_data; }
67
int
sizeInBytes
()
const
{
return
m_data.size(); }
68
69
private
:
70
QRectF m_texture_coords_rect;
71
mutable
QSGTexture *m_nonatlas_texture;
72
QByteArray m_data;
73
QSize m_size;
74
};
75
76
}
77
78
QT_END_NAMESPACE
79
80
#
endif
QSGCompressedAtlasTexture::Atlas
Definition
qsgcompressedatlastexture_p.h:34
QSGCompressedAtlasTexture::Atlas::format
uint format() const
Definition
qsgcompressedatlastexture_p.h:45
QSGCompressedAtlasTexture::Atlas::generateTexture
bool generateTexture() override
Definition
qsgcompressedatlastexture.cpp:50
QSGCompressedAtlasTexture::Atlas::create
Texture * create(QByteArrayView data, const QSize &size)
Definition
qsgcompressedatlastexture.cpp:36
QSGCompressedAtlasTexture::Atlas::~Atlas
~Atlas()
Definition
qsgcompressedatlastexture.cpp:32
QSGCompressedAtlasTexture::Atlas::enqueueTextureUpload
void enqueueTextureUpload(QSGRhiAtlasTexture::TextureBase *t, QRhiResourceUpdateBatch *rcub) override
Definition
qsgcompressedatlastexture.cpp:71
QSGCompressedAtlasTexture::Atlas::Atlas
Atlas(QSGDefaultRenderContext *rc, const QSize &size, uint format)
Definition
qsgcompressedatlastexture.cpp:27
QSGCompressedAtlasTexture::Texture
Definition
qsgcompressedatlastexture_p.h:52
QSGCompressedAtlasTexture::Texture::hasAlphaChannel
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
Definition
qsgcompressedatlastexture.cpp:110
QSGCompressedAtlasTexture::Texture::hasMipmaps
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
Definition
qsgcompressedatlastexture_p.h:60
QSGCompressedAtlasTexture::Texture::removedFromAtlas
QSGTexture * removedFromAtlas(QRhiResourceUpdateBatch *) const override
This function returns a copy of the current texture which is removed from its atlas.
Definition
qsgcompressedatlastexture.cpp:115
QSGCompressedAtlasTexture::Texture::data
const QByteArray & data() const
Definition
qsgcompressedatlastexture_p.h:66
QSGCompressedAtlasTexture::Texture::~Texture
~Texture()
Definition
qsgcompressedatlastexture.cpp:105
QSGCompressedAtlasTexture::Texture::textureSize
QSize textureSize() const override
Returns the size of the texture in pixels.
Definition
qsgcompressedatlastexture_p.h:58
QSGCompressedAtlasTexture::Texture::normalizedTextureSubRect
QRectF normalizedTextureSubRect() const override
Returns the rectangle inside textureSize() that this texture represents in normalized coordinates.
Definition
qsgcompressedatlastexture_p.h:62
QSGCompressedAtlasTexture::Texture::sizeInBytes
int sizeInBytes() const
Definition
qsgcompressedatlastexture_p.h:67
QSGCompressedAtlasTexture
Definition
qsgcompressedatlastexture.cpp:25
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtdeclarative
src
quick
scenegraph
compressedtexture
qsgcompressedatlastexture_p.h
Generated on
for Qt by
1.18.0