[PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.
Rami Ylimäki
rami.ylimaki at vincit.fi
Mon Jan 31 05:48:56 PST 2011
Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
---
do_blt.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/do_blt.c b/do_blt.c
index 4be2836..fae9e1d 100644
--- a/do_blt.c
+++ b/do_blt.c
@@ -208,6 +208,16 @@ InitCopyPix(XParms xp, Parms p, int reps)
int
InitGetImage(XParms xp, Parms p, int reps)
{
+ int screenWidth = DisplayWidth(xp->d, xp->vinfo.screen);
+ int screenHeight = DisplayHeight(xp->d, xp->vinfo.screen);
+
+ if ((windowWidth > screenWidth) || (windowHeight > screenHeight))
+ {
+ printf("Can't read contents of %dx%d window on %dx%d screen, benchmark omitted\n",
+ windowWidth, windowHeight, screenWidth, screenHeight);
+ return False;
+ }
+
(void) InitCopyWin(xp, p, reps);
/* Create image to stuff bits into */
--
1.6.3.3
More information about the xorg-devel
mailing list