Mesa (master): glx: be explicit about when mapping X <> GLX visuals

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 1 00:07:50 UTC 2018


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

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Thu Sep  6 11:25:38 2018 +0100

glx: be explicit about when mapping X <> GLX visuals

Write down both X and GLX visual types when mapping from one to the
other. Makes grepping through the code a tiny bit easier.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glx/glxext.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index ca3bf9d027..cef8192035 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -343,9 +343,12 @@ static GLint
 convert_from_x_visual_type(int visualType)
 {
    static const int glx_visual_types[] = {
-      GLX_STATIC_GRAY, GLX_GRAY_SCALE,
-      GLX_STATIC_COLOR, GLX_PSEUDO_COLOR,
-      GLX_TRUE_COLOR, GLX_DIRECT_COLOR
+      [StaticGray]  = GLX_STATIC_GRAY,
+      [GrayScale]   = GLX_GRAY_SCALE,
+      [StaticColor] = GLX_STATIC_COLOR,
+      [PseudoColor] = GLX_PSEUDO_COLOR,
+      [TrueColor]   = GLX_TRUE_COLOR,
+      [DirectColor] = GLX_DIRECT_COLOR,
    };
 
    if (visualType < ARRAY_SIZE(glx_visual_types))




More information about the mesa-commit mailing list