Changes in uspace/lib/ui/src/dummygc.c [f7a90df:1fa6292] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/dummygc.c
rf7a90df r1fa6292 1 1 /* 2 * Copyright (c) 202 0Jiri Svoboda2 * Copyright (c) 2021 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 41 41 #include "../private/dummygc.h" 42 42 43 static errno_t dummygc_set_clip_rect(void *, gfx_rect_t *); 43 44 static errno_t dummygc_set_color(void *, gfx_color_t *); 44 45 static errno_t dummygc_fill_rect(void *, gfx_rect_t *); 46 static errno_t dummygc_update(void *); 45 47 static errno_t dummygc_bitmap_create(void *, gfx_bitmap_params_t *, 46 48 gfx_bitmap_alloc_t *, void **); … … 51 53 /** Dummy GC operations */ 52 54 gfx_context_ops_t dummygc_ops = { 55 .set_clip_rect = dummygc_set_clip_rect, 53 56 .set_color = dummygc_set_color, 54 57 .fill_rect = dummygc_fill_rect, 58 .update = dummygc_update, 55 59 .bitmap_create = dummygc_bitmap_create, 56 60 .bitmap_destroy = dummygc_bitmap_destroy, … … 105 109 } 106 110 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 */ 117 static errno_t dummygc_set_clip_rect(void *arg, gfx_rect_t *rect) 118 { 119 (void) arg; 120 (void) rect; 121 return EOK; 122 } 123 107 124 /** Set color on dummy GC 108 125 * … … 128 145 (void) arg; 129 146 (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 */ 155 static errno_t dummygc_update(void *arg) 156 { 157 (void) arg; 130 158 return EOK; 131 159 } … … 153 181 sizeof(uint32_t); 154 182 tbm->alloc.off0 = 0; 155 tbm->alloc.pixels = calloc( sizeof(uint32_t),183 tbm->alloc.pixels = calloc( 156 184 (params->rect.p1.x - params->rect.p0.x) * 157 (params->rect.p1.y - params->rect.p0.y)); 185 (params->rect.p1.y - params->rect.p0.y), 186 sizeof(uint32_t)); 158 187 tbm->myalloc = true; 159 188 if (tbm->alloc.pixels == NULL) { … … 199 228 { 200 229 dummygc_bitmap_t *tbm = (dummygc_bitmap_t *)bm; 230 201 231 tbm->dgc->bm_rendered = true; 202 tbm->dgc->bm_srect = *srect; 203 tbm->dgc->bm_offs = *offs; 232 233 tbm->dgc->bm_srect.p0.x = 0; 234 tbm->dgc->bm_srect.p0.y = 0; 235 tbm->dgc->bm_srect.p1.x = 0; 236 tbm->dgc->bm_srect.p1.y = 0; 237 238 tbm->dgc->bm_offs.x = 0; 239 tbm->dgc->bm_offs.y = 0; 240 241 if (srect != NULL) 242 tbm->dgc->bm_srect = *srect; 243 244 if (offs != NULL) 245 tbm->dgc->bm_offs = *offs; 246 204 247 return EOK; 205 248 }
Note:
See TracChangeset
for help on using the changeset viewer.