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

Changeset 7470d97 in mainline for uspace/lib/ipcgfx/src/client.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/lib/ipcgfx/src/client.c

    r252d03c r7470d97  
    4545#include "../private/client.h"
    4646
     47static errno_t ipc_gc_set_clip_rect(void *, gfx_rect_t *);
    4748static errno_t ipc_gc_set_color(void *, gfx_color_t *);
    4849static errno_t ipc_gc_fill_rect(void *, gfx_rect_t *);
     
    5556
    5657gfx_context_ops_t ipc_gc_ops = {
     58        .set_clip_rect = ipc_gc_set_clip_rect,
    5759        .set_color = ipc_gc_set_color,
    5860        .fill_rect = ipc_gc_fill_rect,
     
    6365        .bitmap_get_alloc = ipc_gc_bitmap_get_alloc
    6466};
     67
     68/** Set clipping rectangle on IPC GC.
     69 *
     70 * @param arg IPC GC
     71 * @param rect Rectangle
     72 *
     73 * @return EOK on success or an error code
     74 */
     75static errno_t ipc_gc_set_clip_rect(void *arg, gfx_rect_t *rect)
     76{
     77        ipc_gc_t *ipcgc = (ipc_gc_t *) arg;
     78        async_exch_t *exch;
     79        errno_t rc;
     80
     81        exch = async_exchange_begin(ipcgc->sess);
     82        if (rect != NULL) {
     83                rc = async_req_4_0(exch, GC_SET_CLIP_RECT, rect->p0.x, rect->p0.y,
     84                    rect->p1.x, rect->p1.y);
     85        } else {
     86                rc = async_req_0_0(exch, GC_SET_CLIP_RECT_NULL);
     87        }
     88
     89        async_exchange_end(exch);
     90
     91        return rc;
     92}
    6593
    6694/** Set color on IPC GC.
Note: See TracChangeset for help on using the changeset viewer.