gsk: Improve GSK_RENDERER behavior
authorBenjamin Otte <otte@redhat.com>
Mon, 7 May 2018 14:45:32 +0000 (16:45 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 May 2018 14:45:32 +0000 (16:45 +0200)
1. Include the broadway renderer (so we can test it properly fails on
   Wayland or X11)
2. List all potential renderers, print useful information when Vulkan
   is not compiled in instea dof omitting it
3. Improve docs

docs/reference/gtk/running.sgml
gsk/gskrenderer.c

index a001ffec2862be283698ca3dcd85e2ab550208d1..90ec4178f65c273c61601ae5a4627e536650e978 100644 (file)
@@ -465,22 +465,33 @@ nevertheless.
 
   <para>
     If set, selects the GSK renderer to use. The following renderers can
-    be selected, provided they are included in the GSK libraries you are using:
+    be selected, provided they are included in the GTK library you are using
+    and the GDK backend supports them:
     <variablelist>
 
       <varlistentry>
-        <term>vulkan</term>
-        <listitem><para>Selects the Vulkan renderer</para></listitem>
+        <term>help</term>
+        <listitem><para>Prints information about available options</para></listitem>
       </varlistentry>
 
       <varlistentry>
-        <term>gl</term>
-        <listitem><para>Selects the Vulkan renderer</para></listitem>
+        <term>broadway</term>
+        <listitem><para>Selects the Broadway-backend specific renderer</para></listitem>
       </varlistentry>
 
       <varlistentry>
         <term>cairo</term>
-        <listitem><para>Selects the cairo renderer</para></listitem>
+        <listitem><para>Selects the fallback Cairo renderer</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>gl</term>
+        <listitem><para>Selects the default OpenGL renderer</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term>vulkan</term>
+        <listitem><para>Selects the Vulkan renderer</para></listitem>
       </varlistentry>
 
     </variablelist>
index 9c10209b5309d987d8c4c7c9b400f16bc4b853de..11b8cd2074afb65ae99436ca6a15ddb4198a11cd 100644 (file)
@@ -545,6 +545,10 @@ get_renderer_for_name (const char *renderer_name)
 {
   if (renderer_name == NULL)
     return G_TYPE_INVALID;
+#ifdef GDK_WINDOWING_BROADWAY
+  else if (g_ascii_strcasecmp (renderer_name, "broadway") == 0)
+    return GSK_TYPE_BROADWAY_RENDERER;
+#endif
   else if (g_ascii_strcasecmp (renderer_name, "cairo") == 0)
     return GSK_TYPE_CAIRO_RENDERER;
   else if (g_ascii_strcasecmp (renderer_name, "opengl") == 0
@@ -557,10 +561,17 @@ get_renderer_for_name (const char *renderer_name)
   else if (g_ascii_strcasecmp (renderer_name, "help") == 0)
     {
       g_print ("Supported arguments for GSK_RENDERER environment variable:\n");
+#ifdef GDK_WINDOWING_BROADWAY
+      g_print ("broadway - Use the Broadway specific renderer\n");
+#else
+      g_print ("broadway - disabled during GTK build\n");
+#endif
       g_print ("   cairo - Use the Cairo fallback renderer\n");
       g_print ("  opengl - Use the default OpenGL renderer\n");
 #ifdef GDK_RENDERING_VULKAN
       g_print ("  vulkan - Use the Vulkan renderer\n");
+#else
+      g_print ("  vulkan - Disabled during GTK build\n");
 #endif
       g_print ("    help - Print this help\n\n");
       g_print ("Other arguments will cause a warning and be ignored.\n");