Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/dummygc.c

    rf7a90df r7470d97  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4141#include "../private/dummygc.h"
    4242
     43static errno_t dummygc_set_clip_rect(void *, gfx_rect_t *);
    4344static errno_t dummygc_set_color(void *, gfx_color_t *);
    4445static errno_t dummygc_fill_rect(void *, gfx_rect_t *);
     46static errno_t dummygc_update(void *);
    4547static errno_t dummygc_bitmap_create(void *, gfx_bitmap_params_t *,
    4648    gfx_bitmap_alloc_t *, void **);
     
    5153/** Dummy GC operations */
    5254gfx_context_ops_t dummygc_ops = {
     55        .set_clip_rect = dummygc_set_clip_rect,
    5356        .set_color = dummygc_set_color,
    5457        .fill_rect = dummygc_fill_rect,
     58        .update = dummygc_update,
    5559        .bitmap_create = dummygc_bitmap_create,
    5660        .bitmap_destroy = dummygc_bitmap_destroy,
     
    105109}
    106110
     111/** Set clipping rectangle on dummy GC
     112 *
     113 * @param arg Argument (dummy_gc_t)
     114 * @param rect Rectangle
     115 * @return EOK on success or an error code
     116 */
     117static errno_t dummygc_set_clip_rect(void *arg, gfx_rect_t *rect)
     118{
     119        (void) arg;
     120        (void) rect;
     121        return EOK;
     122}
     123
    107124/** Set color on dummy GC
    108125 *
     
    128145        (void) arg;
    129146        (void) rect;
     147        return EOK;
     148}
     149
     150/** Update dummy GC
     151 *
     152 * @param arg Argument (dummy_gc_t)
     153 * @return EOK on success or an error code
     154 */
     155static errno_t dummygc_update(void *arg)
     156{
     157        (void) arg;
    130158        return EOK;
    131159}
     
    199227{
    200228        dummygc_bitmap_t *tbm = (dummygc_bitmap_t *)bm;
     229
    201230        tbm->dgc->bm_rendered = true;
    202         tbm->dgc->bm_srect = *srect;
    203         tbm->dgc->bm_offs = *offs;
     231
     232        tbm->dgc->bm_srect.p0.x = 0;
     233        tbm->dgc->bm_srect.p0.y = 0;
     234        tbm->dgc->bm_srect.p1.x = 0;
     235        tbm->dgc->bm_srect.p1.y = 0;
     236
     237        tbm->dgc->bm_offs.x = 0;
     238        tbm->dgc->bm_offs.y = 0;
     239
     240        if (srect != NULL)
     241                tbm->dgc->bm_srect = *srect;
     242
     243        if (offs != NULL)
     244                tbm->dgc->bm_offs = *offs;
     245
    204246        return EOK;
    205247}
Note: See TracChangeset for help on using the changeset viewer.