gl-renderer: rename shader debug flag to green_tint

The new name reflects better what it does.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago
parent 477bdc85c9
commit 5d64e66e06
  1. 4
      libweston/renderer-gl/fragment.glsl
  2. 10
      libweston/renderer-gl/gl-shaders.c

@ -50,7 +50,7 @@ precision mediump float;
* snippet.
*/
const int c_variant = DEF_VARIANT;
const bool c_debug = DEF_DEBUG;
const bool c_green_tint = DEF_GREEN_TINT;
vec4
yuva2rgba(float y, float u, float v, float a)
@ -125,6 +125,6 @@ main()
gl_FragColor = vec4(1.0, 0.3, 1.0, 1.0);
}
if (c_debug)
if (c_green_tint)
gl_FragColor = vec4(0.0, 0.3, 0.0, 0.2) + gl_FragColor * 0.8;
}

@ -63,7 +63,7 @@ shader_init(struct gl_shader *shader, struct gl_renderer *renderer,
const char *vertex_source, const char *fragment_variant)
{
static const char fragment_shader_attrs_fmt[] =
"#define DEF_DEBUG %s\n"
"#define DEF_GREEN_TINT %s\n"
"#define DEF_VARIANT %s\n"
;
char msg[512];
@ -71,7 +71,7 @@ shader_init(struct gl_shader *shader, struct gl_renderer *renderer,
int ret;
const char *sources[3];
char *attrs;
const char *def_debug;
const char *def_green_tint;
shader->vertex_shader =
compile_shader(GL_VERTEX_SHADER, 1, &vertex_source);
@ -79,12 +79,12 @@ shader_init(struct gl_shader *shader, struct gl_renderer *renderer,
return -1;
if (renderer->fragment_shader_debug)
def_debug = "true";
def_green_tint = "true";
else
def_debug = "false";
def_green_tint = "false";
ret = asprintf(&attrs, fragment_shader_attrs_fmt,
def_debug, fragment_variant);
def_green_tint, fragment_variant);
if (ret < 0)
return -1;

Loading…
Cancel
Save