Revision 0e1f5a0c console.c

b/console.c
190 190
{
191 191
    unsigned int r, g, b, color;
192 192

  
193
    switch(ds->depth) {
193
    switch(ds_get_bits_per_pixel(ds)) {
194 194
#if 0
195 195
    case 8:
196 196
        r = (rgba >> 16) & 0xff;
......
227 227
    uint8_t *d, *d1;
228 228
    int x, y, bpp;
229 229

  
230
    bpp = (ds->depth + 7) >> 3;
231
    d1 = ds->data +
232
        ds->linesize * posy + bpp * posx;
230
    bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
231
    d1 = ds_get_data(ds) +
232
        ds_get_linesize(ds) * posy + bpp * posx;
233 233
    for (y = 0; y < height; y++) {
234 234
        d = d1;
235 235
        switch(bpp) {
......
252 252
            }
253 253
            break;
254 254
        }
255
        d1 += ds->linesize;
255
        d1 += ds_get_linesize(ds);
256 256
    }
257 257
}
258 258

  
......
263 263
    uint8_t *d;
264 264
    int wb, y, bpp;
265 265

  
266
    bpp = (ds->depth + 7) >> 3;
266
    bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
267 267
    wb = w * bpp;
268 268
    if (yd <= ys) {
269
        s = ds->data +
270
            ds->linesize * ys + bpp * xs;
271
        d = ds->data +
272
            ds->linesize * yd + bpp * xd;
269
        s = ds_get_data(ds) +
270
            ds_get_linesize(ds) * ys + bpp * xs;
271
        d = ds_get_data(ds) +
272
            ds_get_linesize(ds) * yd + bpp * xd;
273 273
        for (y = 0; y < h; y++) {
274 274
            memmove(d, s, wb);
275
            d += ds->linesize;
276
            s += ds->linesize;
275
            d += ds_get_linesize(ds);
276
            s += ds_get_linesize(ds);
277 277
        }
278 278
    } else {
279
        s = ds->data +
280
            ds->linesize * (ys + h - 1) + bpp * xs;
281
        d = ds->data +
282
            ds->linesize * (yd + h - 1) + bpp * xd;
279
        s = ds_get_data(ds) +
280
            ds_get_linesize(ds) * (ys + h - 1) + bpp * xs;
281
        d = ds_get_data(ds) +
282
            ds_get_linesize(ds) * (yd + h - 1) + bpp * xd;
283 283
       for (y = 0; y < h; y++) {
284 284
            memmove(d, s, wb);
285
            d -= ds->linesize;
286
            s -= ds->linesize;
285
            d -= ds_get_linesize(ds);
286
            s -= ds_get_linesize(ds);
287 287
        }
288 288
    }
289 289
}
......
373 373

  
374 374
static inline unsigned int col_expand(DisplayState *ds, unsigned int col)
375 375
{
376
    switch(ds->depth) {
376
    switch(ds_get_bits_per_pixel(ds)) {
377 377
    case 8:
378 378
        col |= col << 8;
379 379
        col |= col << 16;
......
443 443
        bgcol = color_table[t_attrib->bold][t_attrib->bgcol];
444 444
    }
445 445

  
446
    bpp = (ds->depth + 7) >> 3;
447
    d = ds->data +
448
        ds->linesize * y * FONT_HEIGHT + bpp * x * FONT_WIDTH;
449
    linesize = ds->linesize;
446
    bpp = (ds_get_bits_per_pixel(ds) + 7) >> 3;
447
    d = ds_get_data(ds) +
448
        ds_get_linesize(ds) * y * FONT_HEIGHT + bpp * x * FONT_WIDTH;
449
    linesize = ds_get_linesize(ds);
450 450
    font_ptr = vgafont16 + FONT_HEIGHT * ch;
451 451
    xorcol = bgcol ^ fgcol;
452
    switch(ds->depth) {
452
    switch(ds_get_bits_per_pixel(ds)) {
453 453
    case 8:
454 454
        for(i = 0; i < FONT_HEIGHT; i++) {
455 455
            font_data = *font_ptr++;
......
543 543
    int y1, y2;
544 544

  
545 545
    if (s == active_console) {
546
        if (!s->ds->depth) {
546
        if (!ds_get_bits_per_pixel(s->ds)) {
547 547
            text_update_xy(s, x, y);
548 548
            return;
549 549
        }
......
570 570
    if (s == active_console) {
571 571
        int x = s->x;
572 572

  
573
        if (!s->ds->depth) {
573
        if (!ds_get_bits_per_pixel(s->ds)) {
574 574
            s->cursor_invalidate = 1;
575 575
            return;
576 576
        }
......
604 604

  
605 605
    if (s != active_console)
606 606
        return;
607
    if (!s->ds->depth) {
607
    if (!ds_get_bits_per_pixel(s->ds)) {
608 608
        s->text_x[0] = 0;
609 609
        s->text_y[0] = 0;
610 610
        s->text_x[1] = s->width - 1;
......
613 613
        return;
614 614
    }
615 615

  
616
    vga_fill_rect(s->ds, 0, 0, s->ds->width, s->ds->height,
616
    vga_fill_rect(s->ds, 0, 0, ds_get_width(s->ds), ds_get_height(s->ds),
617 617
                  color_table[0][COLOR_BLACK]);
618 618
    y1 = s->y_displayed;
619 619
    for(y = 0; y < s->height; y++) {
......
626 626
        if (++y1 == s->total_height)
627 627
            y1 = 0;
628 628
    }
629
    dpy_update(s->ds, 0, 0, s->ds->width, s->ds->height);
629
    dpy_update(s->ds, 0, 0, ds_get_width(s->ds), ds_get_height(s->ds));
630 630
    console_show_cursor(s, 1);
631 631
}
632 632

  
......
689 689
            c++;
690 690
        }
691 691
        if (s == active_console && s->y_displayed == s->y_base) {
692
            if (!s->ds->depth) {
692
            if (!ds_get_bits_per_pixel(s->ds)) {
693 693
                s->text_x[0] = 0;
694 694
                s->text_y[0] = 0;
695 695
                s->text_x[1] = s->width - 1;
......
1048 1048
    if (s) {
1049 1049
        active_console = s;
1050 1050
        if (s->console_type != TEXT_CONSOLE && s->g_width && s->g_height
1051
            && (s->g_width != s->ds->width || s->g_height != s->ds->height))
1051
            && (s->g_width != ds_get_width(s->ds) || s->g_height != ds_get_height(s->ds)))
1052 1052
            dpy_resize(s->ds, s->g_width, s->g_height);
1053 1053
        vga_hw_invalidate();
1054 1054
    }
......
1158 1158
{
1159 1159
    TextConsole *s = (TextConsole *) opaque;
1160 1160

  
1161
    if (s->g_width != s->ds->width || s->g_height != s->ds->height) {
1161
    if (s->g_width != ds_get_width(s->ds) || s->g_height != ds_get_height(s->ds)) {
1162 1162
        if (s->console_type == TEXT_CONSOLE_FIXED_SIZE)
1163 1163
            dpy_resize(s->ds, s->g_width, s->g_height);
1164 1164
        else {
1165
            s->g_width = s->ds->width;
1166
            s->g_height = s->ds->height;
1165
            s->g_width = ds_get_width(s->ds);
1166
            s->g_height = ds_get_height(s->ds);
1167 1167
            text_console_resize(s);
1168 1168
        }
1169 1169
    }
......
1302 1302
    s->total_height = DEFAULT_BACKSCROLL;
1303 1303
    s->x = 0;
1304 1304
    s->y = 0;
1305
    width = s->ds->width;
1306
    height = s->ds->height;
1305
    width = ds_get_width(s->ds);
1306
    height = ds_get_height(s->ds);
1307 1307
    if (p != 0) {
1308 1308
        width = strtoul(p, (char **)&p, 10);
1309 1309
        if (*p == 'C') {
......
1347 1347
void qemu_console_resize(QEMUConsole *console, int width, int height)
1348 1348
{
1349 1349
    if (console->g_width != width || console->g_height != height
1350
        || !console->ds->data) {
1350
        || !ds_get_data(console->ds)) {
1351 1351
        console->g_width = width;
1352 1352
        console->g_height = height;
1353 1353
        if (active_console == console) {

Also available in: Unified diff