diff options
author | Paul Berry <[email protected]> | 2012-11-14 15:50:27 -0800 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2017-03-16 14:14:18 +1100 |
commit | 6b70d9fce39c32929372fb8cf62f1f9072fe91e1 (patch) | |
tree | e248699a7439d997c7dd8c77882b937a2469546d /src/glx/dri2_glx.c | |
parent | 77630841da53ec90415aee37fcc0ec4cf76941e1 (diff) |
glx: Implement __DRI_BACKGROUND_CALLABLE
v2: Marek: Add DRI3 support.
v3: (Timothy Arceri) use C99 initializers.
Acked-by: Timothy Arceri <[email protected]>
Acked-by: Marek Olšák <[email protected]>
Tested-by: Dieter Nützel <[email protected]>
Tested-by: Mike Lothian <[email protected]>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r-- | src/glx/dri2_glx.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 5b93f2f6f49..145f44d6e8c 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -74,7 +74,7 @@ struct dri2_display __glxHashTable *dri2Hash; - const __DRIextension *loader_extensions[4]; + const __DRIextension *loader_extensions[5]; }; struct dri2_drawable @@ -946,6 +946,13 @@ dri2GetSwapInterval(__GLXDRIdrawable *pdraw) return priv->swap_interval; } +static void +driSetBackgroundContext(void *loaderPrivate) +{ + struct dri2_context *pcp = (struct dri2_context *) loaderPrivate; + __glXSetCurrentContext(&pcp->base); +} + static const __DRIdri2LoaderExtension dri2LoaderExtension = { .base = { __DRI_DRI2_LOADER, 3 }, @@ -966,6 +973,12 @@ static const __DRIuseInvalidateExtension dri2UseInvalidate = { .base = { __DRI_USE_INVALIDATE, 1 } }; +static const __DRIbackgroundCallableExtension driBackgroundCallable = { + .base = { __DRI_BACKGROUND_CALLABLE, 1 }, + + .setBackgroundContext = driSetBackgroundContext, +}; + _X_HIDDEN void dri2InvalidateBuffers(Display *dpy, XID drawable) { @@ -1395,6 +1408,8 @@ dri2CreateDisplay(Display * dpy) pdp->loader_extensions[i++] = &dri2UseInvalidate.base; + pdp->loader_extensions[i++] = &driBackgroundCallable.base; + pdp->loader_extensions[i++] = NULL; pdp->dri2Hash = __glxHashCreate(); |