Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 7470d97 in mainline for uspace/srv/hid/display/clonegc.c


Ignore:
Timestamp:
2021-04-30T15:05:06Z (7 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
051349b
Parents:
252d03c
Message:

Add GC operation to set clipping rectangle

The number of changed files is due to the proliferation of GC
implementations, mostly these are just dummies in unit tests.
Definitely need to tame those in the future.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/clonegc.c

    r252d03c r7470d97  
    11/*
    2  * Copyright (c) 2020 Jiri Svoboda
     2 * Copyright (c) 2021 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    4444#include "clonegc.h"
    4545
     46static errno_t ds_clonegc_set_clip_rect(void *, gfx_rect_t *);
    4647static errno_t ds_clonegc_set_color(void *, gfx_color_t *);
    4748static errno_t ds_clonegc_fill_rect(void *, gfx_rect_t *);
     
    6566
    6667gfx_context_ops_t ds_clonegc_ops = {
     68        .set_clip_rect = ds_clonegc_set_clip_rect,
    6769        .set_color = ds_clonegc_set_color,
    6870        .fill_rect = ds_clonegc_fill_rect,
     
    7375};
    7476
     77/** Set clipping rectangle on clone GC.
     78 *
     79 * @param arg Clone GC
     80 * @param rect Rectangle
     81 *
     82 * @return EOK on success or an error code
     83 */
     84static errno_t ds_clonegc_set_clip_rect(void *arg, gfx_rect_t *rect)
     85{
     86        ds_clonegc_t *cgc = (ds_clonegc_t *)arg;
     87        ds_clonegc_output_t *output;
     88        errno_t rc;
     89
     90        output = ds_clonegc_first_output(cgc);
     91        while (output != NULL) {
     92                rc = gfx_set_clip_rect(output->gc, rect);
     93                if (rc != EOK)
     94                        return rc;
     95
     96                output = ds_clonegc_next_output(output);
     97        }
     98
     99        return EOK;
     100}
     101
    75102/** Set color on clone GC.
    76103 *
Note: See TracChangeset for help on using the changeset viewer.