summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2012-04-17 09:07:09 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2012-07-05 13:34:59 +0200
commit10f72c1c9d47897deb7155556c99d2fee39aabfa (patch)
tree0d2cb1ffe5e3a3f601d0f112bc824ee1a1ca7dc7
parent1d5dfb2d43fb96ec27e9b19d1c99de241c9e422c (diff)
Use the new QPlatformNativeInterface native resource function getter
Change-Id: I5b4e0a48247573e3fc03a87a53c02fa5b5a984d9 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
-rw-r--r--src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp b/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp
index 655407378..fb25d2620 100644
--- a/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp
+++ b/src/compositor/hardware_integration/wayland_egl/waylandeglintegration.cpp
@@ -104,6 +104,8 @@ public:
PFNEGLDESTROYIMAGEKHRPROC egl_destroy_image;
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl_egl_image_target_texture_2d;
+
+ QPlatformNativeInterface::NativeResourceForContextFunction get_egl_context;
};
WaylandEglIntegration::WaylandEglIntegration(WaylandCompositor *compositor)
@@ -123,6 +125,10 @@ void WaylandEglIntegration::initializeHardware(Wayland::Display *waylandDisplay)
const char *extensionString = eglQueryString(d->egl_display, EGL_EXTENSIONS);
if (extensionString && strstr(extensionString, "EGL_WL_bind_wayland_display"))
{
+ d->get_egl_context = nativeInterface->nativeResourceFunctionForContext("get_egl_context");
+ if (!d->get_egl_context) {
+ qWarning("Failed to retrieve the get_egl_context function");
+ }
d->egl_bind_wayland_display =
reinterpret_cast<PFNEGLBINDWAYLANDDISPLAYWL>(eglGetProcAddress("eglBindWaylandDisplayWL"));
d->egl_unbind_wayland_display =
@@ -135,6 +141,7 @@ void WaylandEglIntegration::initializeHardware(Wayland::Display *waylandDisplay)
reinterpret_cast<PFNGLEGLIMAGETARGETTEXTURE2DOESPROC>(eglGetProcAddress("glEGLImageTargetTexture2DOES"));
if (d->egl_bind_wayland_display
+ && d->get_egl_context
&& d->egl_unbind_wayland_display
&& d->egl_create_image
&& d->egl_destroy_image
@@ -160,8 +167,7 @@ GLuint WaylandEglIntegration::createTextureFromBuffer(wl_buffer *buffer, QOpenGL
}
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
-//#####jl: fix to use functions pointer
- EGLContext egl_context = nativeInterface->nativeResourceForContext("EglContext", context);
+ EGLContext egl_context = d->get_egl_context(context);
EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context,
EGL_WAYLAND_BUFFER_WL,
@@ -228,8 +234,7 @@ void *WaylandEglIntegration::lockNativeBuffer(struct wl_buffer *buffer, QOpenGLC
Q_D(const WaylandEglIntegration);
QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface();
-//#####jl: fix to use functions pointer
- EGLContext egl_context = nativeInterface->nativeResourceForContext("EglContext", context);
+ EGLContext egl_context = d->get_egl_context(context);
EGLImageKHR image = d->egl_create_image(d->egl_display, egl_context,
EGL_WAYLAND_BUFFER_WL,