Exemple #1
0
EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
			  EGLSurface read, EGLContext ctx)
{
	EGL_DEBUG("%s: %s\n", __FILE__, __func__);
	EGL_DLSYM(eglMakeCurrent);
	return _eglMakeCurrent(dpy, draw, read, ctx);
}
Exemple #2
0
/**
 * Called via eglMakeCurrent(), drv->API.MakeCurrent().
 */
static EGLBoolean
xdri_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *d,
                    _EGLSurface *r, _EGLContext *context)
{
   struct xdri_egl_context *xdri_ctx = lookup_context(context);
   struct xdri_egl_surface *draw = lookup_surface(d);
   struct xdri_egl_surface *read = lookup_surface(r);

   if (!_eglMakeCurrent(drv, dpy, d, r, context))
      return EGL_FALSE;

   /* the symbol is defined in libGL.so */
   _glapi_check_multithread();

   if (xdri_ctx) {
      if (!xdri_ctx->driContext->bindContext(xdri_ctx->driContext,
                                             draw->driDrawable,
                                             read->driDrawable)) {
         return EGL_FALSE;
      }
   }
   else {
      _EGLContext *old = _eglGetCurrentContext();
      if (old) {
         xdri_ctx = lookup_context(old);
         xdri_ctx->driContext->unbindContext(xdri_ctx->driContext);
      }
   }

   return EGL_TRUE;
}
static EGLBoolean
fbMakeCurrent(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context)
{
   fbSurface *readSurf = Lookup_fbSurface(read);
   fbSurface *drawSurf = Lookup_fbSurface(draw);
   fbContext *ctx = Lookup_fbContext(context);
   EGLBoolean b;

   b = _eglMakeCurrent(drv, dpy, draw, read, context);
   if (!b)
      return EGL_FALSE;

   if (ctx) {
      _mesa_make_current( ctx->glCtx, 
                           drawSurf->mesa_framebuffer,
                           readSurf->mesa_framebuffer);
   } else
      _mesa_make_current( NULL, NULL, NULL );

   return EGL_TRUE;
}
Exemple #4
0
/**
 * Called via eglMakeCurrent(), drv->API.MakeCurrent().
 */
static EGLBoolean
xlib_eglMakeCurrent(_EGLDriver *drv, EGLDisplay dpy,
                    EGLSurface draw, EGLSurface read, EGLContext ctx)
{
   struct xlib_egl_context *context = lookup_context(ctx);
   struct xlib_egl_surface *draw_surf = lookup_surface(draw);
   struct xlib_egl_surface *read_surf = lookup_surface(read);

   if (!_eglMakeCurrent(drv, dpy, draw, read, context))
      return EGL_FALSE;

   st_make_current((context ? context->Context : NULL),
                   (draw_surf ? draw_surf->Framebuffer : NULL),
                   (read_surf ? read_surf->Framebuffer : NULL));

   if (draw_surf)
      check_and_update_buffer_size(draw_surf);
   if (read_surf && read_surf != draw_surf)
      check_and_update_buffer_size(draw_surf);

   return EGL_TRUE;
}