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

git pushed a commit to branch master
in repository enlightenment.

View the commit online.

commit 24daae25db9bef3caad0ea2118e0ce77e1a7bbb4
Author: Carsten Haitzler <ras...@rasterman.com>
AuthorDate: Fri Jul 18 10:50:20 2025 +0100

    pixmap - debug pre rend and commented out debug plus strict geom
    
    strictly use pixmap geom for pixmap size. add debug infra to use later
    to find out what's going on
---
 src/bin/e_comp_canvas.c |   2 +
 src/bin/e_pixmap.c      | 139 ++++++++++++++++++++++++++++++++++++++++--------
 src/bin/e_pixmap.h      |   3 +-
 3 files changed, 122 insertions(+), 22 deletions(-)

diff --git a/src/bin/e_comp_canvas.c b/src/bin/e_comp_canvas.c
index de53573bc..4c4839494 100644
--- a/src/bin/e_comp_canvas.c
+++ b/src/bin/e_comp_canvas.c
@@ -483,6 +483,8 @@ _e_comp_canvas_prerender(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void *even
 
    EINA_LIST_FOREACH(e_comp->pre_render_cbs, l, cb)
      cb();
+
+   e_pixmap_pre_render();
 }
 
 static Eina_Bool
diff --git a/src/bin/e_pixmap.c b/src/bin/e_pixmap.c
index 2edace94f..6e209f6de 100644
--- a/src/bin/e_pixmap.c
+++ b/src/bin/e_pixmap.c
@@ -63,6 +63,13 @@ struct _E_Pixmap
 
 #ifdef HAVE_WAYLAND
 
+static inline int64_t
+_e_pixmap_win_get(E_Pixmap *cp)
+{
+  if (cp->parent) return cp->parent;
+  return cp->win;
+}
+
 static void
 _e_pixmap_cb_deferred_buffer_destroy(struct wl_listener *listener, void *data EINA_UNUSED)
 {
@@ -106,9 +113,12 @@ _e_pixmap_clear(E_Pixmap *cp, Eina_Bool cache)
 #ifndef HAVE_WAYLAND_ONLY
         if (cp->pixmap)
           {
+//             printf("PMAP: + win 0x%08x: free 0x%08x\n",
+//                    (int)_e_pixmap_win_get(cp),
+//                    (int)cp->pixmap);
              ecore_x_pixmap_free(cp->pixmap);
              cp->pixmap = 0;
-             ecore_x_e_comp_pixmap_set(cp->parent ?: (Ecore_X_Window)cp->win, 0);
+             ecore_x_e_comp_pixmap_set(_e_pixmap_win_get(cp), 0);
              e_pixmap_image_clear(cp, cache);
           }
 #endif
@@ -521,55 +531,83 @@ e_pixmap_refresh(E_Pixmap *cp)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_FALSE);
 
-   if (!cp->dirty) return EINA_TRUE;
+   if (!cp->dirty)
+     {
+//        printf("PMAP: + win 0x%08x: not dirty\n",
+//               (int)_e_pixmap_win_get(cp));
+        return EINA_TRUE;
+     }
    switch (cp->type)
      {
       case E_PIXMAP_TYPE_X:
 #ifndef HAVE_WAYLAND_ONLY
         {
            uint32_t pixmap;
-           int pw, ph;
-           E_Comp_X_Client_Data *cd = NULL;
+           int pw = -1, ph = -1;
+//           E_Comp_X_Client_Data *cd = NULL;
 
            if (!cp->usable)
              {
                 cp->failures++;
+//                printf("PMAP: + win 0x%08x: not usable - failures = %i\n",
+//                       (int)_e_pixmap_win_get(cp),
+//                       cp->failures);
                 return EINA_FALSE;
              }
            pixmap =
-             ecore_x_composite_name_window_pixmap_get(cp->parent ?:
-                                                      (Ecore_X_Window)cp->win);
-           if (cp->client)
-             {
-                cd = (E_Comp_X_Client_Data*)cp->client->comp_data;
-             }
+             ecore_x_composite_name_window_pixmap_get(_e_pixmap_win_get(cp));
+//           if (cp->client)
+//             {
+//                cd = (E_Comp_X_Client_Data*)cp->client->comp_data;
+//             }
            success = !!pixmap;
            if (!success) break;
-           if (cd && cd->pw && cd->ph)
-             {
-                pw = cd->pw;
-                ph = cd->ph;
-             }
-           else
+//           if (cd && cd->pw && cd->ph)
+//             {
+//                pw = cd->pw;
+//                ph = cd->ph;
+//             }
+//           else
              ecore_x_pixmap_geometry_get(pixmap, NULL, NULL, &pw, &ph);
            success = (pw > 0) && (ph > 0);
            if (success)
              {
+//                printf("PMAP: + win 0x%08x: 0x%08x -> 0x%08x [%4i x %4i] -> [%4i x %4i]\n",
+//                       (int)_e_pixmap_win_get(cp),
+//                       (int)cp->pixmap,
+//                       (int)pixmap,
+//                       cp->w, cp->h,
+//                       pw, ph);
                 if ((pw != cp->w) || (ph != cp->h))
                   {
-                     ecore_x_pixmap_free(cp->pixmap);
+                     if (cp->pixmap)
+                       {
+//                          printf("PMAP: + win 0x%08x: free 0x%08x\n",
+//                                 (int)_e_pixmap_win_get(cp),
+//                                 (int)cp->pixmap);
+                          ecore_x_pixmap_free(cp->pixmap);
+                       }
                      cp->pixmap = pixmap;
                      cp->w = pw, cp->h = ph;
-                     ecore_x_e_comp_pixmap_set(cp->parent ?:
-                                               (Ecore_X_Window)cp->win,
+                     ecore_x_e_comp_pixmap_set(_e_pixmap_win_get(cp),
                                                cp->pixmap);
                      e_pixmap_image_clear(cp, 0);
                   }
                 else
-                  ecore_x_pixmap_free(pixmap);
+                  {
+//                     printf("PMAP: + win 0x%08x: free 0x%08x (size same)\n",
+//                            (int)_e_pixmap_win_get(cp),
+//                            (int)pixmap);
+                     ecore_x_pixmap_free(pixmap);
+                  }
              }
            else
-             ecore_x_pixmap_free(pixmap);
+             {
+//                printf("PMAP: + win 0x%08x: free 0x%08x (no success)\n",
+//                       (int)_e_pixmap_win_get(cp),
+//                       (int)pixmap);
+                ecore_x_pixmap_free(pixmap);
+             }
         }
 #endif
         break;
@@ -1216,6 +1254,65 @@ e_pixmap_alias(E_Pixmap *cp, E_Pixmap_Type type, ...)
    va_end(l);
 }
 
+/*
+static Eina_Bool
+_e_pixmap_pre_render_pixmap_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, void *data EINA_UNUSED, void *fdata EINA_UNUSED)
+{
+#if 0
+#ifndef HAVE_WAYLAND_ONLY
+  E_Pixmap *p = data;
+
+  if (p->pixmap)
+    {
+      Ecore_X_Pixmap pixmap =
+        ecore_x_composite_name_window_pixmap_get(_e_pixmap_win_get(p));
+      if (pixmap != p->pixmap)
+        {
+          Ecore_X_Pixmap pixmap_old = p->pixmap;
+
+          p->pixmap = pixmap;
+          ecore_x_e_comp_pixmap_set(_e_pixmap_win_get(p),
+                                    p->pixmap);
+          e_pixmap_image_clear(p, 0);
+          if (pixmap_old)
+            {
+              printf("PMAP: + win 0x%08x: free 0x%08x\n",
+                     (int)_e_pixmap_win_get(p),
+                     (int)pixmap_old);
+              ecore_x_pixmap_free(pixmap_old);
+            }
+        }
+      else if (pixmap)
+        ecore_x_pixmap_free(pixmap);
+    }
+#endif
+#else
+//  E_Pixmap *p = data;
+
+//  e_pixmap_dirty(p);
+//  e_pixmap_refresh(p);
+#endif
+  return EINA_TRUE;
+}
+*/
+
+E_API void
+e_pixmap_pre_render(void)
+{
+/*
+  const E_Pixmap_Type types[] = {
+    E_PIXMAP_TYPE_X
+  };
+  int i;
+
+  for (i = 0; i < (int)(sizeof(types) / sizeof(types[0])); i++)
+    {
+      eina_hash_foreach(pixmaps[i], _e_pixmap_pre_render_pixmap_cb, NULL);
+    }
+ */
+}
+
+
 #ifdef HAVE_WAYLAND
 E_API Eina_Bool
 e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *dmabuf)
diff --git a/src/bin/e_pixmap.h b/src/bin/e_pixmap.h
index 293a6786c..afd5065a3 100644
--- a/src/bin/e_pixmap.h
+++ b/src/bin/e_pixmap.h
@@ -53,11 +53,12 @@ E_API void e_pixmap_image_opaque_get(E_Pixmap *cp, int *x, int *y, int *w, int *
 
 E_API void e_pixmap_alias(E_Pixmap *cp, E_Pixmap_Type type, ...);
 
+E_API void e_pixmap_pre_render(void);
+
 #ifdef HAVE_WAYLAND
 E_API Eina_Bool e_pixmap_dmabuf_test(struct linux_dmabuf_buffer *);
 E_API Eina_Bool e_pixmap_dmabuf_formats_query(int **formats, int *num_formats);
 E_API Eina_Bool e_pixmap_dmabuf_modifiers_query(int format, uint64_t **modifiers, int *num_modifiers);
-
 #endif
 
 static inline Eina_Bool

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

Reply via email to