aboutsummaryrefslogtreecommitdiff
path: root/hw/jazz_led.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/jazz_led.c')
-rw-r--r--hw/jazz_led.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/hw/jazz_led.c b/hw/jazz_led.c
index 8460bfcd59..c8ac26372f 100644
--- a/hw/jazz_led.c
+++ b/hw/jazz_led.c
@@ -155,8 +155,8 @@ static void draw_horizontal_line(DisplayState *ds, int posy, int posx1, int posx
uint8_t *d;
int x, bpp;
- bpp = (ds->depth + 7) >> 3;
- d = ds->data + ds->linesize * posy + bpp * posx1;
+ bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
+ d = ds_get_data(ds) + ds_get_linesize(ds) * posy + bpp * posx1;
switch(bpp) {
case 1:
for (x = posx1; x <= posx2; x++) {
@@ -184,25 +184,25 @@ static void draw_vertical_line(DisplayState *ds, int posx, int posy1, int posy2,
uint8_t *d;
int y, bpp;
- bpp = (ds->depth + 7) >> 3;
- d = ds->data + ds->linesize * posy1 + bpp * posx;
+ bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
+ d = ds_get_data(ds) + ds_get_linesize(ds) * posy1 + bpp * posx;
switch(bpp) {
case 1:
for (y = posy1; y <= posy2; y++) {
*((uint8_t *)d) = color;
- d += ds->linesize;
+ d += ds_get_linesize(ds);
}
break;
case 2:
for (y = posy1; y <= posy2; y++) {
*((uint16_t *)d) = color;
- d += ds->linesize;
+ d += ds_get_linesize(ds);
}
break;
case 4:
for (y = posy1; y <= posy2; y++) {
*((uint32_t *)d) = color;
- d += ds->linesize;
+ d += ds_get_linesize(ds);
}
break;
}
@@ -218,17 +218,17 @@ static void jazz_led_update_display(void *opaque)
if (s->state & REDRAW_BACKGROUND) {
/* clear screen */
- bpp = (ds->depth + 7) >> 3;
- d1 = ds->data;
- for (y = 0; y < ds->height; y++) {
- memset(d1, 0x00, ds->width * bpp);
- d1 += ds->linesize;
+ bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
+ d1 = ds_get_data(ds);
+ for (y = 0; y < ds_get_height(ds); y++) {
+ memset(d1, 0x00, ds_get_width(ds) * bpp);
+ d1 += ds_get_linesize(ds);
}
}
if (s->state & REDRAW_SEGMENTS) {
/* set colors according to bpp */
- switch (ds->depth) {
+ switch (ds_get_bits_per_pixel(ds)) {
case 8:
color_segment = rgb_to_pixel8(0xaa, 0xaa, 0xaa);
color_led = rgb_to_pixel8(0x00, 0xff, 0x00);
@@ -272,7 +272,7 @@ static void jazz_led_update_display(void *opaque)
}
s->state = REDRAW_NONE;
- dpy_update(ds, 0, 0, ds->width, ds->height);
+ dpy_update(ds, 0, 0, ds_get_width(ds), ds_get_height(ds));
}
static void jazz_led_invalidate_display(void *opaque)