Changeset 7470d97 in mainline for uspace/lib/memgfx/src/memgc.c
- Timestamp:
- 2021-04-30T15:05:06Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 051349b
- Parents:
- 252d03c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/memgfx/src/memgc.c
r252d03c r7470d97 48 48 #include "../private/memgc.h" 49 49 50 static errno_t mem_gc_set_clip_rect(void *, gfx_rect_t *); 50 51 static errno_t mem_gc_set_color(void *, gfx_color_t *); 51 52 static errno_t mem_gc_fill_rect(void *, gfx_rect_t *); … … 59 60 60 61 gfx_context_ops_t mem_gc_ops = { 62 .set_clip_rect = mem_gc_set_clip_rect, 61 63 .set_color = mem_gc_set_color, 62 64 .fill_rect = mem_gc_fill_rect, … … 68 70 }; 69 71 72 /** Set clipping rectangle on memory GC. 73 * 74 * @param arg Memory GC 75 * @param rect Rectangle 76 * 77 * @return EOK on success or an error code 78 */ 79 static errno_t mem_gc_set_clip_rect(void *arg, gfx_rect_t *rect) 80 { 81 mem_gc_t *mgc = (mem_gc_t *) arg; 82 83 if (rect != NULL) 84 gfx_rect_clip(rect, &mgc->rect, &mgc->clip_rect); 85 else 86 mgc->clip_rect = mgc->rect; 87 88 return EOK; 89 } 90 70 91 /** Set color on memory GC. 71 92 * … … 102 123 103 124 /* Make sure we have a sorted, clipped rectangle */ 104 gfx_rect_clip(rect, &mgc-> rect, &crect);125 gfx_rect_clip(rect, &mgc->clip_rect, &crect); 105 126 106 127 assert(mgc->rect.p0.x == 0); … … 167 188 mgc->gc = gc; 168 189 mgc->rect = *rect; 190 mgc->clip_rect = *rect; 169 191 mgc->alloc = *alloc; 170 192 … … 208 230 { 209 231 mgc->rect = *rect; 232 mgc->clip_rect = *rect; 210 233 mgc->alloc = *alloc; 211 234 } … … 370 393 gfx_rect_translate(&offs, &srect, &drect); 371 394 395 /* XXX Clip destination rectangle?! */ 396 372 397 assert(mbm->alloc.pitch == (mbm->rect.p1.x - mbm->rect.p0.x) * 373 398 (int)sizeof(uint32_t));
Note:
See TracChangeset
for help on using the changeset viewer.