summaryrefslogtreecommitdiffstats
path: root/client/canvas.h
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-04-19 16:31:45 +0200
committerAlexander Larsson <alexl@redhat.com>2010-04-23 16:41:42 +0200
commit4f5a09a73d4659e6aaf6537bf9c582df7fe39f00 (patch)
tree611f839c79fffc4583ebd27199d2f7695718777b /client/canvas.h
parent774e5bd36f4fc156dd744a455ff7ddda27441568 (diff)
downloadspice-4f5a09a73d4659e6aaf6537bf9c582df7fe39f00.tar.gz
spice-4f5a09a73d4659e6aaf6537bf9c582df7fe39f00.tar.xz
spice-4f5a09a73d4659e6aaf6537bf9c582df7fe39f00.zip
Make each surface its own depth/format
Surface creation now specifies the exact format, not only the bit depth of each surface which is used for rendering. Additionally we now actually store the surfaces in that format, instead of converting everything to 32bpp when drawing or e.g. handling palettes.
Diffstat (limited to 'client/canvas.h')
-rw-r--r--client/canvas.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/client/canvas.h b/client/canvas.h
index 1dc2acb2..82badc49 100644
--- a/client/canvas.h
+++ b/client/canvas.h
@@ -342,9 +342,12 @@ public:
int width, int height, int gross_pixels,
int n_bytes_per_pixel, bool top_down)
{
- pixman_image_t *surface = alloc_lz_image_surface((LzDecodeUsrData *)opaque_usr_info,
- type, width, height, gross_pixels,
- top_down);
+ ASSERT(type == LZ_IMAGE_TYPE_RGB32 || type == LZ_IMAGE_TYPE_RGBA);
+
+ pixman_image_t *surface =
+ alloc_lz_image_surface((LzDecodeUsrData *)opaque_usr_info,
+ type == LZ_IMAGE_TYPE_RGBA ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8,
+ width, height, gross_pixels, top_down);
uint8_t *data = (uint8_t *)pixman_image_get_data(surface);
if (!top_down) {
data = data - (gross_pixels / height) * n_bytes_per_pixel * (height - 1);