/src/qtbase/src/gui/kernel/qplatformgraphicsbuffer.h
Line | Count | Source |
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 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QPLATFORMGRAPHICSBUFFER_H |
6 | | #define QPLATFORMGRAPHICSBUFFER_H |
7 | | |
8 | | // |
9 | | // W A R N I N G |
10 | | // ------------- |
11 | | // |
12 | | // This file is part of the QPA API and is not meant to be used |
13 | | // in applications. Usage of this API may make your code |
14 | | // source and binary incompatible with future versions of Qt. |
15 | | // |
16 | | |
17 | | |
18 | | #include <QtGui/qtguiglobal.h> |
19 | | #include <QtCore/QSize> |
20 | | #include <QtCore/QRect> |
21 | | #include <QtGui/QPixelFormat> |
22 | | #include <QtCore/qflags.h> |
23 | | #include <QtCore/QObject> |
24 | | |
25 | | QT_BEGIN_NAMESPACE |
26 | | |
27 | | class Q_GUI_EXPORT QPlatformGraphicsBuffer : public QObject |
28 | | { |
29 | 0 | Q_OBJECT |
30 | 0 | public: |
31 | 0 | enum AccessType |
32 | 0 | { |
33 | 0 | None = 0x00, |
34 | 0 | SWReadAccess = 0x01, |
35 | 0 | SWWriteAccess = 0x02, |
36 | 0 | TextureAccess = 0x04, |
37 | 0 | HWCompositor = 0x08 |
38 | 0 | }; |
39 | 0 | Q_ENUM(AccessType) Unexecuted instantiation: qt_getEnumMetaObject(QPlatformGraphicsBuffer::AccessType) Unexecuted instantiation: qt_getEnumName(QPlatformGraphicsBuffer::AccessType) |
40 | 0 | Q_DECLARE_FLAGS(AccessTypes, AccessType) |
41 | 0 |
|
42 | 0 | enum Origin { |
43 | 0 | OriginBottomLeft, |
44 | 0 | OriginTopLeft |
45 | 0 | }; |
46 | 0 | Q_ENUM(Origin) Unexecuted instantiation: qt_getEnumMetaObject(QPlatformGraphicsBuffer::Origin) Unexecuted instantiation: qt_getEnumName(QPlatformGraphicsBuffer::Origin) |
47 | 0 |
|
48 | 0 | ~QPlatformGraphicsBuffer(); |
49 | 0 |
|
50 | 0 | AccessTypes isLocked() const { return m_lock_access; } |
51 | | bool lock(AccessTypes access, const QRect &rect = QRect()); |
52 | | void unlock(); |
53 | | |
54 | | virtual bool bindToTexture(const QRect &rect = QRect()) const; |
55 | | |
56 | | virtual const uchar *data() const; |
57 | | virtual uchar *data(); |
58 | | virtual int bytesPerLine() const; |
59 | | int byteCount() const; |
60 | | |
61 | | virtual Origin origin() const; |
62 | | |
63 | 0 | QSize size() const { return m_size; } |
64 | 0 | QPixelFormat format() const { return m_format; } |
65 | | |
66 | | Q_SIGNALS: |
67 | | void unlocked(AccessTypes previousAccessTypes); |
68 | | |
69 | | protected: |
70 | | QPlatformGraphicsBuffer(const QSize &size, const QPixelFormat &format); |
71 | | |
72 | | virtual bool doLock(AccessTypes access, const QRect &rect = QRect()) = 0; |
73 | | virtual void doUnlock() = 0; |
74 | | |
75 | | private: |
76 | | QSize m_size; |
77 | | QPixelFormat m_format; |
78 | | AccessTypes m_lock_access; |
79 | | }; |
80 | | |
81 | | QT_END_NAMESPACE |
82 | | |
83 | | #endif //QPLATFORMGRAPHICSBUFFER_H |