summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--do_blt.c16
-rw-r--r--do_tests.c8
2 files changed, 23 insertions, 1 deletions
diff --git a/do_blt.c b/do_blt.c
index f843ae5..1f4985a 100644
--- a/do_blt.c
+++ b/do_blt.c
@@ -614,8 +614,14 @@ int
InitCompositeWin(XParms xp, Parms p, int reps)
{
XRenderPictFormat *format;
+ int mul = 1, div = 1;
+
+ if (p->fillStyle) {
+ mul = 0x10000;
+ div = p->fillStyle;
+ }
(void) InitScroll (xp, p, reps);
- InitCopyLocations (xp, p, reps);
+ InitCopyLocations (xp, p, reps, mul, div);
format = XRenderFindVisualFormat (xp->d, xp->vinfo.visual);
winPict = XRenderCreatePicture (xp->d, xp->w, format, 0, NULL);
return reps;
@@ -660,6 +666,14 @@ InitCompositePix(XParms xp, Parms p, int reps)
pix = XCreatePixmap(xp->d, xp->w, WIDTH, HEIGHT, depth);
pixPict = XRenderCreatePicture (xp->d, pix, format, 0, NULL);
+ if (p->fillStyle) {
+ XTransform transform;
+ memset (&transform, '\0', sizeof (transform));
+ transform.matrix[0][0] = 0x10000;
+ transform.matrix[1][1] = 0x10000;
+ transform.matrix[2][2] = p->fillStyle;
+ XRenderSetPictureTransform (xp->d, pixPict, &transform);
+ }
XRenderComposite (xp->d, PictOpClear,
winPict, None, pixPict,
0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
diff --git a/do_tests.c b/do_tests.c
index 5d30dc5..6766d82 100644
--- a/do_tests.c
+++ b/do_tests.c
@@ -1283,6 +1283,14 @@ Test test[] = {
InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
VERSION1_6, COMP, 0,
{4, 500}},
+ {"-magpixwin500", "Scale 250x250 from pixmap to 500x500 window", NULL,
+ InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
+ VERSION1_6, COMP, 0,
+ {4, 500, NULL, NULL, 0x20000}},
+ {"-minpixwin500", "Scale 500x500 from pixmap to 250x250 window", NULL,
+ InitCompositePix, DoCompositePixWin, MidScroll, EndCompositeWin,
+ VERSION1_6, COMP, 0,
+ {4, 250, NULL, NULL, 0x08000}},
{"-noop", "X protocol NoOperation", NULL,
NullInitProc, DoNoOp, NullProc, NullProc,
V1_2FEATURE, PLANEMASK, 0,