Changeset ebb1489 in mainline for uspace/app/gfxdemo/gfxdemo.c


Ignore:
Timestamp:
2024-10-13T08:23:40Z (2 months ago)
Author:
GitHub <noreply@…>
Children:
0472cf17
Parents:
2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
git-committer:
GitHub <noreply@…> (2024-10-13 08:23:40)
Message:

Merge branch 'HelenOS:master' into topic/packet-capture

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/gfxdemo/gfxdemo.c

    r2a0c827c rebb1489  
    7878static gfx_coord_t vpad;
    7979static console_ctrl_t *con = NULL;
     80static bool textmode;
    8081static ui_t *ui;
    8182
    8283/** Determine if we are running in text mode.
    8384 *
    84  * @param w Screen width
    85  * @param h Screen height
    8685 * @return @c true iff we are running in text mode
    8786 */
    88 static bool demo_is_text(gfx_coord_t w, gfx_coord_t h)
    89 {
    90         // XXX Need a proper way to determine text mode
    91         return w <= 80;
     87static bool demo_is_text(void)
     88{
     89        return textmode;
    9290}
    9391
     
    181179
    182180        /* XXX Crude way of detecting text mode */
    183         if (w < 256) {
     181        if (demo_is_text()) {
    184182                /* Create dummy font for text mode */
    185183                rc = gfx_typeface_create(gc, &tface);
     
    270268
    271269        if (font != NULL) {
    272                 if (demo_is_text(w, h)) {
     270                if (demo_is_text()) {
    273271                        rc = gfx_color_new_ega(0x1e, &color);
    274272                        if (rc != EOK)
     
    719717        gfx_color_delete(color);
    720718
    721         if (demo_is_text(w, h)) {
     719        if (demo_is_text()) {
    722720                rc = gfx_color_new_ega(0x1f, &color);
    723721                if (rc != EOK)
     
    807805
    808806        for (i = 0; i < 8; i++) {
    809                 if (demo_is_text(w, h)) {
     807                if (demo_is_text()) {
    810808                        rc = gfx_color_new_ega(i != 0 ? i : 0x10, &color);
    811809                        if (rc != EOK)
     
    884882                gfx_color_delete(color);
    885883
    886                 if (demo_is_text(w, h)) {
     884                if (demo_is_text()) {
    887885                        rc = gfx_color_new_ega(0x1f, &color);
    888886                        if (rc != EOK)
     
    10931091
    10941092        gc = console_gc_get_ctx(cgc);
     1093
     1094        /* Currently console is always text. */
     1095        textmode = true;
    10951096
    10961097        rc = demo_loop(gc, cols, rows);
     
    11921193                task_retval(0);
    11931194
     1195        textmode = ui_is_textmode(ui);
     1196
    11941197        args.gc = gc;
    11951198        args.dims = dims;
     
    12521255
    12531256        task_retval(0);
     1257
     1258        /* FIXME Assuming display service is not text mode. */
     1259        textmode = false;
    12541260
    12551261        rc = demo_loop(gc, 400, 300);
Note: See TracChangeset for help on using the changeset viewer.