kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=21a4172e811de4b085599bcfe923017770ccbb02

commit 21a4172e811de4b085599bcfe923017770ccbb02
Author: Kim Woelders <[email protected]>
Date:   Sat Mar 6 06:39:20 2021 +0100

    Move ImlibImagePixmap population to __imlib_AddImagePixmapToCache()
    
    For similarity with __imlib_FindCachedImagePixmap().
---
 src/lib/image.c    | 39 +++++++++++++++++++++++++++++++++++++--
 src/lib/image.h    |  9 ++++++++-
 src/lib/x11_draw.c | 30 ++++--------------------------
 3 files changed, 49 insertions(+), 29 deletions(-)

diff --git a/src/lib/image.c b/src/lib/image.c
index b3364e9..997ca5d 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -383,11 +383,46 @@ __imlib_FindCachedImagePixmapByID(Display * d, Pixmap p)
 }
 
 /* add a pixmap cahce struct to the pixmap cache (at the start of course */
-void
-__imlib_AddImagePixmapToCache(ImlibImagePixmap * ip)
+ImlibImagePixmap   *
+__imlib_AddImagePixmapToCache(ImlibImage * im, Pixmap pmap, Pixmap mask,
+                              int w, int h,
+                              Display * d, Visual * v, int depth,
+                              int sx, int sy, int sw, int sh,
+                              Colormap cm, char aa, char hiq, char dmask,
+                              DATABIG modification_count)
 {
+   ImlibImagePixmap   *ip;
+
+   ip = __imlib_ProduceImagePixmap();
+   ip->visual = v;
+   ip->depth = depth;
+   ip->image = im;
+   if (im->file)
+      ip->file = strdup(im->file);
+   ip->border.left = im->border.left;
+   ip->border.right = im->border.right;
+   ip->border.top = im->border.top;
+   ip->border.bottom = im->border.bottom;
+   ip->colormap = cm;
+   ip->display = d;
+   ip->w = w;
+   ip->h = h;
+   ip->source_x = sx;
+   ip->source_y = sy;
+   ip->source_w = sw;
+   ip->source_h = sh;
+   ip->antialias = aa;
+   ip->modification_count = modification_count;
+   ip->dither_mask = dmask;
+   ip->hi_quality = hiq;
+   ip->references = 1;
+   ip->pixmap = pmap;
+   ip->mask = mask;
+
    ip->next = pixmaps;
    pixmaps = ip;
+
+   return ip;
 }
 
 /* remove a pixmap cache struct from the pixmap cache */
diff --git a/src/lib/image.h b/src/lib/image.h
index c686dd6..b36f1a9 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -140,7 +140,14 @@ ImlibImagePixmap   
*__imlib_FindCachedImagePixmap(ImlibImage * im, int w, int h,
                                                   char aa, char hiq, char 
dmask,
                                                   DATABIG modification_count);
 ImlibImagePixmap   *__imlib_FindCachedImagePixmapByID(Display * d, Pixmap p);
-void                __imlib_AddImagePixmapToCache(ImlibImagePixmap * ip);
+ImlibImagePixmap   *__imlib_AddImagePixmapToCache(ImlibImage * im,
+                                                  Pixmap p, Pixmap m,
+                                                  int w, int h,
+                                                  Display * d, Visual * v,
+                                                  int depth, int sx, int sy,
+                                                  int sw, int sh, Colormap cm,
+                                                  char aa, char hiq, char 
dmask,
+                                                  DATABIG modification_count);
 void                __imlib_RemoveImagePixmapFromCache(ImlibImagePixmap * ip);
 void                __imlib_CleanupImagePixmapCache(void);
 
diff --git a/src/lib/x11_draw.c b/src/lib/x11_draw.c
index 6735918..20da922 100644
--- a/src/lib/x11_draw.c
+++ b/src/lib/x11_draw.c
@@ -55,32 +55,10 @@ __imlib_CreatePixmapsForImage(Display * d, Drawable w, 
Visual * v, int depth,
    __imlib_RenderImage(d, im, pmap, mask, v, cm, depth, sx, sy, sw, sh, 0, 0,
                        dw, dh, antialias, hiq, 0, dither_mask, mat, cmod,
                        OP_COPY);
-   ip = __imlib_ProduceImagePixmap();
-   ip->visual = v;
-   ip->depth = depth;
-   ip->image = im;
-   if (im->file)
-      ip->file = strdup(im->file);
-   ip->border.left = im->border.left;
-   ip->border.right = im->border.right;
-   ip->border.top = im->border.top;
-   ip->border.bottom = im->border.bottom;
-   ip->colormap = cm;
-   ip->display = d;
-   ip->w = dw;
-   ip->h = dh;
-   ip->source_x = sx;
-   ip->source_y = sy;
-   ip->source_w = sw;
-   ip->source_h = sh;
-   ip->antialias = antialias;
-   ip->modification_count = mod_count;
-   ip->dither_mask = dither_mask;
-   ip->hi_quality = hiq;
-   ip->references = 1;
-   ip->pixmap = pmap;
-   ip->mask = mask;
-   __imlib_AddImagePixmapToCache(ip);
+   ip = __imlib_AddImagePixmapToCache(im, pmap, mask,
+                                      dw, dh, d, v, depth, sx, sy,
+                                      sw, sh, cm, antialias, hiq, dither_mask,
+                                      mod_count);
 #ifdef DEBUG_CACHE
    fprintf(stderr,
            "[Imlib2]  Created pixmap.  Reference count is %d, pixmap 0x%08lx, 
mask 0x%08lx\n",

-- 


Reply via email to