diff options
| author | Mikko Hallamaa <[email protected]> | 2024-02-15 10:58:40 +0100 |
|---|---|---|
| committer | Mikko Hallamaa <[email protected]> | 2024-03-13 14:38:52 +0000 |
| commit | 342ae435a198acdd794e575dc54ccab1d33b320b (patch) | |
| tree | b7fb3b07e7880ca4a43b8822cede52b13ad5f345 /src/opengl/qopenglcompositor_p.h | |
| parent | 8db0a12e84075e0e41f6a92027df74fe2b2d2182 (diff) | |
OpenGL: Add parameters to choose FBO grab orientation
We want to be able to pass as an argument whether the texture grabbed to
an FBO is supposed to have a flipped y-axis or not. This is required for
screen capture on the EGLFS platform.
Task-number: QTBUG-121835
Pick-to: 6.7 6.6 6.5
Change-Id: I6dddc879a4be7ff2c2c189747193423644be55a0
Reviewed-by: Laszlo Agocs <[email protected]>
Reviewed-by: Artem Dyomin <[email protected]>
Diffstat (limited to 'src/opengl/qopenglcompositor_p.h')
| -rw-r--r-- | src/opengl/qopenglcompositor_p.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/opengl/qopenglcompositor_p.h b/src/opengl/qopenglcompositor_p.h index f2059f90fad..86229b13ca3 100644 --- a/src/opengl/qopenglcompositor_p.h +++ b/src/opengl/qopenglcompositor_p.h @@ -47,6 +47,11 @@ class Q_OPENGL_EXPORT QOpenGLCompositor : public QObject Q_OBJECT public: + enum GrabOrientation { + Flipped, + NotFlipped, + }; + static QOpenGLCompositor *instance(); static void destroy(); @@ -60,7 +65,7 @@ public: void update(); QImage grab(); - bool grabToFrameBufferObject(QOpenGLFramebufferObject *fbo); + bool grabToFrameBufferObject(QOpenGLFramebufferObject *fbo, GrabOrientation orientation = Flipped); QList<QOpenGLCompositorWindow *> windows() const { return m_windows; } void addWindow(QOpenGLCompositorWindow *window); @@ -78,8 +83,10 @@ private: QOpenGLCompositor(); ~QOpenGLCompositor(); - void renderAll(QOpenGLFramebufferObject *fbo); - void render(QOpenGLCompositorWindow *window); + void renderAll(QOpenGLFramebufferObject *fbo, + QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft); + void render(QOpenGLCompositorWindow *window, + QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft); void ensureCorrectZOrder(); QOpenGLContext *m_context; |
