[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 22/22] pixman: drop obsolete fields from DisplaySurf
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 22/22] pixman: drop obsolete fields from DisplaySurface |
Date: |
Thu, 1 Nov 2012 14:04:17 +0100 |
Signed-off-by: Gerd Hoffmann <address@hidden>
---
console.c | 9 ---------
console.h | 23 +++++++++++++----------
2 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/console.c b/console.c
index d28b75e..048b48e 100644
--- a/console.c
+++ b/console.c
@@ -1297,14 +1297,10 @@ static QemuConsole *new_console(DisplayState *ds,
console_type_t console_type)
static void qemu_alloc_display(DisplaySurface *surface, int width, int height,
int linesize, PixelFormat pf, int newflags)
{
- surface->width = width;
- surface->height = height;
- surface->linesize = linesize;
surface->pf = pf;
qemu_pixman_image_unref(surface->image);
surface->image = NULL;
- surface->data = NULL;
surface->format = qemu_pixman_get_format(&pf);
assert(surface->format != 0);
@@ -1313,7 +1309,6 @@ static void qemu_alloc_display(DisplaySurface *surface,
int width, int height,
NULL, linesize);
assert(surface->image != NULL);
- surface->data = (uint8_t *)pixman_image_get_data(surface->image);
surface->flags = newflags | QEMU_ALLOCATED_FLAG;
#ifdef HOST_WORDS_BIGENDIAN
surface->flags |= QEMU_BIG_ENDIAN_FLAG;
@@ -1347,9 +1342,6 @@ DisplaySurface *qemu_create_displaysurface_from(int
width, int height, int bpp,
{
DisplaySurface *surface = g_new0(DisplaySurface, 1);
- surface->width = width;
- surface->height = height;
- surface->linesize = linesize;
surface->pf = qemu_default_pixelformat(bpp);
surface->format = qemu_pixman_get_format(&surface->pf);
@@ -1362,7 +1354,6 @@ DisplaySurface *qemu_create_displaysurface_from(int
width, int height, int bpp,
#ifdef HOST_WORDS_BIGENDIAN
surface->flags = QEMU_BIG_ENDIAN_FLAG;
#endif
- surface->data = data;
return surface;
}
diff --git a/console.h b/console.h
index 21bd957..33ad69b 100644
--- a/console.h
+++ b/console.h
@@ -123,10 +123,6 @@ struct DisplaySurface {
pixman_format_code_t format;
pixman_image_t *image;
uint8_t flags;
- int width;
- int height;
- int linesize; /* bytes per line */
- uint8_t *data;
struct PixelFormat pf;
};
@@ -346,32 +342,39 @@ static inline bool dpy_cursor_define_supported(struct
DisplayState *s)
static inline int ds_get_linesize(DisplayState *ds)
{
- return ds->surface->linesize;
+ return pixman_image_get_stride(ds->surface->image);
}
static inline uint8_t* ds_get_data(DisplayState *ds)
{
- return ds->surface->data;
+ return (void *)pixman_image_get_data(ds->surface->image);
}
static inline int ds_get_width(DisplayState *ds)
{
- return ds->surface->width;
+ return pixman_image_get_width(ds->surface->image);
}
static inline int ds_get_height(DisplayState *ds)
{
- return ds->surface->height;
+ return pixman_image_get_height(ds->surface->image);
}
static inline int ds_get_bits_per_pixel(DisplayState *ds)
{
- return ds->surface->pf.bits_per_pixel;
+ int bits = PIXMAN_FORMAT_BPP(ds->surface->format);
+ return bits;
}
static inline int ds_get_bytes_per_pixel(DisplayState *ds)
{
- return ds->surface->pf.bytes_per_pixel;
+ int bits = PIXMAN_FORMAT_BPP(ds->surface->format);
+ return (bits + 7) / 8;
+}
+
+static inline pixman_format_code_t ds_get_format(DisplayState *ds)
+{
+ return ds->surface->format;
}
#ifdef CONFIG_CURSES
--
1.7.1
- [Qemu-devel] [PATCH 20/22] pixman/vnc: remove rgb_prepare_row* functions, (continued)
- [Qemu-devel] [PATCH 20/22] pixman/vnc: remove rgb_prepare_row* functions, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 03/22] console: move set_mouse + cursor_define callbacks, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 04/22] console: s/TextConsole/QemuConsole/, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 12/22] pixman: helper functions, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 15/22] console: don't set PixelFormat alpha fields for 32bpp, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 11/22] pixman: windup in configure & makefiles, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 13/22] pixman: add pixman image to DisplaySurface, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 17/22] vga: stop direct access to DisplaySurface fields., Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 06/22] console: init displaychangelisteners on register, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 16/22] qxl: stop direct access to DisplaySurface fields., Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 22/22] pixman: drop obsolete fields from DisplaySurface,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 21/22] pixman/vnc: remove dead code., Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 05/22] console: untangle gfx & txt updates, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 02/22] console: add unregister_displaychangelistener, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 09/22] console: remove DisplayAllocator, Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 19/22] pixman/vnc: use pixman images in vnc., Gerd Hoffmann, 2012/11/01
- [Qemu-devel] [PATCH 14/22] console: make qemu_alloc_display static, Gerd Hoffmann, 2012/11/01
- Re: [Qemu-devel] [PULL 00/22] console cleanups & pixman rendering, Anthony Liguori, 2012/11/01