diff options
author | Alexander Larsson <alexl@redhat.com> | 2010-04-21 13:08:52 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2010-04-23 16:39:13 +0200 |
commit | 774e5bd36f4fc156dd744a455ff7ddda27441568 (patch) | |
tree | cda4d3dcdb1f516a17ca5f74779f3ddbfc691f96 /client/windows | |
parent | d2a2f18b6e1b77bb6a04121455385d7e23e77168 (diff) | |
download | spice-774e5bd36f4fc156dd744a455ff7ddda27441568.tar.gz spice-774e5bd36f4fc156dd744a455ff7ddda27441568.tar.xz spice-774e5bd36f4fc156dd744a455ff7ddda27441568.zip |
Client: Support pixmap format conversion in copy_pixels
In order to be able to support 16bit canvases on 32bit screens and 32bit
canvases on 16bit screens we need to handle format conversion when drawing
RedPixmaps.
The way this works now for X11 is that we only have one PIXELS_SOURCE_TYPE
for pixmaps, which always has a pixman_image_t for the data, but additionally
it has an XImage (shared mem or not) if the screen the pixmap was created
for (i.e. an explicit one or the default screen) has the same format as
the pixmap.
When we draw a pixmap on a drawable we have two variants. If the pixmap
has a XImage and it matches the format of the target drawable then we
just X(Shm)PutImage it to the drawable. If the formats differ, then we
create a temporary XImage and convert into that before drawing it to
the screen.
Right now this is a bit inefficient, because we always allocate a new
temporary image when converting. We want to add some caching here, but
at least this lets things work again.
Diffstat (limited to 'client/windows')
-rw-r--r-- | client/windows/red_pixmap_cairo.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/windows/red_pixmap_cairo.cpp b/client/windows/red_pixmap_cairo.cpp index 35fe89b8..aa4e5cba 100644 --- a/client/windows/red_pixmap_cairo.cpp +++ b/client/windows/red_pixmap_cairo.cpp @@ -29,7 +29,7 @@ struct RedPixmap_p { HBITMAP prev_bitmap; }; -RedPixmapCairo::RedPixmapCairo(int width, int height, RedPixmap::Format format, +RedPixmapCairo::RedPixmapCairo(int width, int height, RedDrawable::Format format, bool top_bottom, RedWindow *win) : RedPixmap(width, height, format, top_bottom) { |