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
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
4#ifndef QSGCOMPRESSEDATLASTEXTURE_P_H
5#define QSGCOMPRESSEDATLASTEXTURE_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 <QtCore/QSize>
19
20#include <QtQuick/QSGTexture>
21#include <QtQuick/private/qsgareaallocator_p.h>
22#include <QtQuick/private/qsgrhiatlastexture_p.h>
23
25
27
29
30class Texture;
31
33{
34public:
36 ~Atlas();
37
38 bool generateTexture() override;
40 QRhiResourceUpdateBatch *rcub) override;
41
43
44 uint format() const { return m_format; }
45
46private:
47 uint m_format;
48};
49
51{
53public:
54 Texture(Atlas *atlas, const QRect &textureRect, QByteArrayView data, const QSize &size);
55 ~Texture();
56
57 QSize textureSize() const override { return m_size; }
58 bool hasAlphaChannel() const override;
59 bool hasMipmaps() const override { return false; }
60
61 QRectF normalizedTextureSubRect() const override { return m_texture_coords_rect; }
62
64
65 const QByteArray &data() const { return m_data; }
66 int sizeInBytes() const { return m_data.size(); }
67
68private:
69 QRectF m_texture_coords_rect;
70 mutable QSGTexture *m_nonatlas_texture;
71 QByteArray m_data;
72 QSize m_size;
73};
74
75}
76
78
79#endif
\inmodule QtCore
Definition qbytearray.h:57
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
Definition qbytearray.h:494
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtGui
Definition qrhi.h:1731
void enqueueTextureUpload(QSGRhiAtlasTexture::TextureBase *t, QRhiResourceUpdateBatch *rcub) override
Atlas(QSGDefaultRenderContext *rc, const QSize &size, uint format)
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
QSGTexture * removedFromAtlas(QRhiResourceUpdateBatch *) const override
This function returns a copy of the current texture which is removed from its atlas.
QSize textureSize() const override
Returns the size of the texture in pixels.
QRectF normalizedTextureSubRect() const override
Returns the rectangle inside textureSize() that this texture represents in normalized coordinates.
\inmodule QtQuick
Definition qsgtexture.h:20
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLdouble GLdouble t
Definition qopenglext.h:243
#define Q_OBJECT
unsigned int uint
Definition qtypes.h:34
view create()