[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 07/16] vnc: palette: add palette_init calls
From: |
Corentin Chary |
Subject: |
[Qemu-devel] [PATCH v3 07/16] vnc: palette: add palette_init calls |
Date: |
Fri, 4 Feb 2011 09:05:59 +0100 |
This allow to use palette on the stack instead of always
allocating them.
Signed-off-by: Corentin Chary <address@hidden>
---
ui/vnc-palette.c | 8 +++++++-
ui/vnc-palette.h | 1 +
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ui/vnc-palette.c b/ui/vnc-palette.c
index c47420b..f93250b 100644
--- a/ui/vnc-palette.c
+++ b/ui/vnc-palette.c
@@ -56,9 +56,15 @@ VncPalette *palette_new(size_t max, int bpp)
VncPalette *palette;
palette = qemu_mallocz(sizeof(*palette));
+ palette_init(palette, max, bpp);
+ return palette;
+}
+
+void palette_init(VncPalette *palette, size_t max, int bpp)
+{
+ memset(palette, 0, sizeof (*palette));
palette->max = max;
palette->bpp = bpp;
- return palette;
}
void palette_destroy(VncPalette *palette)
diff --git a/ui/vnc-palette.h b/ui/vnc-palette.h
index f57d0e7..c646e4d 100644
--- a/ui/vnc-palette.h
+++ b/ui/vnc-palette.h
@@ -51,6 +51,7 @@ typedef struct VncPalette {
} VncPalette;
VncPalette *palette_new(size_t max, int bpp);
+void palette_init(VncPalette *palette, size_t max, int bpp);
void palette_destroy(VncPalette *palette);
int palette_put(VncPalette *palette, uint32_t color);
--
1.7.3.4
- Re: [Qemu-devel] [PATCH v3 01/16] vnc: qemu can die if the client is disconnected while updating screen, (continued)
- [Qemu-devel] [PATCH v3 02/16] vnc: don't set the quality if lossy encoding are disabled, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 03/16] vnc: add a way to get the update frequency for a given region, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 04/16] vnc: refresh lossy rect after a given timeout, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 05/16] vnc: tight: use the update frequency to choose between lossy and lossless, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 06/16] vnc: palette: use a pool to reduce memory allocations, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 07/16] vnc: palette: add palette_init calls,
Corentin Chary <=
- [Qemu-devel] [PATCH v3 08/16] vnc: palette: and fill and color calls., Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 10/16] vnc: fix uint8_t comparisons with negative values, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 09/16] vnc: Add ZRLE and ZYWRLE encodings., Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 11/16] vnc: fix lossy rect refreshing, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 12/16] bitmap: add a generic bitmap and bitops library, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 13/16] vnc: use the new generic bitmap functions, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 14/16] vnc: don't try to send bigger updates that client height, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 15/16] vnc: tight: tweak adaptive tight settings, Corentin Chary, 2011/02/04
- [Qemu-devel] [PATCH v3 16/16] vnc: add a non-adaptive option, Corentin Chary, 2011/02/04
- Re: [Qemu-devel] [PATCH v3 00/16] vnc: adapative tight, zrle, zywrle, and bitmap module, Stefan Weil, 2011/02/24