Mesa (master): glx: Eliminate some stub functions for !GLX_DIRECT_RENDERING

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 1 19:05:17 UTC 2020


Module: Mesa
Branch: master
Commit: 97ae4297541e52af9f47cdc1e4f65ee06ecb78ba
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=97ae4297541e52af9f47cdc1e4f65ee06ecb78ba

Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Sep 16 11:21:10 2020 -0400

glx: Eliminate some stub functions for !GLX_DIRECT_RENDERING

Move the ifdefs into the corresponding (real) function bodies. No
functional change, just making this file's style consistent.

Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7660>

---

 src/glx/glx_pbuffer.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
index 72833526daa..73835b5cced 100644
--- a/src/glx/glx_pbuffer.c
+++ b/src/glx/glx_pbuffer.c
@@ -188,12 +188,14 @@ determineTextureFormat(const int *attribs, int numAttribs)
 
    return 0;
 }
+#endif
 
 static GLboolean
 CreateDRIDrawable(Display *dpy, struct glx_config *config,
 		  XID drawable, XID glxdrawable,
 		  const int *attrib_list, size_t num_attribs)
 {
+#ifdef GLX_DIRECT_RENDERING
    struct glx_display *const priv = __glXInitialize(dpy);
    __GLXDRIdrawable *pdraw;
    struct glx_screen *psc;
@@ -221,6 +223,7 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config,
 
    pdraw->textureTarget = determineTextureTarget(attrib_list, num_attribs);
    pdraw->textureFormat = determineTextureFormat(attrib_list, num_attribs);
+#endif
 
    return GL_TRUE;
 }
@@ -228,6 +231,7 @@ CreateDRIDrawable(Display *dpy, struct glx_config *config,
 static void
 DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
 {
+#ifdef GLX_DIRECT_RENDERING
    struct glx_display *const priv = __glXInitialize(dpy);
    __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
    XID xid;
@@ -239,24 +243,8 @@ DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
       if (destroy_xdrawable)
          XFreePixmap(priv->dpy, xid);
    }
-}
-
-#else
-
-static GLboolean
-CreateDRIDrawable(Display *dpy, const struct glx_config * fbconfig,
-		  XID drawable, XID glxdrawable,
-		  const int *attrib_list, size_t num_attribs)
-{
-    return GL_TRUE;
-}
-
-static void
-DestroyDRIDrawable(Display *dpy, GLXDrawable drawable, int destroy_xdrawable)
-{
-}
-
 #endif
+}
 
 /**
  * Get a drawable's attribute.



More information about the mesa-commit mailing list