summaryrefslogtreecommitdiffstats
path: root/src/hardwareintegration
diff options
context:
space:
mode:
authorGiulio Camuffo <giulio.camuffo@jollamobile.com>2014-04-16 11:02:30 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-22 09:14:32 +0200
commit48126502434c0c966a744e113b4a420656d8c206 (patch)
tree93d33a1d738c3b9b0cd264766e8e356b515485c5 /src/hardwareintegration
parent17b37f7e907d10d028b70f43b8afc80a384519a4 (diff)
Egl surfaces can now be invalidated, make sure to recreate them
Change-Id: Ifae97cc4538989bc45641bda5ce2ec8a7d8980ce Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'src/hardwareintegration')
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp7
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h1
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp4
3 files changed, 11 insertions, 1 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index 306f08507..fc7aca384 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -64,7 +64,7 @@ QWaylandEglWindow::QWaylandEglWindow(QWindow *window)
, m_resize(false)
, m_format(q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig))
{
- setGeometry(window->geometry());
+ create();
}
QWaylandEglWindow::~QWaylandEglWindow()
@@ -87,9 +87,14 @@ QWaylandWindow::WindowType QWaylandEglWindow::windowType() const
void QWaylandEglWindow::setGeometry(const QRect &rect)
{
QWaylandWindow::setGeometry(rect);
+ create();
+}
+void QWaylandEglWindow::create()
+{
createDecoration();
QMargins margins = frameMargins();
+ QRect rect = geometry();
QSize sizeWithMargins = rect.size() + QSize(margins.left() + margins.right(), margins.top() + margins.bottom());
// wl_egl_windows must have both width and height > 0
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
index d8fdbcfce..6c6c77e09 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
@@ -58,6 +58,7 @@ public:
~QWaylandEglWindow();
WindowType windowType() const;
+ void create();
virtual void setGeometry(const QRect &rect);
QRect contentsRect() const;
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index e7a4b5a2b..04cfbe6b5 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -113,6 +113,10 @@ bool QWaylandGLContext::makeCurrent(QPlatformSurface *surface)
window->setCanResize(false);
EGLSurface eglSurface = window->eglSurface();
+ if (!eglSurface) {
+ window->create();
+ eglSurface = window->eglSurface();
+ }
if (!eglMakeCurrent(m_eglDisplay, eglSurface, eglSurface, m_context)) {
qWarning("QEGLPlatformContext::makeCurrent: eglError: %x, this: %p \n", eglGetError(), this);
return false;