50 enum GrabOrientation {
55 static QOpenGLCompositor *instance();
56 static void destroy();
58 void setTargetWindow(QWindow *window,
const QRect &nativeTargetGeometry);
59 void setTargetContext(QOpenGLContext *context);
60 void setRotation(
int degrees);
61 QOpenGLContext *context()
const {
return m_context; }
62 QWindow *targetWindow()
const {
return m_targetWindow; }
63 QRect nativeTargetGeometry()
const {
return m_nativeTargetGeometry; }
68 bool grabToFrameBufferObject(QOpenGLFramebufferObject *fbo, GrabOrientation orientation = Flipped);
70 QList<QOpenGLCompositorWindow *> windows()
const {
return m_windows; }
71 void addWindow(QOpenGLCompositorWindow *window);
72 void removeWindow(QOpenGLCompositorWindow *window);
73 void moveToTop(QOpenGLCompositorWindow *window);
74 void changeWindowIndex(QOpenGLCompositorWindow *window,
int newIdx);
77 void topWindowChanged(QOpenGLCompositorWindow *window);
80 void handleRenderAllRequest();
86 void renderAll(QOpenGLFramebufferObject *fbo,
87 QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
88 void render(QOpenGLCompositorWindow *window,
89 QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
90 void ensureCorrectZOrder();
92 QOpenGLContext *m_context;
93 QWindow *m_targetWindow;
94 QRect m_nativeTargetGeometry;
96 QMatrix4x4 m_rotationMatrix;
98 QOpenGLTextureBlitter m_blitter;
99 QList<QOpenGLCompositorWindow *> m_windows;
static void clippedBlit(const QPlatformTextureList *textures, int idx, const QRect &sourceWindowRect, const QRect &targetWindowRect, QOpenGLTextureBlitter *blitter, QMatrix4x4 *rotationMatrix, QOpenGLTextureBlitter::Origin sourceOrigin)