{
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"));
**
****************************************************************************/
-#include "mesaeglintegration.h"
+#include "waylandeglintegration.h"
#include <QtGui/QPlatformNativeInterface>
#include <QtGui/QGuiApplication>
+#include <QtGui/QOpenGLContext>
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/egl.h>
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());
}
}
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;
}
**
****************************************************************************/
-#ifndef MESAEGLINTEGRATION_H
-#define MESAEGLINTEGRATION_H
+#ifndef WAYLANDEGLINTEGRATION_H
+#define WAYLANDEGLINTEGRATION_H
#include "hardware_integration/graphicshardwareintegration.h"
#include <QtCore/QScopedPointer>
QScopedPointer<MesaEglIntegrationPrivate> d_ptr;
};
-#endif // MESAEGLINTEGRATION_H
+#endif // WAYLANDEGLINTEGRATION_H