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

git pushed a commit to reference refs/pull/114/head
in repository efl.

View the commit online.

commit 9ad3e8ee2a7ea54ee74edd38f9c0a31fc82e5d29
Author: [email protected] <[email protected]>
AuthorDate: Sun Sep 13 16:22:21 2026 -0600

    evas_ector_gl: use w and h for widths and heights
    
    Carsten's review pointed out that EFL has always named widths and heights
    w and h, as in Evas_Coord w, h, Eina_Size2D and most engine code. The span
    buffer code added on this branch used width, height, alloc_height and wid
    instead, so it read differently from the code around it.
    
    Rename the identifiers the branch introduced:
    
    - Span_Collector fields: height and alloc_height become h and alloc_h.
    - span_collector_new(), _span_texture_init(), _span_collector_alloc() and
      the Span_Collector_Alloc_Fn typedef: the height parameter becomes h.
      This also matches span_collector_resize(), which already took h.
    - Span page upload grouping: Span_Page_Entry.width, the local wid, and
      _entry_cmp_width_desc become w, w and _entry_cmp_w_desc.
    
    Comments that refer to these identifiers use the new names. Where
    "height" or "width" is only an English word in a comment, it is
    unchanged.
    
    eng_ector_surface_create() already took width and height on master, so
    this change leaves it alone. eng_ector_mask_surface_create() keeps the
    same names so it still matches the sibling it was modelled on. Renaming
    both belongs in a separate cleanup of the existing code.
    
    This is a rename only, with no change in behaviour. The build is clean,
    and ector_suite and evas_suite pass.
    
    Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
---
 src/lib/ector/software/ector_software_private.h    |  2 +-
 .../evas/engines/gl_generic/evas_ector_gl_span.c   | 70 +++++++++++-----------
 .../evas/engines/gl_generic/evas_ector_gl_span.h   | 12 ++--
 .../engines/gl_generic/evas_ector_gl_span_shader.c | 28 ++++-----
 src/modules/evas/engines/gl_generic/evas_engine.c  |  6 +-
 5 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/src/lib/ector/software/ector_software_private.h b/src/lib/ector/software/ector_software_private.h
index ec0be22c51..a22b6f36f5 100644
--- a/src/lib/ector/software/ector_software_private.h
+++ b/src/lib/ector/software/ector_software_private.h
@@ -95,7 +95,7 @@ typedef enum _Span_Data_Type {
  * Set on Span_Data by eng_ector_begin(); called by draw_rle_data() for each
  * shape.  Keeps all span_collector_* calls inside the engine module (the only
  * translation unit that includes evas_ector_gl_span.h). */
-typedef void *(*Span_Collector_Alloc_Fn)(void *data, int height,
+typedef void *(*Span_Collector_Alloc_Fn)(void *data, int h,
                                          Span_Data_Type type,
                                          Eina_Bool is_stroke);
 
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.c b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.c
index 9713b05c93..118ac32c78 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.c
@@ -51,22 +51,22 @@
  * sc->textures array, avoiding a separate heap allocation and copy.
  *
  * @param tex     Pointer to the Span_Texture slot to initialise.
- * @param height  Canvas height — determines buffer row count.
+ * @param h       Canvas height — determines buffer row count.
  * @param stride  Bytes per row ((max_spans + 1) * 4).
  * @param x_min   Inclusive left edge of the x-range this texture covers.
  * @param x_max   Inclusive right edge of the x-range this texture covers.
  * @return        EINA_TRUE on success, EINA_FALSE on allocation failure.
  */
 static Eina_Bool
-_span_texture_init(Span_Texture *tex, int height, int stride, int x_min, int x_max)
+_span_texture_init(Span_Texture *tex, int h, int stride, int x_min, int x_max)
 {
    memset(tex, 0, sizeof(*tex));
 
-   if (height <= 0 || height > 16384) return EINA_FALSE;
+   if (h <= 0 || h > 16384) return EINA_FALSE;
 
-   tex->buffer = calloc(height, stride);
-   tex->span_counts = calloc(height, sizeof(int));
-   tex->last_x_end = calloc(height, sizeof(int));
+   tex->buffer = calloc(h, stride);
+   tex->span_counts = calloc(h, sizeof(int));
+   tex->last_x_end = calloc(h, sizeof(int));
    if (!tex->buffer || !tex->span_counts || !tex->last_x_end)
      {
         free(tex->buffer);
@@ -88,17 +88,17 @@ _span_texture_init(Span_Texture *tex, int height, int stride, int x_min, int x_m
 /* ------------------------------------------------------------------ */
 
 Span_Collector *
-span_collector_new(int height, int max_spans, Span_Data_Type type)
+span_collector_new(int h, int max_spans, Span_Data_Type type)
 {
    Span_Collector *sc;
 
-   if (height <= 0 || max_spans <= 0) return NULL;
+   if (h <= 0 || max_spans <= 0) return NULL;
 
    sc = calloc(1, sizeof(Span_Collector));
    if (!sc) return NULL;
 
-   sc->height       = height;
-   sc->alloc_height = height;
+   sc->h            = h;
+   sc->alloc_h      = h;
    sc->max_spans    = max_spans;
    sc->type      = type;
 
@@ -115,7 +115,7 @@ span_collector_new(int height, int max_spans, Span_Data_Type type)
      }
 
    /* Initialise the primary texture slot in place — no alloc+copy+free. */
-   if (!_span_texture_init(&sc->textures[0], height, sc->stride, 0, SPAN_TEXTURE_X_MAX_INITIAL))
+   if (!_span_texture_init(&sc->textures[0], h, sc->stride, 0, SPAN_TEXTURE_X_MAX_INITIAL))
      {
         free(sc->textures);
         free(sc);
@@ -135,8 +135,8 @@ span_collector_new(int height, int max_spans, Span_Data_Type type)
  * Resize a collector for a new active height.
  *
  * Follows the Evas high-water mark pattern (like pipe buffers and RLE
- * spans): buffers grow via realloc when h > alloc_height, but never
- * shrink.  When h <= alloc_height, only the active height is updated
+ * spans): buffers grow via realloc when h > alloc_h, but never
+ * shrink.  When h <= alloc_h, only the active height is updated
  * and the existing buffers are reused — no allocation at all.
  */
 void
@@ -146,9 +146,9 @@ span_collector_resize(Span_Collector *sc, int h)
 
    if (!sc || h <= 0) return;
 
-   if (sc->height == h) return;  /* no change at all */
+   if (sc->h == h) return;  /* no change at all */
 
-   sc->height = h;
+   sc->h = h;
 
    /* When active height changes, the GPU texture dimensions no longer
     * match — mark dirty so the upload path recreates or resizes it. */
@@ -159,7 +159,7 @@ span_collector_resize(Span_Collector *sc, int h)
    }
 
    /* Common case: h fits within existing allocation — no realloc needed. */
-   if (h <= sc->alloc_height)
+   if (h <= sc->alloc_h)
      return;
 
    /* Growth needed: realloc all per-row arrays in each texture slot. */
@@ -176,11 +176,11 @@ span_collector_resize(Span_Collector *sc, int h)
         if (!new_buf || !new_counts || !new_last)
           {
              /* OOM: keep old size, the collector will clip spans to
-              * alloc_height via the height field. */
+              * alloc_h via the h field. */
              if (new_buf) tex->buffer = new_buf;
              if (new_counts) tex->span_counts = new_counts;
              if (new_last) tex->last_x_end = new_last;
-             sc->height = sc->alloc_height;
+             sc->h = sc->alloc_h;
              return;
           }
 
@@ -189,15 +189,15 @@ span_collector_resize(Span_Collector *sc, int h)
         tex->last_x_end = new_last;
 
         /* Zero the newly added rows only. */
-        memset(tex->buffer + (size_t)sc->alloc_height * sc->stride,
-               0, (size_t)(h - sc->alloc_height) * sc->stride);
-        memset(tex->span_counts + sc->alloc_height,
-               0, (size_t)(h - sc->alloc_height) * sizeof(int));
-        memset(tex->last_x_end + sc->alloc_height,
-               0, (size_t)(h - sc->alloc_height) * sizeof(int));
+        memset(tex->buffer + (size_t)sc->alloc_h * sc->stride,
+               0, (size_t)(h - sc->alloc_h) * sc->stride);
+        memset(tex->span_counts + sc->alloc_h,
+               0, (size_t)(h - sc->alloc_h) * sizeof(int));
+        memset(tex->last_x_end + sc->alloc_h,
+               0, (size_t)(h - sc->alloc_h) * sizeof(int));
      }
 
-   sc->alloc_height = h;
+   sc->alloc_h = h;
 }
 
 void
@@ -224,7 +224,7 @@ span_collector_clear(Span_Collector *sc)
 {
    if (!sc) return;
 
-   /* Only zero sc->height rows (the active region), not alloc_height.
+   /* Only zero sc->h rows (the active region), not alloc_h.
     * This is safe because:
     * - span_collector_resize zeros newly added rows when growing
     * - _collect_spans_solid memsets the tail of each row (from the last
@@ -241,14 +241,14 @@ span_collector_clear(Span_Collector *sc)
            Span_Texture *tex = &sc->textures[i];
            int           y;
 
-           memset(tex->span_counts, 0, sc->height * sizeof(int));
-           memset(tex->last_x_end, 0, sc->height * sizeof(int));
+           memset(tex->span_counts, 0, sc->h * sizeof(int));
+           memset(tex->last_x_end, 0, sc->h * sizeof(int));
 
            /* Zero byte[1] (len) of entry 0 on every row so that rows
             * which receive no spans this frame have a valid sentinel.
             * _collect_spans_solid memsets the full tail for rows it touches,
             * so this 4-byte-stride write covers only the uncollected rows. */
-           for (y = 0; y < sc->height; y++)
+           for (y = 0; y < sc->h; y++)
              tex->buffer[(size_t)y * sc->stride + 1] = 0;  /* byte[1] = len = 0 */
 
            tex->dirty = EINA_FALSE;
@@ -447,11 +447,11 @@ _do_spatial_split(Span_Collector *sc, int overflow_y)
    }
 
    /* Initialise the new right-half texture slot in place.
-    * Allocate at alloc_height (high-water mark), not the current active
-    * height.  span_collector_clear memsets alloc_height rows on ALL
-    * textures when the active height grows back within alloc_height. */
+    * Allocate at alloc_h (high-water mark), not the current active
+    * height.  span_collector_clear memsets alloc_h rows on ALL
+    * textures when the active height grows back within alloc_h. */
    if (!_span_texture_init(&sc->textures[sc->texture_count],
-                           sc->alloc_height, sc->stride, split_x, old_x_max))
+                           sc->alloc_h, sc->stride, split_x, old_x_max))
      {
         /* realloc already grew the array; shrink the logical count back down.
          * The uninitialized slot at sc->texture_count is harmless since
@@ -481,7 +481,7 @@ _do_spatial_split(Span_Collector *sc, int overflow_y)
     *            gap is relative to the same origin used during collection.
     * right_last tracks the end of the last span written to the right texture;
     *            initialised to split_x (the x_min of the new right texture). */
-   for (y = 0; y < sc->height; y++)
+   for (y = 0; y < sc->h; y++)
      {
         int src_count  = old_tex->span_counts[y];
         int left_idx   = 0;
@@ -722,7 +722,7 @@ _collect_spans_solid(int count, const SW_FT_Span *spans, void *user_data)
         sx = spans->x + sd->offx;
 
         /* Skip spans outside the canvas. */
-        if (y < 0 || y >= sc->height)
+        if (y < 0 || y >= sc->h)
           {
              spans++;
              count--;
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
index 5554ee1153..71db6b78df 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_span.h
@@ -199,8 +199,8 @@ struct _Span_Collector
    int            split_count;
 
    int            max_spans;       /* max spans per row per texture (default 32) */
-   int            height;          /* active height this frame (VG object height) */
-   int            alloc_height;    /* allocated buffer height (high-water mark, never shrinks) */
+   int            h;               /* active height this frame (VG object height) */
+   int            alloc_h;         /* allocated buffer height (high-water mark, never shrinks) */
    int            stride;          /* bytes per row = (max_spans + 1) * 4
                                     * The +1 reserves a dedicated sentinel slot. */
    int            actual_max_spans; /* max span_counts[y] seen during collection this frame */
@@ -246,7 +246,7 @@ struct _Span_Collector
 /**
  * Allocate and initialise a new Span_Collector.
  *
- * @param height     Canvas height in pixels.  Determines per-texture buffer
+ * @param h          Canvas height in pixels.  Determines per-texture buffer
  *                   allocation.
  * @param max_spans  Maximum spans packed per row.  Pass
  *                   SPAN_COLLECTOR_DEFAULT_MAX_SPANS unless you have a
@@ -255,7 +255,7 @@ struct _Span_Collector
  *                   callback is active.
  * @return           Newly allocated collector, or NULL on allocation failure.
  */
-Span_Collector *span_collector_new(int height, int max_spans, Span_Data_Type type);
+Span_Collector *span_collector_new(int h, int max_spans, Span_Data_Type type);
 
 /**
  * Free all resources owned by @p sc including texture buffers and any
@@ -277,8 +277,8 @@ void span_collector_clear(Span_Collector *sc);
  * Resize a collector for a new active height.
  *
  * Follows the Evas high-water mark pattern: buffers grow via realloc when
- * @p h exceeds alloc_height, but never shrink.  When @p h is within
- * alloc_height, only the active height is updated — no allocation.
+ * @p h exceeds alloc_h, but never shrink.  When @p h is within
+ * alloc_h, only the active height is updated — no allocation.
  */
 void span_collector_resize(Span_Collector *sc, int h);
 
diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c b/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
index 51c46740e8..9154df7768 100644
--- a/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
+++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_span_shader.c
@@ -1394,7 +1394,7 @@ _span_page_ensure(Span_Page *page, Evas_Engine_GL_Context *gc, int w, int h)
 typedef struct
 {
    Span_Texture *tex;
-   int           width;   /* columns the shader will actually read */
+   int           w;       /* columns the shader will actually read */
    int           rows;
    int           stride;  /* source row stride in bytes */
    int           max_spans;
@@ -1402,11 +1402,11 @@ typedef struct
 } Span_Page_Entry;
 
 static int
-_entry_cmp_width_desc(const void *a, const void *b)
+_entry_cmp_w_desc(const void *a, const void *b)
 {
    const Span_Page_Entry *x = a, *y = b;
 
-   if (x->width != y->width) return y->width - x->width;
+   if (x->w != y->w) return y->w - x->w;
    return 0;
 }
 
@@ -1428,10 +1428,10 @@ span_page_upload(void *gc_ptr, Span_Page *page,
    /* Gather every Span_Texture of the pass. */
    SPAN_PAGE_FOREACH(fills, nfills, strokes, nstrokes, sc, tex,
      {
-        int wid = sc->actual_max_spans + 1;
+        int w = sc->actual_max_spans + 1;
 
-        if (wid > sc->max_spans) wid = sc->max_spans;
-        if (wid < 1) wid = 1;
+        if (w > sc->max_spans) w = sc->max_spans;
+        if (w < 1) w = 1;
 
         if (n == cap)
           {
@@ -1446,15 +1446,15 @@ span_page_upload(void *gc_ptr, Span_Page *page,
           }
 
         ent[n].tex       = tex;
-        ent[n].width     = wid;
-        ent[n].rows      = sc->height;
+        ent[n].w         = w;
+        ent[n].rows      = sc->h;
         ent[n].stride    = sc->stride;
         ent[n].max_spans = sc->max_spans;
         ent[n].counts    = tex->span_counts;
         n++;
 
-        total_h += sc->height;
-        if (wid > page_w) page_w = wid;
+        total_h += sc->h;
+        if (w > page_w) page_w = w;
      });
 
    if (!n || total_h <= 0) goto done;
@@ -1463,13 +1463,13 @@ span_page_upload(void *gc_ptr, Span_Page *page,
     * sharing an upload also share its width - putting a 3-column shape in
     * the same rectangle as a 40-column one would upload thirteen times the
     * rows it needs.  Sorting lets similar widths group together below. */
-   qsort(ent, (size_t)n, sizeof(*ent), _entry_cmp_width_desc);
+   qsort(ent, (size_t)n, sizeof(*ent), _entry_cmp_w_desc);
 
    for (i = 0; i < n; i++)
      {
         hash = hash * 31 + ent[i].tex->rolling_hash;
         hash = hash * 31 + (uint32_t)ent[i].rows;
-        hash = hash * 31 + (uint32_t)ent[i].width;
+        hash = hash * 31 + (uint32_t)ent[i].w;
      }
 
    if (!_span_page_ensure(page, gc, page_w, total_h)) goto done;
@@ -1510,12 +1510,12 @@ span_page_upload(void *gc_ptr, Span_Page *page,
    i = 0;
    while (i < n)
      {
-        int      g_start = i, g_w = ent[i].width, g_rows = 0;
+        int      g_start = i, g_w = ent[i].w, g_rows = 0;
         size_t   row_bytes, need;
         uint8_t *packed;
         int      j, at;
 
-        while (i < n && ent[i].width * 2 >= g_w)
+        while (i < n && ent[i].w * 2 >= g_w)
           {
              g_rows += ent[i].rows;
              i++;
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index 49f3480e7b..7aa655254d 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -2747,7 +2747,7 @@ eng_ector_surface_cache_drop(void *engine, void *key)
  * @return           Span_Collector* for this shape, or NULL on failure.
  */
 static void *
-_span_collector_alloc(void *data, int height,
+_span_collector_alloc(void *data, int h,
                       Span_Data_Type type, Eina_Bool is_stroke)
 {
    Ector_Software_Surface_Data *pd = (Ector_Software_Surface_Data *)data;
@@ -2787,7 +2787,7 @@ _span_collector_alloc(void *data, int height,
    /* Create collector for an empty slot; reuse+clear an existing one. */
    if (!(*arr_ptr)[idx])
      {
-        (*arr_ptr)[idx] = span_collector_new(height,
+        (*arr_ptr)[idx] = span_collector_new(h,
                                              SPAN_COLLECTOR_DEFAULT_MAX_SPANS,
                                              type);
         if (!(*arr_ptr)[idx]) return NULL;
@@ -2795,7 +2795,7 @@ _span_collector_alloc(void *data, int height,
    else
      {
         Span_Collector *sc = (Span_Collector *)(*arr_ptr)[idx];
-        span_collector_resize(sc, height);
+        span_collector_resize(sc, h);
         span_collector_clear(sc);
      }
 

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

Reply via email to