This is an automated email from the git hooks/post-receive script.

git pushed a commit to reference refs/pull/10/head
in repository expedite.

View the commit online.

commit 9dd022035c8cd151cda3581921a24ec22d32951e
Author: Cedric Bail <[email protected]>
AuthorDate: Sat Nov 28 13:48:15 2026 -0600

    perf: make Font Effect Alpha Write show what it writes
    
    Its moving fill replaced the coverage of the text, so most of the frame
    was one flat block over the letters, and a wrong value in it looked as
    plausible as the right one: it hid that an in-place curve blended over
    its source in Evas.
    
    The partial coverage is now a band filled before the text is drawn over
    it, which stays readable, with one curve in place and one into a second
    buffer. Its timings do not compare with those of the previous version.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/bin/font_effect_alpha_write.c | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/src/bin/font_effect_alpha_write.c b/src/bin/font_effect_alpha_write.c
index 32e22c4..a11efb4 100644
--- a/src/bin/font_effect_alpha_write.c
+++ b/src/bin/font_effect_alpha_write.c
@@ -15,13 +15,19 @@
 
 #include "ui.h"
 
-/* Colored fill and blend into an alpha buffer, which keeps their coverage
- * only, then a colored blend out of it. */
+/* A band of partial coverage slides under the text in an alpha buffer, which
+ * keeps the coverage only of what is filled and blended into it, colors and
+ * all. A curve raises the band in place, another lowers it into a second
+ * buffer, and that one is blended out in color. */
 
 /* standard var */
 static int done = 0;
 /* private data */
 static Evas_Object *text;
+static int text_w;
+
+#define PAD 20
+#define BAND 120
 
 /* setup */
 static void _setup(void)
@@ -34,7 +40,8 @@ static void _setup(void)
    evas_object_text_text_set(text, "Font Effect");
    evas_object_show(text);
    evas_object_geometry_get(text, NULL, NULL, &w, &h);
-   evas_object_move(text, (win_w - w) / 2 - 20, (win_h - h) / 2 - 20);
+   text_w = w;
+   evas_object_move(text, (win_w - w) / 2 - PAD, (win_h - h) / 2 - PAD);
 
    done = 0;
 }
@@ -49,15 +56,21 @@ static void _cleanup(void)
 static void _loop(double t, int f)
 {
    char buf[512];
+   /* margins of the band, in the buffers which are the text and its padding */
+   const int span = text_w + (2 * PAD) - BAND;
+   const int x = (span > 0) ? ((f * 4) % span) : 0;
+   const int right = (span > x) ? (span - x) : 0;
 
    snprintf(buf, sizeof(buf),
-            "padding_set({ 20 });"
+            "padding_set({ %d });"
             "a = buffer({ 'alpha' });"
+            "b = buffer({ 'alpha' });"
+            "fill({ dst = a, color = '#00ff0060', l = %d, r = %d });"
             "blend({ dst = a, color = 'red' });"
-            "fill({ dst = a, color = '#00ff0060', l = %d });"
-            "curve({ points = '0:0-128:192-255:255', src = "" dst = a });"
-            "blend({ a, color = 'darkblue' });",
-            20 + (f * 4) % 400);
+            "curve({ points = '0:0-96:144-255:255', src = "" dst = a });"
+            "curve({ points = '0:0-144:80-255:255', src = "" dst = b });"
+            "blend({ b, color = 'darkblue' });",
+            PAD, x, right);
    efl_gfx_filter_program_set(text, buf, "test");
 
    FPS_STD(NAME);
@@ -92,3 +105,5 @@ void FNAME(void)
 #undef FNAME
 #undef NAME
 #undef ICON
+#undef PAD
+#undef BAND

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to