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
qqnxwindowgrabber_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 Research In Motion
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QQnxWindowGrabber_H
4#define QQnxWindowGrabber_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#define EGL_EGLEXT_PROTOTYPES
18#define GL_GLEXT_PROTOTYPES
19#include <EGL/egl.h>
20#include <GLES2/gl2.h>
21#include <GLES2/gl2ext.h>
22#include <EGL/eglext.h>
23#include <QAbstractNativeEventFilter>
24#include <QObject>
25#include <QSize>
26#include <QTimer>
27
28#include <memory>
29
30#include <screen/screen.h>
31
33
34class QRhi;
36
38{
40
41public:
43 {
44 int width = -1;
45 int height = -1;
46 int stride = -1;
47
48 unsigned char *data = nullptr;
49
50 static constexpr int pixelSize = 4; // BGRX8888;
51 };
52
53 explicit QQnxWindowGrabber(QObject *parent = 0);
55
56 void setFrameRate(int frameRate);
57
58 void setWindowId(const QByteArray &windowId);
59
60 void setRhi(QRhi *rhi);
61
62 void start();
63 void stop();
64
65 void pause();
66 void resume();
67
68 void forceUpdate();
69
70 bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;
71
72 bool handleScreenEvent(screen_event_t event);
73
75
76 bool isEglImageSupported() const;
77
78 int getNextTextureId();
80
82 void updateScene(const QSize &size);
83
84private slots:
85 void triggerUpdate();
86
87private:
88 bool selectBuffer();
89 void resetBuffers();
90 void checkForEglImageExtension();
91
92 QTimer m_timer;
93
94 QByteArray m_windowId;
95
96 screen_window_t m_windowParent;
97 screen_window_t m_window;
98 screen_context_t m_screenContext;
99
100 std::unique_ptr<QQnxWindowGrabberImage> m_frontBuffer;
101 std::unique_ptr<QQnxWindowGrabberImage> m_backBuffer;
102
103 QSize m_size;
104
105 QRhi *m_rhi;
106
107 bool m_active;
108 bool m_eglImageSupported;
109 bool m_startPending;
110};
111
113
114#endif
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QQnxWindowGrabber(QObject *parent=0)
bool isEglImageSupported() const
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override
This method is called for every native event.
void setWindowId(const QByteArray &windowId)
bool handleScreenEvent(screen_event_t event)
QByteArray windowGroupId() const
void updateScene(const QSize &size)
void setFrameRate(int frameRate)
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
\inmodule QtCore
Definition qsize.h:25
\inmodule QtCore
Definition qtimer.h:20
Combined button and popup list for selecting options.
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
const void GLsizei GLsizei stride
GLint GLsizei width
GLuint GLsizei const GLchar * message
struct _cl_event * event
GLuint64EXT * result
[6]
#define Q_OBJECT
#define slots
#define signals
ptrdiff_t qintptr
Definition qtypes.h:166