static void fbDestroyContext( __DRIcontextPrivate *driContextPriv ) { GET_CURRENT_CONTEXT(ctx); fbContextPtr fbmesa = (fbContextPtr) driContextPriv->driverPrivate; fbContextPtr current = ctx ? FB_CONTEXT(ctx) : NULL; /* check if we're deleting the currently bound context */ if (fbmesa == current) { _mesa_make_current(NULL, NULL, NULL); } /* Free fb context resources */ if ( fbmesa ) { _swsetup_DestroyContext( fbmesa->glCtx ); _tnl_DestroyContext( fbmesa->glCtx ); _vbo_DestroyContext( fbmesa->glCtx ); _swrast_DestroyContext( fbmesa->glCtx ); /* free the Mesa context */ fbmesa->glCtx->DriverCtx = NULL; _mesa_destroy_context( fbmesa->glCtx ); _mesa_free( fbmesa ); } }
/** * Called by ctx->Driver.GetBufferSize from in core Mesa to query the * current framebuffer size. */ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height ) { GET_CURRENT_CONTEXT(ctx); fbContextPtr fbmesa = FB_CONTEXT(ctx); *width = fbmesa->dri.drawable->w; *height = fbmesa->dri.drawable->h; }
static void updateFramebufferSize(GLcontext *ctx) { fbContextPtr fbmesa = FB_CONTEXT(ctx); struct gl_framebuffer *fb = ctx->WinSysDrawBuffer; if (fbmesa->dri.drawable->w != fb->Width || fbmesa->dri.drawable->h != fb->Height) { driUpdateFramebufferSize(ctx, fbmesa->dri.drawable); } }