[gtk+/wip/ebassi/gles] glarea: Relay the use-es flag to context creation
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/ebassi/gles] glarea: Relay the use-es flag to context creation
- Date: Fri, 22 Apr 2016 16:29:35 +0000 (UTC)
commit 1a5165d060eb919160c79bf7b5d4387728a95ed9
Author: Emanuele Aina <emanuele aina collabora com>
Date: Mon Apr 18 16:15:27 2016 +0200
glarea: Relay the use-es flag to context creation
https://bugzilla.gnome.org/show_bug.cgi?id=743746
gtk/gtkglarea.c | 24 ++++++++++++++++++++++++
gtk/gtkglarea.h | 5 +++++
2 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 245fc6b..efd7d03 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -157,6 +157,7 @@ typedef struct {
gboolean needs_resize;
gboolean needs_render;
gboolean auto_render;
+ gboolean use_es;
} GtkGLAreaPrivate;
enum {
@@ -338,6 +339,7 @@ gtk_gl_area_real_create_context (GtkGLArea *area)
return NULL;
}
+ gdk_gl_context_set_use_es (context, priv->use_es);
gdk_gl_context_set_required_version (context,
priv->required_gl_version / 10,
priv->required_gl_version % 10);
@@ -1012,6 +1014,28 @@ gtk_gl_area_get_error (GtkGLArea *area)
return priv->error;
}
+void
+gtk_gl_area_set_use_es (GtkGLArea *area,
+ gboolean use_es)
+{
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+
+ g_return_if_fail (GTK_IS_GL_AREA (area));
+ g_return_if_fail (!gtk_widget_get_realized (GTK_WIDGET (area)));
+
+ priv->use_es = use_es;
+}
+
+gboolean
+gtk_gl_area_get_use_es (GtkGLArea *area)
+{
+ GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
+
+ g_return_if_fail (GTK_IS_GL_AREA (area));
+
+ return priv->use_es;
+}
+
/**
* gtk_gl_area_set_required_version:
* @area: a #GtkGLArea
diff --git a/gtk/gtkglarea.h b/gtk/gtkglarea.h
index 75d9a21..d769a64 100644
--- a/gtk/gtkglarea.h
+++ b/gtk/gtkglarea.h
@@ -85,6 +85,11 @@ GType gtk_gl_area_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_3_16
GtkWidget * gtk_gl_area_new (void);
+GDK_AVAILABLE_IN_3_22
+void gtk_gl_area_set_use_es (GtkGLArea *area,
+ gboolean use_es);
+GDK_AVAILABLE_IN_3_22
+gboolean gtk_gl_area_get_use_es (GtkGLArea *area);
GDK_AVAILABLE_IN_3_16
void gtk_gl_area_set_required_version (GtkGLArea *area,
gint major,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]