[gtk+] Drop unused GDK_GL values



commit 4dbae1d4bfd510d6485422783c5208097caea67b
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 10 00:02:23 2018 -0500

    Drop unused GDK_GL values
    
    And document the existing ones.

 docs/reference/gtk/running.sgml |   41 ++++++++++++++++++++++++++++++++++++++-
 gdk/gdk.c                       |    4 +--
 gdk/gdkgl.c                     |    2 +-
 gdk/gdkinternals.h              |    9 +++----
 gtk/inspector/visual.c          |   17 +--------------
 gtk/inspector/visual.ui         |   33 -------------------------------
 6 files changed, 48 insertions(+), 58 deletions(-)
---
diff --git a/docs/reference/gtk/running.sgml b/docs/reference/gtk/running.sgml
index 8f6d293..bc0b981 100644
--- a/docs/reference/gtk/running.sgml
+++ b/docs/reference/gtk/running.sgml
@@ -309,7 +309,8 @@ nevertheless.
 
   </variablelist>
   The special value <literal>all</literal> can be used to turn on all
-  debug options.
+  debug options. The special value <literal>help</literal> can be used
+  to obtain a list of all supported debug options.
   </para>
 </formalpara>
 
@@ -397,6 +398,44 @@ nevertheless.
 </formalpara>
 
 <formalpara>
+  <title><envar>GDK_GL</envar></title>
+
+  <para>
+    This variable can be set to a list of options that influence various aspects
+    of the OpenGL support in GTK+.
+  <variablelist>
+    <varlistentry>
+      <term>disable</term>
+      <listitem><para>Disable OpenGL support</para></listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>always</term>
+      <listitem><para>Always use OpenGL for rendering</para></listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>software-draw</term>
+      <listitem><para>Use software rendering</para></listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>texture-rectangle</term>
+      <listitem><para>Use the texture rectangle extension</para></listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>legacy</term>
+      <listitem><para>Use a legacy OpenGL context</para></listitem>
+    </varlistentry>
+    <varlistentry>
+      <term>gles</term>
+      <listitem><para>Use a GLES context</para></listitem>
+    </varlistentry>
+  </variablelist>
+  The special value <literal>all</literal> can be used to turn on all
+  options. The special value <literal>help</literal> can be used
+  to obtain a list of all supported options.
+  </para>
+</formalpara>
+
+<formalpara>
   <title><envar>GTK_CSD</envar></title>
 
   <para>
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 107e88b..4186ab9 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -138,9 +138,7 @@ static GCallback gdk_threads_unlock = NULL;
 static const GDebugKey gdk_gl_keys[] = {
   { "disable",               GDK_GL_DISABLE },
   { "always",                GDK_GL_ALWAYS },
-  { "software-draw",         GDK_GL_SOFTWARE_DRAW_GL | GDK_GL_SOFTWARE_DRAW_SURFACE} ,
-  { "software-draw-gl",      GDK_GL_SOFTWARE_DRAW_GL },
-  { "software-draw-surface", GDK_GL_SOFTWARE_DRAW_SURFACE },
+  { "software-draw",         GDK_GL_SOFTWARE_DRAW } ,
   { "texture-rectangle",     GDK_GL_TEXTURE_RECTANGLE },
   { "legacy",                GDK_GL_LEGACY },
   { "gles",                  GDK_GL_GLES },
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index b831428..ac8dda9 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -469,7 +469,7 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface,
   guint target;
 
   paint_context = gdk_gl_context_get_current ();
-  if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW_SURFACE) == 0 &&
+  if ((_gdk_gl_flags & GDK_GL_SOFTWARE_DRAW) == 0 &&
       paint_context &&
       GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface &&
       GDK_GL_CONTEXT_GET_CLASS (paint_context)->texture_from_surface (paint_context, surface, region))
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index 3e90979..55e83ef 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -81,11 +81,10 @@ typedef enum {
 typedef enum {
   GDK_GL_DISABLE                = 1 << 0,
   GDK_GL_ALWAYS                 = 1 << 1,
-  GDK_GL_SOFTWARE_DRAW_GL       = 1 << 2,
-  GDK_GL_SOFTWARE_DRAW_SURFACE  = 1 << 3,
-  GDK_GL_TEXTURE_RECTANGLE      = 1 << 4,
-  GDK_GL_LEGACY                 = 1 << 5,
-  GDK_GL_GLES                   = 1 << 6
+  GDK_GL_SOFTWARE_DRAW          = 1 << 2,
+  GDK_GL_TEXTURE_RECTANGLE      = 1 << 3,
+  GDK_GL_LEGACY                 = 1 << 4,
+  GDK_GL_GLES                   = 1 << 5
 } GdkGLFlags;
 
 typedef enum {
diff --git a/gtk/inspector/visual.c b/gtk/inspector/visual.c
index 03d4a94..fae2760 100644
--- a/gtk/inspector/visual.c
+++ b/gtk/inspector/visual.c
@@ -74,7 +74,6 @@ struct _GtkInspectorVisualPrivate
   GtkWidget *gl_box;
   GtkWidget *gl_combo;
   GtkWidget *software_gl_switch;
-  GtkWidget *software_surface_switch;
   GtkWidget *texture_rectangle_switch;
 
   GtkAdjustment *focus_adjustment;
@@ -774,19 +773,15 @@ init_gl (GtkInspectorVisual *vis)
                                _("Not settable at runtime.\nUse GDK_GL=always or GDK_GL=disable instead"));
 
   gtk_switch_set_active (GTK_SWITCH (vis->priv->software_gl_switch),
-                         flags & GDK_GL_SOFTWARE_DRAW_GL);
-  gtk_switch_set_active (GTK_SWITCH (vis->priv->software_surface_switch),
-                         flags & GDK_GL_SOFTWARE_DRAW_SURFACE);
+                         flags & GDK_GL_SOFTWARE_DRAW);
   gtk_switch_set_active (GTK_SWITCH (vis->priv->texture_rectangle_switch),
                          flags & GDK_GL_TEXTURE_RECTANGLE);
 
   if (flags & GDK_GL_DISABLE)
     {
       gtk_widget_set_sensitive (vis->priv->software_gl_switch, FALSE);
-      gtk_widget_set_sensitive (vis->priv->software_surface_switch, FALSE);
       gtk_widget_set_sensitive (vis->priv->texture_rectangle_switch, FALSE);
       gtk_widget_set_tooltip_text (vis->priv->software_gl_switch, _("GL rendering is disabled"));
-      gtk_widget_set_tooltip_text (vis->priv->software_surface_switch, _("GL rendering is disabled"));
       gtk_widget_set_tooltip_text (vis->priv->texture_rectangle_switch, _("GL rendering is disabled"));
     }
 }
@@ -829,13 +824,7 @@ update_gl_flag (GtkSwitch  *sw,
 static void
 software_gl_activate (GtkSwitch *sw)
 {
-  update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_GL);
-}
-
-static void
-software_surface_activate (GtkSwitch *sw)
-{
-  update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW_SURFACE);
+  update_gl_flag (sw, GDK_GL_SOFTWARE_DRAW);
 }
 
 static void
@@ -914,7 +903,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_box);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, gl_combo);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_gl_switch);
-  gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, software_surface_switch);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, texture_rectangle_switch);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, font_scale_entry);
   gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorVisual, font_scale_adjustment);
@@ -926,7 +914,6 @@ gtk_inspector_visual_class_init (GtkInspectorVisualClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, layout_activate);
   gtk_widget_class_bind_template_callback (widget_class, widget_resize_activate);
   gtk_widget_class_bind_template_callback (widget_class, software_gl_activate);
-  gtk_widget_class_bind_template_callback (widget_class, software_surface_activate);
   gtk_widget_class_bind_template_callback (widget_class, texture_rectangle_activate);
 }
 
diff --git a/gtk/inspector/visual.ui b/gtk/inspector/visual.ui
index 27d0de1..ffa09ae 100644
--- a/gtk/inspector/visual.ui
+++ b/gtk/inspector/visual.ui
@@ -724,38 +724,6 @@
                         <property name="margin">10</property>
                         <property name="spacing">40</property>
                         <child>
-                          <object class="GtkLabel" id="software_surface_label">
-                            <property name="visible">True</property>
-                            <property name="label" translatable="yes">Software Surfaces</property>
-                            <property name="halign">start</property>
-                            <property name="valign">baseline</property>
-                            <property name="xalign">0.0</property>
-                          </object>
-                        </child>
-                        <child>
-                          <object class="GtkSwitch" id="software_surface_switch">
-                            <property name="visible">True</property>
-                            <property name="halign">end</property>
-                            <property name="valign">baseline</property>
-                            <property name="hexpand">1</property>
-                            <signal name="notify::active" handler="software_surface_activate"/>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkListBoxRow">
-                    <property name="visible">True</property>
-                    <property name="activatable">False</property>
-                    <child>
-                      <object class="GtkBox">
-                        <property name="visible">True</property>
-                        <property name="orientation">horizontal</property>
-                        <property name="margin">10</property>
-                        <property name="spacing">40</property>
-                        <child>
                           <object class="GtkLabel" id="texture_rectangle_label">
                             <property name="visible">True</property>
                             <property name="label" translatable="yes">Texture Rectangle Extension</property>
@@ -803,7 +771,6 @@
       <widget name="touchscreen_label"/>
       <widget name="gl_label"/>
       <widget name="software_gl_label"/>
-      <widget name="software_surface_label"/>
       <widget name="texture_rectangle_label"/>
     </widgets>
   </object>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]