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
qsgsoftwarelayer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QSGSOFTWARELAYER_H
5#define QSGSOFTWARELAYER_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/qsgadaptationlayer_p.h>
19#include <private/qsgcontext_p.h>
20#include <private/qsgtexture_p.h>
21
23
25
27{
29public:
30 QSGSoftwareLayer(QSGRenderContext *renderContext);
32
33 const QPixmap &pixmap() const { return m_pixmap; }
34
35 // QSGTexture interface
36public:
37 qint64 comparisonKey() const override;
38 QSize textureSize() const override;
39 bool hasAlphaChannel() const override;
40 bool hasMipmaps() const override;
41
42 // QSGDynamicTexture interface
43public:
44 bool updateTexture() override;
45
46 // QSGLayer interface
47public:
48 void setItem(QSGNode *item) override;
49 void setRect(const QRectF &rect) override;
50 void setSize(const QSize &size) override;
51 void scheduleUpdate() override;
52 QImage toImage() const override;
53 void setLive(bool live) override;
54 void setRecursive(bool recursive) override;
55 void setFormat(Format) override;
56 void setHasMipmaps(bool) override;
57 void setDevicePixelRatio(qreal ratio) override;
58 void setMirrorHorizontal(bool mirror) override;
59 void setMirrorVertical(bool mirror) override;
60 void setSamples(int) override { }
61
62public Q_SLOTS:
63 void markDirtyTexture() override;
64 void invalidated() override;
65
66private:
67 void grab();
68
69 QSGNode *m_item;
70 QSGRenderContext *m_context;
71 QSGSoftwarePixmapRenderer *m_renderer;
72 QRectF m_rect;
73 QSize m_size;
74 QPixmap m_pixmap;
75 qreal m_device_pixel_ratio;
76 bool m_mirrorHorizontal;
77 bool m_mirrorVertical;
78 bool m_live;
79 bool m_grab;
80 bool m_recursive;
81 bool m_dirtyTexture;
82};
83
85
86#endif // QSGSOFTWARELAYER_H
\inmodule QtGui
Definition qimage.h:37
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qrect.h:484
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
Definition qsgnode.h:37
void setItem(QSGNode *item) override
QSize textureSize() const override
Returns the size of the texture in pixels.
void setMirrorHorizontal(bool mirror) override
void setMirrorVertical(bool mirror) override
void setRecursive(bool recursive) override
qint64 comparisonKey() const override
Returns a key suitable for comparing textures.
QImage toImage() const override
void setDevicePixelRatio(qreal ratio) override
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
void scheduleUpdate() override
bool updateTexture() override
Call this function to explicitly update the dynamic texture.
void invalidated() override
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
void setSamples(int) override
QSGSoftwareLayer(QSGRenderContext *renderContext)
void setSize(const QSize &size) override
const QPixmap & pixmap() const
void setFormat(Format) override
void setRect(const QRectF &rect) override
void markDirtyTexture() override
void setLive(bool live) override
void setHasMipmaps(bool) override
\inmodule QtCore
Definition qsize.h:25
Format
Definition ddsheader.h:14
rect
[4]
Combined button and popup list for selecting options.
GLenum GLuint GLintptr GLsizeiptr size
[1]
#define Q_OBJECT
#define Q_SLOTS
long long qint64
Definition qtypes.h:60
double qreal
Definition qtypes.h:187
QGraphicsItem * item