~kdub/+junk/experiment

« back to all changes in this revision

Viewing changes to playground/mir_egl_platform_shim.c

  • Committer: Kevin DuBois
  • Date: 2016-11-03 11:41:46 UTC
  • Revision ID: kevin.dubois@canonical.com-20161103114146-tx6kvut4dwstnfwe
stitch together the importing of a software mirbuffer as a texture

Show diffs side-by-side

added added

removed removed

Lines of Context:
101
101
    }
102
102
    return eglTerminate(display);
103
103
}
 
104
 
 
105
EGLImageKHR future_driver_eglCreateImageKHR(
 
106
    EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list)
 
107
{
 
108
    (void) ctx;
 
109
    if (target != EGL_NATIVE_PIXMAP_KHR)
 
110
        return EGL_NO_IMAGE_KHR;
 
111
 
 
112
    PFNEGLCREATEIMAGEKHRPROC c = (PFNEGLCREATEIMAGEKHRPROC) eglGetProcAddress("eglCreateImageKHR");
 
113
    auto anw = to_anw(buffer);
 
114
    return c(dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, anw, attrib_list);
 
115
}
 
116
 
 
117
EGLBoolean future_driver_eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image)
 
118
{
 
119
    PFNEGLDESTROYIMAGEKHRPROC d = (PFNEGLDESTROYIMAGEKHRPROC) eglGetProcAddress("eglDestroyImageKHR");
 
120
    return d(dpy, img);
 
121
}