diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-04-19 16:19:43 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-04-23 16:36:35 +0200 |
commit | 98d91203c5d2f6f7249f38941466857b6a566f5d (patch) | |
tree | cdc2b54152f0be3d668ed49b903a35886fcc1c99 /client/cursor_channel.cpp | |
parent | 619c37af17406f77c7cb76f3b72bbfc268383d91 (diff) | |
download | spice-98d91203c5d2f6f7249f38941466857b6a566f5d.tar.gz spice-98d91203c5d2f6f7249f38941466857b6a566f5d.tar.xz spice-98d91203c5d2f6f7249f38941466857b6a566f5d.zip |
Make client canvas and pixmaps handle more formats and simplify
We now support 16bit format pixmaps as well as the old ones. Including
both 555 and 565 modes.
We drop the palette argument for pixmap construction as it was only
used for black/white anyway.
Canvas creation is simplified so that there is no separate set_mode
state. Canvases are already created in the right mode and never change.
Diffstat (limited to 'client/cursor_channel.cpp')
-rw-r--r-- | client/cursor_channel.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/cursor_channel.cpp b/client/cursor_channel.cpp index 0dd9dcb6..289c059f 100644 --- a/client/cursor_channel.cpp +++ b/client/cursor_channel.cpp @@ -112,7 +112,7 @@ void UnsupportedCursor::draw(RedDrawable& dest, int x, int y, const SpiceRect& a AlphaCursor::AlphaCursor(const SpiceCursorHeader& header, const uint8_t* data) : _pixmap (new RedPixmapCairo(header.width, header.height, - RedPixmap::ARGB32, true, NULL, NULL)) + RedPixmap::ARGB32, true, NULL)) { int stride = _pixmap->get_stride(); uint8_t* dest = _pixmap->get_data(); @@ -131,9 +131,8 @@ MonoCursor::MonoCursor(const SpiceCursorHeader& header, const uint8_t* data) : _pixmap (NULL) , _height (header.height) { - rgb32_t pallete[2] = { rgb32_make(0x00, 0x00, 0x00), rgb32_make(0xff, 0xff, 0xff)}; _pixmap.reset(new RedPixmapCairo(header.width, _height * 2, RedPixmap::A1, - true, pallete, NULL)); + true, NULL)); int dest_stride = _pixmap->get_stride(); uint8_t *dest_line = _pixmap->get_data(); @@ -177,12 +176,11 @@ private: ColorCursor::ColorCursor(const SpiceCursorHeader& header) : _pixmap (new RedPixmapCairo(header.width, header.height, - RedPixmap::ARGB32, true, NULL, NULL)) + RedPixmap::ARGB32, true, NULL)) , _invers (NULL) { - rgb32_t pallete[2] = { rgb32_make(0x00, 0x00, 0x00), rgb32_make(0xff, 0xff, 0xff)}; _invers.reset(new RedPixmapCairo(header.width, header.height, RedPixmap::A1, - true, pallete, NULL)); + true, NULL)); } void ColorCursor::init_pixels(const SpiceCursorHeader& header, const uint8_t* pixels, |