summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp')
-rw-r--r--src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp b/src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
index a638fccf1e..57da38ed3c 100644
--- a/src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
+++ b/src/plugins/platforms/wayland/gl_integration/qwaylandglwindowsurface.cpp
@@ -47,6 +47,7 @@
#include <QtOpenGL/QGLFramebufferObject>
#include <QtOpenGL/QGLContext>
+#include <QPlatformGLContext>
#include <QtOpenGL/private/qglengineshadermanager_p.h>
@@ -133,9 +134,9 @@ static void blitTexture(QGLContext *ctx, GLuint texture, const QSize &viewport,
drawTexture(r, texture, texSize, sourceRect);
}
-QWaylandGLWindowSurface::QWaylandGLWindowSurface(QWidget *window)
+QWaylandGLWindowSurface::QWaylandGLWindowSurface(QWindow *window)
: QWindowSurface(window)
- , mDisplay(QWaylandScreen::waylandScreenFromWidget(window)->display())
+ , mDisplay(QWaylandScreen::waylandScreenFromWindow(window)->display())
, mPaintDevice(0)
{
@@ -153,30 +154,29 @@ QPaintDevice *QWaylandGLWindowSurface::paintDevice()
void QWaylandGLWindowSurface::beginPaint(const QRegion &)
{
- window()->platformWindow()->glContext()->makeCurrent();
+ window()->handle()->glContext()->makeCurrent();
glClearColor(0,0,0,0xff);
glClear(GL_COLOR_BUFFER_BIT);
}
-void QWaylandGLWindowSurface::flush(QWidget *widget, const QRegion &region, const QPoint &offset)
+void QWaylandGLWindowSurface::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
Q_UNUSED(offset);
Q_UNUSED(region);
- QWaylandWindow *ww = (QWaylandWindow *) widget->platformWindow();
-
+
if (mPaintDevice->isBound())
mPaintDevice->release();
QRect rect(0,0,size().width(),size().height());
- QGLContext *ctx = QGLContext::fromPlatformGLContext(ww->glContext());
+ QGLContext *ctx = QGLContext::fromWindowContext(window->glContext());
blitTexture(ctx,mPaintDevice->texture(),size(),mPaintDevice->size(),rect,rect);
- ww->glContext()->swapBuffers();
+ window->glContext()->swapBuffers();
}
void QWaylandGLWindowSurface::resize(const QSize &size)
{
QWindowSurface::resize(size);
- window()->platformWindow()->glContext()->makeCurrent();
+ window()->glContext()->makeCurrent();
delete mPaintDevice;
mPaintDevice = new QGLFramebufferObject(size);
}