diff options
author | Keith Packard <keithp@keithp.com> | 2008-03-29 11:45:29 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-03-05 19:11:34 -0800 |
commit | 734c164464a3b5d9d9dd2dc3993de85b1f63c2ff (patch) | |
tree | 7cefcd9b596319686c6309985305de0bef6b120e | |
parent | ccd5cd064817595cfd0e04a926b73fb17fe31092 (diff) |
Add up/down scaling composite tests
-rw-r--r-- | do_blt.c | 16 | ||||
-rw-r--r-- | do_tests.c | 8 |
2 files changed, 23 insertions, 1 deletions
@@ -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); @@ -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, |