gsk: Improve GSK_RENDERER behavior

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
This commit is contained in:
Benjamin Otte 2018-05-07 16:45:32 +02:00
parent d056be4ea2
commit 69644993f6
2 changed files with 28 additions and 6 deletions

View 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>

View 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");