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
qsgplaintexture_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 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 QSGPLAINTEXTURE_P_H
5#define QSGPLAINTEXTURE_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 <QtQuick/private/qtquickglobal_p.h>
19#include <QtQuick/private/qsgtexture_p.h>
20#include <QtQuick/private/qquickwindow_p.h>
21
23
25
26class Q_QUICK_EXPORT QSGPlainTexture : public QSGTexture
27{
29 Q_DECLARE_PRIVATE(QSGPlainTexture)
30public:
32 ~QSGPlainTexture() override;
33
34 void setOwnsTexture(bool owns) { m_owns_texture = owns; }
35 bool ownsTexture() const { return m_owns_texture; }
36
37 void setTextureSize(const QSize &size) { m_texture_size = size; }
38 QSize textureSize() const override { return m_texture_size; }
39
40 void setHasAlphaChannel(bool alpha) { m_has_alpha = alpha; }
41 bool hasAlphaChannel() const override { return m_has_alpha; }
42
43 bool hasMipmaps() const override { return mipmapFiltering() != QSGTexture::None; }
44
45 void setImage(const QImage &image);
46 const QImage &image() { return m_image; }
47
48 qint64 comparisonKey() const override;
49
50 QRhiTexture *rhiTexture() const override;
51 void commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) override;
52
53 void setTexture(QRhiTexture *texture);
54 void setTextureFromNativeTexture(QRhi *rhi,
55 quint64 nativeObjectHandle,
56 int nativeLayoutOrState,
57 uint nativeFormat,
58 const QSize &size,
59 QQuickWindow::CreateTextureOptions options,
60 QQuickWindowPrivate::TextureFromNativeTextureFlags flags);
61
64 t->setImage(image);
65 return t;
66 }
67
68protected:
70
72
76
79 uint m_dirty_bind_options : 1; // legacy (GL-only)
83 uint m_mipmap_warned : 1; // RHI only
84};
85
93
95
96#endif // QSGPLAINTEXTURE_P_H
\inmodule QtGui
Definition qimage.h:37
\inmodule QtCore\reentrant
Definition qrect.h:484
\inmodule QtGui
Definition qrhi.h:1731
\inmodule QtGui
Definition qrhi.h:895
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
QSGPlainTexturePrivate(QSGTexture *t)
QSGTexture::Filtering m_last_mipmap_filter
void setTextureSize(const QSize &size)
bool ownsTexture() const
static QSGPlainTexture * fromImage(const QImage &image)
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.
const QImage & image()
void setOwnsTexture(bool owns)
QSize textureSize() const override
Returns the size of the texture in pixels.
QRhiTexture * m_texture
void setHasAlphaChannel(bool alpha)
\inmodule QtQuick
Definition qsgtexture.h:20
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
Definition qsgtexture.h:34
\inmodule QtCore
Definition qsize.h:25
Combined button and popup list for selecting options.
Definition image.cpp:4
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLbitfield flags
GLenum GLuint texture
GLdouble GLdouble t
Definition qopenglext.h:243
GLfloat GLfloat GLfloat alpha
Definition qopenglext.h:418
#define Q_OBJECT
unsigned long long quint64
Definition qtypes.h:61
unsigned int uint
Definition qtypes.h:34
long long qint64
Definition qtypes.h:60