aboutsummaryrefslogtreecommitdiff
path: root/console.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-10-10 11:15:52 +0200
committerGerd Hoffmann <kraxel@redhat.com>2012-11-01 14:00:05 +0100
commit64f735920ad319aee860e56bb9bad6cfccf4ad40 (patch)
tree776cafe8afb37a6791d4f74f4e2aca291b5d292e /console.h
parent94362682d31eb7c9bfd6bf74cd615d0616a09361 (diff)
pixman: drop obsolete fields from DisplaySurface
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'console.h')
-rw-r--r--console.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/console.h b/console.h
index 21bd957d95..33ad69b48c 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