Merge branch 'unavailable-gl-functions' into 'gtk-3-24'
gl: Limit glGetTexLevelParameteriv use to supported platforms See merge request GNOME/gtk!6554
This commit is contained in:
commit
a0277a46d3
15
gdk/gdkgl.c
15
gdk/gdkgl.c
@ -392,7 +392,17 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
else if (source_type == GL_TEXTURE)
|
||||
{
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
|
||||
if (gdk_gl_context_has_tex_param (paint_context))
|
||||
{
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
alpha_size = 1;
|
||||
if (gdk_gl_context_has_tex_param (paint_context))
|
||||
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
|
||||
else
|
||||
alpha_size = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -538,7 +548,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
|
||||
|
||||
glBindTexture (GL_TEXTURE_2D, source);
|
||||
|
||||
if (gdk_gl_context_get_use_es (paint_context))
|
||||
if (gdk_gl_context_get_use_es (paint_context) ||
|
||||
!gdk_gl_context_has_tex_param (paint_context))
|
||||
{
|
||||
texture_width = width;
|
||||
texture_height = height;
|
||||
|
@ -107,6 +107,7 @@ typedef struct {
|
||||
guint debug_enabled : 1;
|
||||
guint forward_compatible : 1;
|
||||
guint is_legacy : 1;
|
||||
guint has_tex_param : 1;
|
||||
|
||||
int use_es;
|
||||
|
||||
@ -435,6 +436,14 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
|
||||
return priv->has_frame_terminator;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_tex_param (GdkGLContext *context)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
return priv->has_tex_param;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_gl_context_has_unpack_subimage (GdkGLContext *context)
|
||||
{
|
||||
@ -829,6 +838,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
priv->has_unpack_subimage = epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
|
||||
priv->has_sync = priv->gl_version >= 30;
|
||||
priv->has_texture_format_bgra = epoxy_has_gl_extension ("GL_EXT_texture_format_BGRA8888");
|
||||
priv->has_tex_param = priv->gl_version >= 31;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -838,6 +848,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
||||
priv->has_gl_framebuffer_blit = priv->gl_version >= 30 || epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
|
||||
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
|
||||
priv->has_unpack_subimage = TRUE;
|
||||
priv->has_tex_param = priv->gl_version >= 10 &&
|
||||
epoxy_is_desktop_gl ();
|
||||
priv->has_sync = priv->gl_version >= 32 ||
|
||||
epoxy_has_gl_extension ("GL_ARB_sync") ||
|
||||
epoxy_has_gl_extension ("GL_APPLE_sync");
|
||||
|
@ -85,6 +85,7 @@ GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext
|
||||
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_tex_param (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_sync (GdkGLContext *context);
|
||||
gboolean gdk_gl_context_has_texture_format_bgra (GdkGLContext *context);
|
||||
|
Loading…
Reference in New Issue
Block a user