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

git pushed a commit to branch vtorri_putenv
in repository expedite.

View the commit online.

commit b9bfcc073233cfda9efe1d2cb41774b18f7f3317
Author: [email protected] <[email protected]>
AuthorDate: Thu Apr 23 18:35:18 2026 -0600

    perf: add textgrid change benchmark
    
    Exercises evas_object_textgrid with per-frame full-grid
    redraws and randomized attributes, mirroring terminology's
    worst-case render pattern. Used to track upstream textgrid
    improvements and to measure terminology render-loop changes.
---
 src/bin/meson.build       |   1 +
 src/bin/tests.h           |   1 +
 src/bin/textgrid_change.c | 152 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 154 insertions(+)

diff --git a/src/bin/meson.build b/src/bin/meson.build
index 3bc3736..672e82d 100644
--- a/src/bin/meson.build
+++ b/src/bin/meson.build
@@ -72,6 +72,7 @@ expedite_sources = [ 'main.c',
 	'text_styles.c',
 	'text_styles_different_strings.c',
 	'text_change.c',
+	'textgrid_change.c',
 	'textblock_basic.c',
 	'textblock_intl.c',
 	'textblock_auto_align.c',
diff --git a/src/bin/tests.h b/src/bin/tests.h
index 6e9d6c1..55c3aa6 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -65,6 +65,7 @@
 #include "text_styles.c"
 #include "text_styles_different_strings.c"
 #include "text_change.c"
+#include "textgrid_change.c"
 #include "textblock_basic.c"
 #include "textblock_intl.c"
 #include "textblock_auto_align.c"
diff --git a/src/bin/textgrid_change.c b/src/bin/textgrid_change.c
new file mode 100644
index 0000000..703f33e
--- /dev/null
+++ b/src/bin/textgrid_change.c
@@ -0,0 +1,152 @@
+#undef FNAME
+#undef NAME
+#undef ICON
+
+/* metadata */
+#define FNAME textgrid_change_start
+#define NAME "Textgrid Change"
+#define ICON "text.png"
+
+#ifndef PROTO
+# ifndef UI
+#  include "main.h"
+
+#define TG_COLS 80
+#define TG_ROWS 25
+#define TG_PALETTE 16
+
+static int done = 0;
+static Evas_Object *o_grid = NULL;
+
+static void
+_fill_random_row(Evas_Textgrid_Cell *row)
+{
+   int x;
+   for (x = 0; x < TG_COLS; x++)
+     {
+        unsigned int r = rnd();
+        row[x].codepoint = 0x20 + (r % 95);
+        row[x].fg = r % TG_PALETTE;
+        row[x].bg = (r >> 4) % TG_PALETTE;
+        row[x].bold = (r >> 8) & 1;
+        row[x].italic = (r >> 9) & 1;
+        row[x].underline = (r >> 10) & 1;
+        row[x].strikethrough = 0;
+        row[x].fg_extended = 0;
+        row[x].bg_extended = 0;
+        row[x].double_width = 0;
+     }
+}
+
+static void _setup(void)
+{
+   int i;
+   Evas_Object *o;
+
+   o = evas_object_textgrid_add(evas);
+   o_grid = o;
+   evas_object_textgrid_font_set(o, "Vera-Bold", 14);
+   evas_object_textgrid_size_set(o, TG_COLS, TG_ROWS);
+
+   /* a small palette: 16 standard-palette entries */
+   for (i = 0; i < TG_PALETTE; i++)
+     {
+        int r = (i & 1) ? 255 : 96;
+        int g = (i & 2) ? 255 : 96;
+        int b = (i & 4) ? 255 : 96;
+        evas_object_textgrid_palette_set
+          (o, EVAS_TEXTGRID_PALETTE_STANDARD, i, r, g, b, 255);
+     }
+
+   {
+      Evas_Coord cw = 0, ch = 0;
+      evas_object_textgrid_cell_size_get(o, &cw, &ch);
+      if (cw < 1) cw = 8;
+      if (ch < 1) ch = 16;
+      evas_object_resize(o, TG_COLS * cw, TG_ROWS * ch);
+   }
+   evas_object_move(o, 0, 0);
+   evas_object_show(o);
+
+   srnd();
+
+   for (i = 0; i < TG_ROWS; i++)
+     {
+        Evas_Textgrid_Cell *row = evas_object_textgrid_cellrow_get(o_grid, i);
+        if (!row) continue;
+        _fill_random_row(row);
+        evas_object_textgrid_cellrow_set(o_grid, i, row);
+        evas_object_textgrid_update_add(o_grid, 0, i, TG_COLS, 1);
+     }
+
+   done = 0;
+}
+
+static void _cleanup(void)
+{
+   if (o_grid) { efl_del(o_grid); o_grid = NULL; }
+}
+
+static void _loop(double t, int f)
+{
+   int y, x;
+   Evas_Textgrid_Cell *row_dst, *row_src, *last_row;
+
+   (void)t;
+   (void)f;
+
+   /* Scroll up by one row every frame: copy row[y+1] -> row[y] for y in
+    * [0, TG_ROWS-2], then fill the last row with fresh random content.
+    * Every cell in the grid is written every frame (same render stress
+    * as a full-grid rewrite) but with visible temporal coherence, so
+    * the animation looks like a waterfall of text moving upward — much
+    * like a terminal streaming output line by line. */
+   for (y = 0; y < TG_ROWS - 1; y++)
+     {
+        row_dst = evas_object_textgrid_cellrow_get(o_grid, y);
+        row_src = evas_object_textgrid_cellrow_get(o_grid, y + 1);
+        if (!row_dst || !row_src) continue;
+        for (x = 0; x < TG_COLS; x++)
+          row_dst[x] = row_src[x];
+        evas_object_textgrid_cellrow_set(o_grid, y, row_dst);
+        evas_object_textgrid_update_add(o_grid, 0, y, TG_COLS, 1);
+     }
+
+   last_row = evas_object_textgrid_cellrow_get(o_grid, TG_ROWS - 1);
+   if (last_row)
+     {
+        _fill_random_row(last_row);
+        evas_object_textgrid_cellrow_set(o_grid, TG_ROWS - 1, last_row);
+        evas_object_textgrid_update_add(o_grid, 0, TG_ROWS - 1, TG_COLS, 1);
+     }
+
+   FPS_STD(NAME);
+}
+
+static void _key(const char *key)
+{
+   KEY_STD;
+}
+
+# endif
+#endif
+
+#ifdef UI
+_ui_menu_item_add(ICON, NAME, FNAME);
+#endif
+
+#ifdef PROTO
+void FNAME(void);
+#endif
+
+#ifndef PROTO
+# ifndef UI
+void FNAME(void)
+{
+   ui_func_set(_key, _loop, _setup);
+}
+# endif
+#endif
+#undef FNAME
+#undef NAME
+#undef ICON

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

Reply via email to