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

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 61097080e53b4950bde87cd532e9498a630bd07a
Author: Kim Woelders <[email protected]>
AuthorDate: Fri Feb 17 14:30:26 2023 +0100

    x11_grab: Eliminate unnecessary pixmap copy
    
    Speeds up 1:1 scaling with non-zero source offset in
    imlib_create_scaled_image_from_drawable().
---
 src/lib/x11_grab.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/lib/x11_grab.c b/src/lib/x11_grab.c
index f535fe4..1484526 100644
--- a/src/lib/x11_grab.c
+++ b/src/lib/x11_grab.c
@@ -833,15 +833,7 @@ __imlib_GrabDrawableScaledToRGBA(uint32_t * data, int nu_x_dst, int nu_y_dst,
 
    if (w_dst == w_src && h_dst == h_src)
      {
-        if (x_src == 0 && y_src == 0)
-          {
-             psc = p;
-          }
-        else
-          {
-             psc = XCreatePixmap(d, p, w_src, h_tmp, depth);
-             XCopyArea(d, p, psc, gc, x_src, y_src, w_src, h_src, 0, 0);
-          }
+        psc = p;
         msc = m;
      }
    else
@@ -887,10 +879,11 @@ __imlib_GrabDrawableScaledToRGBA(uint32_t * data, int nu_x_dst, int nu_y_dst,
                      XCopyArea(d, msc, msc, mgc, 0, xx, w_dst, 1, 0, i);
                }
           }
+        x_src = y_src = 0;
      }
 
    rc = __imlib_GrabDrawableToRGBA(data, 0, 0, w_dst, h_dst, d, psc, msc,
-                                   v, cm, depth, 0, 0, w_dst, h_dst,
+                                   v, cm, depth, x_src, y_src, w_dst, h_dst,
                                    pdomask, grab);
 
    if (mgc)

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

Reply via email to