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 8d3539234dd0347d6b46b57f004d5fa810852066
Author: Kim Woelders <[email protected]>
AuthorDate: Fri Feb 17 14:25:53 2023 +0100
x11_grab: Drop now unused 1:1 scaling path in __imlib_GrabDrawableScaledToRGBA()
---
src/lib/x11_grab.c | 73 ++++++++++++++++++++++++------------------------------
1 file changed, 32 insertions(+), 41 deletions(-)
diff --git a/src/lib/x11_grab.c b/src/lib/x11_grab.c
index 1484526..fcd8eee 100644
--- a/src/lib/x11_grab.c
+++ b/src/lib/x11_grab.c
@@ -831,59 +831,50 @@ __imlib_GrabDrawableScaledToRGBA(uint32_t * data, int nu_x_dst, int nu_y_dst,
*pdomask = 0;
}
- if (w_dst == w_src && h_dst == h_src)
+ psc = XCreatePixmap(d, p, w_dst, h_tmp, depth);
+
+ if (*pdomask)
{
- psc = p;
- msc = m;
+ msc = XCreatePixmap(d, p, w_dst, h_tmp, 1);
+ mgc = XCreateGC(d, msc, GCForeground | GCGraphicsExposures, &gcv);
}
else
- {
- psc = XCreatePixmap(d, p, w_dst, h_tmp, depth);
-
- if (*pdomask)
- {
- msc = XCreatePixmap(d, p, w_dst, h_tmp, 1);
- mgc = XCreateGC(d, msc, GCForeground | GCGraphicsExposures, &gcv);
- }
- else
- msc = None;
+ msc = None;
- for (i = 0; i < w_dst; i++)
+ for (i = 0; i < w_dst; i++)
+ {
+ xx = (w_src * i) / w_dst;
+ XCopyArea(d, p, psc, gc, x_src + xx, y_src, 1, h_src, i, 0);
+ if (msc != None)
+ XCopyArea(d, m, msc, mgc, xx, 0, 1, h_src, i, 0);
+ }
+ if (h_dst > h_src)
+ {
+ for (i = h_dst - 1; i > 0; i--)
{
- xx = (w_src * i) / w_dst;
- XCopyArea(d, p, psc, gc, x_src + xx, y_src, 1, h_src, i, 0);
+ xx = (h_src * i) / h_dst;
+ if (xx == i)
+ continue; /* Don't copy onto self */
+ XCopyArea(d, psc, psc, gc, 0, xx, w_dst, 1, 0, i);
if (msc != None)
- XCopyArea(d, m, msc, mgc, xx, 0, 1, h_src, i, 0);
- }
- if (h_dst > h_src)
- {
- for (i = h_dst - 1; i > 0; i--)
- {
- xx = (h_src * i) / h_dst;
- if (xx == i)
- continue; /* Don't copy onto self */
- XCopyArea(d, psc, psc, gc, 0, xx, w_dst, 1, 0, i);
- if (msc != None)
- XCopyArea(d, msc, msc, mgc, 0, xx, w_dst, 1, 0, i);
- }
+ XCopyArea(d, msc, msc, mgc, 0, xx, w_dst, 1, 0, i);
}
- else
+ }
+ else
+ {
+ for (i = 0; i < h_dst; i++)
{
- for (i = 0; i < h_dst; i++)
- {
- xx = (h_src * i) / h_dst;
- if (xx == i)
- continue; /* Don't copy onto self */
- XCopyArea(d, psc, psc, gc, 0, xx, w_dst, 1, 0, i);
- if (msc != None)
- XCopyArea(d, msc, msc, mgc, 0, xx, w_dst, 1, 0, i);
- }
+ xx = (h_src * i) / h_dst;
+ if (xx == i)
+ continue; /* Don't copy onto self */
+ XCopyArea(d, psc, psc, gc, 0, xx, w_dst, 1, 0, i);
+ if (msc != None)
+ 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, x_src, y_src, w_dst, h_dst,
+ v, cm, depth, 0, 0, w_dst, h_dst,
pdomask, grab);
if (mgc)
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.