summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Allum <mallum@openedhand.com>2006-07-10 09:19:44 +0000
committerMatthew Allum <mallum@openedhand.com>2006-07-10 09:19:44 +0000
commit93ba62549c5631ca1d1710f1514e835bee03c769 (patch)
tree4a73b265a959fe673f2b6943663a34a04e64c993
parentcd7bd9b7c559ccc5a1dcbd1d957a4b61ba60fee0 (diff)
downloadfstests-93ba62549c5631ca1d1710f1514e835bee03c769.tar.gz
fstests-93ba62549c5631ca1d1710f1514e835bee03c769.tar.bz2
fstests-93ba62549c5631ca1d1710f1514e835bee03c769.zip
support 8bit in test-x
-rw-r--r--tests/test-x.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/tests/test-x.c b/tests/test-x.c
index e1297cf..8cc52d9 100644
--- a/tests/test-x.c
+++ b/tests/test-x.c
@@ -104,11 +104,13 @@ x_open(void)
width = DisplayWidth(dpy, scr);
height = DisplayHeight(dpy, scr);
+ /*
if (depth != 16)
{
fprintf(stderr, "Display depth is not 16bpp\n");
exit(1);
}
+ */
gcv.foreground = BlackPixel(dpy, scr);
gcv.background = WhitePixel(dpy, scr);
@@ -192,15 +194,26 @@ x_blit(void)
start_clock = GetTimeInMillis();
- for(y=0; y < height; y++)
- for(x=0; x < width; x++)
- {
- int b = 10;
- int g = ( x - 100 ) / 6;
- int r = 31 - ( y - 100 ) / 16;
+ if (depth == 16)
+ {
+ for(y=0; y < height; y++)
+ for(x=0; x < width; x++)
+ {
+ int b = 10;
+ int g = ( x - 100 ) / 6;
+ int r = 31 - ( y - 100 ) / 16;
- XPutPixel(ximg, x, y, (r<<11 | g << 5 | b));
- }
+ XPutPixel(ximg, x, y, (r<<11 | g << 5 | b));
+ }
+ }
+ else
+ {
+ for(y=0; y < height; y++)
+ for(x=0; x < width; x++)
+ {
+ XPutPixel(ximg, x, y, rand() * 255);
+ }
+ }
finish_clock = GetTimeInMillis();