summaryrefslogtreecommitdiffstats
path: root/server/tests/test_display_no_ssl.c
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2010-12-19 22:57:42 +0200
committerAlon Levy <alevy@redhat.com>2011-01-10 14:11:37 +0200
commitc1846506deda818d00a078c482b094bbd3e3f29f (patch)
tree41a292399de8135a837c8a9c461bc0c9003814d1 /server/tests/test_display_no_ssl.c
parent618d13d4d1fd8b493ec1e2035c538837a038c5c5 (diff)
downloadspice-c1846506deda818d00a078c482b094bbd3e3f29f.tar.gz
spice-c1846506deda818d00a078c482b094bbd3e3f29f.tar.xz
spice-c1846506deda818d00a078c482b094bbd3e3f29f.zip
server/tests/test_display_no_ssl: change color every circle
Diffstat (limited to 'server/tests/test_display_no_ssl.c')
-rw-r--r--server/tests/test_display_no_ssl.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/server/tests/test_display_no_ssl.c b/server/tests/test_display_no_ssl.c
index 8d72dfd1..54e9949b 100644
--- a/server/tests/test_display_no_ssl.c
+++ b/server/tests/test_display_no_ssl.c
@@ -30,9 +30,11 @@ void test_spice_destroy_update(SimpleSpiceUpdate *update)
#define WIDTH 320
#define HEIGHT 320
-static float angle = 0;
+static int angle_parts = 64;
+static int angle = 0;
static int unique = 1;
static int color = 0;
+static int c_i = 0;
SimpleSpiceUpdate *test_spice_create_update()
{
@@ -41,14 +43,17 @@ SimpleSpiceUpdate *test_spice_create_update()
QXLImage *image;
QXLCommand *cmd;
QXLRect bbox = {
- .top = HEIGHT/2 + (HEIGHT/3)*cos(angle),
- .left = WIDTH/2 + (WIDTH/3)*sin(angle),
+ .top = HEIGHT/2 + (HEIGHT/3)*cos(angle*2*M_PI/angle_parts),
+ .left = WIDTH/2 + (WIDTH/3)*sin(angle*2*M_PI/angle_parts),
};
uint8_t *dst;
int bw, bh;
int i;
- angle += 0.2;
+ angle++;
+ if ((angle % angle_parts) == 0) {
+ c_i++;
+ }
color = (color + 1) % 2;
unique++;
@@ -91,9 +96,9 @@ SimpleSpiceUpdate *test_spice_create_update()
dst = update->bitmap;
for (i = 0 ; i < bh * bw ; ++i, dst+=4) {
*dst = (color+i % 255);
- *(dst+1) = 255 - color;
- *(dst+2) = (color * (color + i)) & 0xff;
- *(dst+3) = 0;
+ *(dst+((1+c_i)%3)) = 255 - color;
+ *(dst+((2+c_i)%3)) = (color * (color + i)) & 0xff;
+ *(dst+((3+c_i)%3)) = 0;
}
cmd->type = QXL_CMD_DRAW;
@@ -167,7 +172,7 @@ void get_init_info(QXLInstance *qin, QXLDevInitInfo *info)
info->n_surfaces = 1;
}
-#define NOTIFY_DISPLAY_BATCH 1
+#define NOTIFY_DISPLAY_BATCH 10
#define NOTIFY_CURSOR_BATCH 0
int notify = NOTIFY_DISPLAY_BATCH;
@@ -188,7 +193,7 @@ int get_command(QXLInstance *qin, struct QXLCommandExt *ext)
SpiceTimer *wakeup_timer;
-int wakeup_ms = 500;
+int wakeup_ms = 100;
int req_cmd_notification(QXLInstance *qin)
{