Add gdk_gl_context_has_framebuffer_blit()

This checks if the context supports GL_EXT_framebuffer_blit
This commit is contained in:
Alexander Larsson 2014-11-06 12:13:08 +01:00
parent 5f9e6ec2dc
commit 21189b9f7e
2 changed files with 17 additions and 9 deletions

View File

@ -86,6 +86,7 @@ typedef struct {
guint realized : 1;
guint use_texture_rectangle : 1;
guint has_gl_framebuffer_blit : 1;
GdkGLContextPaintData *paint_data;
} GdkGLContextPrivate;
@ -350,6 +351,14 @@ gdk_gl_context_use_texture_rectangle (GdkGLContext *context)
return priv->use_texture_rectangle;
}
gboolean
gdk_gl_context_has_framebuffer_blit (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
return priv->has_gl_framebuffer_blit;
}
static void
gdk_gl_context_realize (GdkGLContext *context)
{
@ -359,6 +368,8 @@ gdk_gl_context_realize (GdkGLContext *context)
has_npot = epoxy_has_gl_extension ("GL_ARB_texture_non_power_of_two");
has_texture_rectangle = epoxy_has_gl_extension ("GL_ARB_texture_rectangle");
priv->has_gl_framebuffer_blit = epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
if (_gdk_gl_flags & GDK_GL_FLAGS_TEXTURE_RECTANGLE)
priv->use_texture_rectangle = TRUE;
else if (has_npot)

View File

@ -49,13 +49,6 @@ struct _GdkGLContextClass
cairo_region_t *region);
};
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
void gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
typedef struct {
guint vertex_array_object;
guint tmp_framebuffer;
@ -72,8 +65,12 @@ typedef struct {
guint texture_quad_rect_program_map_location;
} GdkGLContextPaintData;
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
GdkGLContextPaintData *gdk_gl_context_get_paint_data (GdkGLContext *context);
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
void gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
G_END_DECLS