summaryrefslogtreecommitdiffstats
path: root/client/canvas.h
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2010-06-01 10:30:51 +0300
committerAlexander Larsson <alexl@redhat.com>2010-06-09 11:41:01 +0200
commit5d2ae66f5022187e0028a1d7ccf67fe48fdaa94b (patch)
tree0458ad257a08447d5edc21c6391225ac8b738717 /client/canvas.h
parent263646a1f7e705766f7d46017679812d4b1406b8 (diff)
downloadspice-5d2ae66f5022187e0028a1d7ccf67fe48fdaa94b.tar.gz
spice-5d2ae66f5022187e0028a1d7ccf67fe48fdaa94b.tar.xz
spice-5d2ae66f5022187e0028a1d7ccf67fe48fdaa94b.zip
support for lossy images in the pixmap cache and fill bits
1) add an option to determine if a bitmap can be sent lossy to the client 2) when required, replacing lossy cache items with their correspending lossless bitmaps
Diffstat (limited to 'client/canvas.h')
-rw-r--r--client/canvas.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/client/canvas.h b/client/canvas.h
index 8d64ca3f..f0314b93 100644
--- a/client/canvas.h
+++ b/client/canvas.h
@@ -163,17 +163,38 @@ public:
cache->add(id, surface);
}
+ static void op_put_lossy(SpiceImageCache *c, uint64_t id, pixman_image_t *surface)
+ {
+ PixmapCache* cache = reinterpret_cast<PixmapCache*>(c);
+ cache->add(id, surface, TRUE);
+ }
+
+ static void op_replace_lossy(SpiceImageCache *c, uint64_t id, pixman_image_t *surface)
+ {
+ PixmapCache* cache = reinterpret_cast<PixmapCache*>(c);
+ cache->replace(id, surface);
+ }
+
static pixman_image_t* op_get(SpiceImageCache *c, uint64_t id)
{
PixmapCache* cache = reinterpret_cast<PixmapCache*>(c);
return cache->get(id);
}
+ static pixman_image_t* op_get_lossless(SpiceImageCache *c, uint64_t id)
+ {
+ PixmapCache* cache = reinterpret_cast<PixmapCache*>(c);
+ return cache->get_lossless(id);
+ }
+
SpiceImageCacheBase()
{
static SpiceImageCacheOps cache_ops = {
op_put,
- op_get
+ op_get,
+ op_put_lossy,
+ op_replace_lossy,
+ op_get_lossless
};
base.ops = &cache_ops;
}