[gtk+/wip/otte/vulkan: 36/59] gsk: Change GSK_USE_SOFTWARE env var to GSK_RENDERER
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/vulkan: 36/59] gsk: Change GSK_USE_SOFTWARE env var to GSK_RENDERER
- Date: Mon, 5 Dec 2016 12:30:30 +0000 (UTC)
commit a84143cc3c65aa13af01da2bc0c4082820d23979
Author: Benjamin Otte <otte redhat com>
Date: Tue Nov 29 13:36:31 2016 +0100
gsk: Change GSK_USE_SOFTWARE env var to GSK_RENDERER
This way, we can use the variable as more than a boolean flag.
This will be useful for Vulkan or D3D renderers.
gsk/gskrenderer.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 173756f..d6d8b2d 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -698,19 +698,23 @@ gsk_renderer_get_profiler (GskRenderer *renderer)
static GType
get_renderer_for_env_var (GdkWindow *window)
{
- static const char *use_software;
+ static GType env_var_type = G_TYPE_NONE;
- if (use_software == NULL)
+ if (env_var_type == G_TYPE_NONE)
{
- use_software = g_getenv ("GSK_USE_SOFTWARE");
- if (use_software == NULL)
- use_software = "0";
+ const char *renderer_name = g_getenv ("GSK_RENDERER");
+
+ if (renderer_name == NULL)
+ env_var_type = G_TYPE_INVALID;
+ else if (g_ascii_strcasecmp (renderer_name, "cairo") == 0)
+ env_var_type = GSK_TYPE_CAIRO_RENDERER;
+ else if (g_ascii_strcasecmp (renderer_name, "opengl") == 0)
+ env_var_type = GSK_TYPE_GL_RENDERER;
+ else
+ env_var_type = G_TYPE_INVALID;
}
- if (use_software[0] != '0')
- return GSK_TYPE_CAIRO_RENDERER;
-
- return G_TYPE_INVALID;
+ return env_var_type;
}
static GType
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]