summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/qwidget-compositor/main.cpp6
-rw-r--r--src/qt-compositor/hardware_integration/hardware_integration.pri2
-rw-r--r--src/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri (renamed from src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri)4
-rw-r--r--src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp (renamed from src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.cpp)17
-rw-r--r--src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h (renamed from src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.h)6
5 files changed, 21 insertions, 14 deletions
diff --git a/examples/qwidget-compositor/main.cpp b/examples/qwidget-compositor/main.cpp
index 2217d10ec..8e718602d 100644
--- a/examples/qwidget-compositor/main.cpp
+++ b/examples/qwidget-compositor/main.cpp
@@ -81,7 +81,11 @@ class QWidgetCompositor : public QWidget, public WaylandCompositor
{
Q_OBJECT
public:
- QWidgetCompositor() : WaylandCompositor(windowHandle(),const_cast<QGLContext *>(context())), m_moveSurface(0), m_dragSourceSurface(0) {
+ QWidgetCompositor()
+ : WaylandCompositor(windowHandle(),const_cast<QGLContext *>(context())->contextHandle())
+ , m_moveSurface(0)
+ , m_dragSourceSurface(0)
+ {
setMouseTracking(true);
setRetainedSelectionEnabled(true);
m_background = QImage(QLatin1String("background.jpg"));
diff --git a/src/qt-compositor/hardware_integration/hardware_integration.pri b/src/qt-compositor/hardware_integration/hardware_integration.pri
index f7fdc0523..c67d99cb4 100644
--- a/src/qt-compositor/hardware_integration/hardware_integration.pri
+++ b/src/qt-compositor/hardware_integration/hardware_integration.pri
@@ -35,7 +35,7 @@ isEmpty(QT_WAYLAND_GL_CONFIG):QT_WAYLAND_GL_CONFIG = $$(QT_WAYLAND_GL_CONFIG)
}
mesa_egl {
- include (mesa_egl/mesa_egl.pri)
+ include (wayland_egl/wayland_egl.pri)
}
dri2_xcb {
include (dri2_xcb/dri2_xcb.pri)
diff --git a/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri b/src/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri
index 1ac2dad6b..258923904 100644
--- a/src/qt-compositor/hardware_integration/mesa_egl/mesa_egl.pri
+++ b/src/qt-compositor/hardware_integration/wayland_egl/wayland_egl.pri
@@ -3,7 +3,7 @@ LIBS += -lEGL
DEFINES += QT_COMPOSITOR_MESA_EGL
SOURCES += \
- $$PWD/mesaeglintegration.cpp
+ $$PWD/waylandeglintegration.cpp
HEADERS += \
- $$PWD/mesaeglintegration.h
+ $$PWD/waylandeglintegration.h
diff --git a/src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.cpp b/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp
index 589cf25ef..f8550b2e8 100644
--- a/src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.cpp
+++ b/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp
@@ -38,10 +38,11 @@
**
****************************************************************************/
-#include "mesaeglintegration.h"
+#include "waylandeglintegration.h"
#include <QtGui/QPlatformNativeInterface>
#include <QtGui/QGuiApplication>
+#include <QtGui/QOpenGLContext>
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/egl.h>
@@ -96,7 +97,7 @@ void MesaEglIntegration::initializeHardware(Wayland::Display *waylandDisplay)
if (!d->valid)
qWarning("Failed to initialize egl display\n");
- d->egl_context = nativeInterface->nativeResourceForContext("EglContext", m_compositor->glContext()->contextHandle());
+ d->egl_context = nativeInterface->nativeResourceForContext("EglContext", m_compositor->glContext());
}
}
@@ -108,18 +109,20 @@ GLuint MesaEglIntegration::createTextureFromBuffer(wl_buffer *buffer)
return 0;
}
- EGLImageKHR image = eglCreateImageKHR(d->egl_display, d->egl_context,
- EGL_WAYLAND_BUFFER_WL,
- buffer, NULL);
+ if (!buffer->user_data) {
+ buffer->user_data = eglCreateImageKHR(d->egl_display, d->egl_context,
+ EGL_WAYLAND_BUFFER_WL,
+ buffer, NULL);
+ }
GLuint textureId;
glGenTextures(1,&textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, image);
+ glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, buffer->user_data);
- eglDestroyImageKHR(d->egl_display, image);
+// eglDestroyImageKHR(d->egl_display, image);
return textureId;
}
diff --git a/src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.h b/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h
index a70fc8598..698b975fc 100644
--- a/src/qt-compositor/hardware_integration/mesa_egl/mesaeglintegration.h
+++ b/src/qt-compositor/hardware_integration/wayland_egl/waylandeglintegration.h
@@ -38,8 +38,8 @@
**
****************************************************************************/
-#ifndef MESAEGLINTEGRATION_H
-#define MESAEGLINTEGRATION_H
+#ifndef WAYLANDEGLINTEGRATION_H
+#define WAYLANDEGLINTEGRATION_H
#include "hardware_integration/graphicshardwareintegration.h"
#include <QtCore/QScopedPointer>
@@ -61,4 +61,4 @@ private:
QScopedPointer<MesaEglIntegrationPrivate> d_ptr;
};
-#endif // MESAEGLINTEGRATION_H
+#endif // WAYLANDEGLINTEGRATION_H