Changeset 7470d97 in mainline for uspace/lib/ipcgfx/src
- Timestamp:
- 2021-04-30T15:05:06Z (5 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 051349b
- Parents:
- 252d03c
- Location:
- uspace/lib/ipcgfx/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ipcgfx/src/client.c
r252d03c r7470d97 45 45 #include "../private/client.h" 46 46 47 static errno_t ipc_gc_set_clip_rect(void *, gfx_rect_t *); 47 48 static errno_t ipc_gc_set_color(void *, gfx_color_t *); 48 49 static errno_t ipc_gc_fill_rect(void *, gfx_rect_t *); … … 55 56 56 57 gfx_context_ops_t ipc_gc_ops = { 58 .set_clip_rect = ipc_gc_set_clip_rect, 57 59 .set_color = ipc_gc_set_color, 58 60 .fill_rect = ipc_gc_fill_rect, … … 63 65 .bitmap_get_alloc = ipc_gc_bitmap_get_alloc 64 66 }; 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 */ 75 static 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 } 65 93 66 94 /** Set color on IPC GC. -
uspace/lib/ipcgfx/src/server.c
r252d03c r7470d97 52 52 static ipc_gc_srv_bitmap_t *gc_bitmap_lookup(ipc_gc_srv_t *, sysarg_t); 53 53 54 static void gc_set_clip_rect_srv(ipc_gc_srv_t *srvgc, ipc_call_t *call) 55 { 56 gfx_rect_t rect; 57 errno_t rc; 58 59 rect.p0.x = ipc_get_arg1(call); 60 rect.p0.y = ipc_get_arg2(call); 61 rect.p1.x = ipc_get_arg3(call); 62 rect.p1.y = ipc_get_arg4(call); 63 64 rc = gfx_set_clip_rect(srvgc->gc, &rect); 65 async_answer_0(call, rc); 66 } 67 68 static void gc_set_clip_rect_null_srv(ipc_gc_srv_t *srvgc, ipc_call_t *call) 69 { 70 errno_t rc; 71 72 rc = gfx_set_clip_rect(srvgc->gc, NULL); 73 async_answer_0(call, rc); 74 } 75 54 76 static void gc_set_rgb_color_srv(ipc_gc_srv_t *srvgc, ipc_call_t *call) 55 77 { … … 361 383 362 384 switch (method) { 385 case GC_SET_CLIP_RECT: 386 gc_set_clip_rect_srv(&srvgc, &call); 387 break; 388 case GC_SET_CLIP_RECT_NULL: 389 gc_set_clip_rect_null_srv(&srvgc, &call); 390 break; 363 391 case GC_SET_RGB_COLOR: 364 392 gc_set_rgb_color_srv(&srvgc, &call);
Note:
See TracChangeset
for help on using the changeset viewer.
