glamor: Use epoxy_has_gl_extension() instead of rolling our own.
authorMarkus Wick <markus@selfnet.de>
Tue, 18 Mar 2014 08:42:49 +0000 (09:42 +0100)
committerEric Anholt <eric@anholt.net>
Wed, 26 Mar 2014 19:58:39 +0000 (12:58 -0700)
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
glamor/glamor.c
glamor/glamor_core.c
glamor/glamor_priv.h

index 0f7d68b..9d171b7 100644 (file)
@@ -367,19 +367,19 @@ glamor_init(ScreenPtr screen, unsigned int flags)
             goto fail;
         }
 
-        if (!glamor_gl_has_extension("GL_EXT_texture_format_BGRA8888")) {
+        if (!epoxy_has_gl_extension("GL_EXT_texture_format_BGRA8888")) {
             ErrorF("GL_EXT_texture_format_BGRA8888 required\n");
             goto fail;
         }
     }
 
-    glamor_priv->has_khr_debug = glamor_gl_has_extension("GL_KHR_debug");
+    glamor_priv->has_khr_debug = epoxy_has_gl_extension("GL_KHR_debug");
     glamor_priv->has_pack_invert =
-        glamor_gl_has_extension("GL_MESA_pack_invert");
+        epoxy_has_gl_extension("GL_MESA_pack_invert");
     glamor_priv->has_fbo_blit =
-        glamor_gl_has_extension("GL_EXT_framebuffer_blit");
+        epoxy_has_gl_extension("GL_EXT_framebuffer_blit");
     glamor_priv->has_buffer_storage =
-        glamor_gl_has_extension("GL_ARB_buffer_storage");
+        epoxy_has_gl_extension("GL_ARB_buffer_storage");
     glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &glamor_priv->max_fbo_size);
 #ifdef MAX_FBO_SIZE
     glamor_priv->max_fbo_size = MAX_FBO_SIZE;
index 6c0b3c8..eeaa595 100644 (file)
@@ -559,28 +559,6 @@ glamor_bitmap_to_region(PixmapPtr pixmap)
     return ret;
 }
 
-/* Borrow from cairo. */
-Bool
-glamor_gl_has_extension(const char *extension)
-{
-    const char *pext;
-    int ext_len;
-
-    ext_len = strlen(extension);
-
-    pext = (const char *) glGetString(GL_EXTENSIONS);
-
-    if (pext == NULL || extension == NULL)
-        return FALSE;
-
-    while ((pext = strstr(pext, extension)) != NULL) {
-        if (pext[ext_len] == ' ' || pext[ext_len] == '\0')
-            return TRUE;
-        pext += ext_len;
-    }
-    return FALSE;
-}
-
 int
 glamor_gl_get_version(void)
 {
index bc7d3f8..f278bef 100644 (file)
@@ -619,7 +619,6 @@ Bool glamor_set_alu(ScreenPtr screen, unsigned char alu);
 Bool glamor_set_planemask(PixmapPtr pixmap, unsigned long planemask);
 Bool glamor_change_window_attributes(WindowPtr pWin, unsigned long mask);
 RegionPtr glamor_bitmap_to_region(PixmapPtr pixmap);
-Bool glamor_gl_has_extension(const char *extension);
 int glamor_gl_get_version(void);
 
 #define GLAMOR_GL_VERSION_ENCODE(major, minor) ( \