[gtk/glyphy2: 50/53] glyphy: ifdef out debug in the shader




commit f5bd6f86306f5fee5cd911c96b90101e622ec031
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Apr 4 01:14:45 2022 -0400

    glyphy: ifdef out debug in the shader
    
    We don't have a knob to turn this on, and it is
    not really useful outside of glyphy itself, so
    ifdef it out. We should probably remove the
    uniform too.

 gsk/gl/resources/glyphy.fs.glsl | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/gsk/gl/resources/glyphy.fs.glsl b/gsk/gl/resources/glyphy.fs.glsl
index 4e41b67bef..66860734df 100644
--- a/gsk/gl/resources/glyphy.fs.glsl
+++ b/gsk/gl/resources/glyphy.fs.glsl
@@ -49,18 +49,8 @@ main()
   float gsdist = glyphy_sdf (p, gi.nominal_size GLYPHY_DEMO_EXTRA_ARGS);
   float sdist = gsdist / m * u_contrast;
 
-  if (!u_debug) {
-    sdist -= u_boldness * 10.;
-    if (u_outline)
-      sdist = abs (sdist) - u_outline_thickness * .5;
-    if (sdist > 1.)
-      discard;
-    float alpha = antialias (-sdist);
-    if (u_gamma_adjust != 1.)
-      alpha = pow (alpha, 1./u_gamma_adjust);
-
-    gskSetOutputColor(final_color * alpha);
-  } else {
+#if 0
+  if (u_debug) {
     vec4 color = vec4 (0,0,0,0);
 
     // Color the inside of the glyph a light red
@@ -84,4 +74,18 @@ main()
 
     gskSetOutputColor(color);
   }
+  else
+#endif
+  {
+    sdist -= u_boldness * 10.;
+    if (u_outline)
+      sdist = abs (sdist) - u_outline_thickness * .5;
+    if (sdist > 1.)
+      discard;
+    float alpha = antialias (-sdist);
+    if (u_gamma_adjust != 1.)
+      alpha = pow (alpha, 1./u_gamma_adjust);
+
+    gskSetOutputColor(final_color * alpha);
+  }
 }


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