51 enum GrabOrientation {
56 static QOpenGLCompositor *instance();
57 static void destroy();
59 void setTargetWindow(QWindow *window,
const QRect &nativeTargetGeometry);
60 void setTargetContext(QOpenGLContext *context);
61 void setRotation(
int degrees);
62 QOpenGLContext *context()
const {
return m_context; }
63 QWindow *targetWindow()
const {
return m_targetWindow; }
64 QRect nativeTargetGeometry()
const {
return m_nativeTargetGeometry; }
69 bool grabToFrameBufferObject(QOpenGLFramebufferObject *fbo, GrabOrientation orientation = Flipped);
71 QList<QOpenGLCompositorWindow *> windows()
const {
return m_windows; }
72 void addWindow(QOpenGLCompositorWindow *window);
73 void removeWindow(QOpenGLCompositorWindow *window);
74 void moveToTop(QOpenGLCompositorWindow *window);
75 void changeWindowIndex(QOpenGLCompositorWindow *window,
int newIdx);
78 void topWindowChanged(QOpenGLCompositorWindow *window);
81 void handleRenderAllRequest();
87 void renderAll(QOpenGLFramebufferObject *fbo,
88 QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
89 void render(QOpenGLCompositorWindow *window,
90 QOpenGLTextureBlitter::Origin origin = QOpenGLTextureBlitter::OriginTopLeft);
91 void ensureCorrectZOrder();
93 QOpenGLContext *m_context;
94 QWindow *m_targetWindow;
95 QRect m_nativeTargetGeometry;
97 QMatrix4x4 m_rotationMatrix;
99 QOpenGLTextureBlitter m_blitter;
100 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)