diff options
author | Alon Levy <alevy@redhat.com> | 2012-04-19 13:48:41 +0300 |
---|---|---|
committer | Yonit Halperin <yhalperi@redhat.com> | 2012-05-03 13:09:51 +0300 |
commit | 76fd64ad96aed9d7e567eb5e447a5d83181743f2 (patch) | |
tree | dcba375f5d3bbdaab1c2d98ffbdb9b77b88a3301 /server/tests/test_display_base.h | |
parent | 703f32cda91db552167324c542e19ef720c474dc (diff) | |
download | spice-76fd64ad96aed9d7e567eb5e447a5d83181743f2.tar.gz spice-76fd64ad96aed9d7e567eb5e447a5d83181743f2.tar.xz spice-76fd64ad96aed9d7e567eb5e447a5d83181743f2.zip |
server/tests: refactor Command
Diffstat (limited to 'server/tests/test_display_base.h')
-rw-r--r-- | server/tests/test_display_base.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/server/tests/test_display_base.h b/server/tests/test_display_base.h index 6922d9ba..b7697217 100644 --- a/server/tests/test_display_base.h +++ b/server/tests/test_display_base.h @@ -23,13 +23,36 @@ typedef enum { DESTROY_PRIMARY, CREATE_PRIMARY, } CommandType; -typedef struct Command { + +typedef struct CommandCreatePrimary { + uint32_t width; + uint32_t height; +} CommandCreatePrimary; + +typedef struct CommandDrawBitmap { + QXLRect bbox; + uint8_t *bitmap; + uint32_t surface_id; +} CommandDrawBitmap; + +typedef struct CommandDrawSolid { + QXLRect bbox; + uint32_t color; + uint32_t surface_id; +} CommandDrawSolid; + +typedef struct Command Command; + +struct Command { CommandType command; - uint64_t arg1; - uint64_t arg2; - void (*cb)(void *cb_opaque, uint64_t *arg1, uint64_t *arg2); + void (*cb)(Command *command); void *cb_opaque; -} Command; + union { + CommandCreatePrimary create_primary; + CommandDrawBitmap bitmap; + CommandDrawSolid solid; + }; +}; void test_set_simple_command_list(int *command, int num_commands); void test_set_command_list(Command *command, int num_commands); |