glamor: Use epoxy_has_gl_extension() instead of rolling our own.
Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
708fe0625f
commit
9d87f66e86
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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) ( \
|
||||
|
|
Loading…
Reference in New Issue