Changes in uspace/lib/ui/src/dummygc.c [1fa6292:f7a90df] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/dummygc.c
r1fa6292 rf7a90df 1 1 /* 2 * Copyright (c) 202 1Jiri Svoboda2 * Copyright (c) 2020 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 *);44 43 static errno_t dummygc_set_color(void *, gfx_color_t *); 45 44 static errno_t dummygc_fill_rect(void *, gfx_rect_t *); 46 static errno_t dummygc_update(void *);47 45 static errno_t dummygc_bitmap_create(void *, gfx_bitmap_params_t *, 48 46 gfx_bitmap_alloc_t *, void **); … … 53 51 /** Dummy GC operations */ 54 52 gfx_context_ops_t dummygc_ops = { 55 .set_clip_rect = dummygc_set_clip_rect,56 53 .set_color = dummygc_set_color, 57 54 .fill_rect = dummygc_fill_rect, 58 .update = dummygc_update,59 55 .bitmap_create = dummygc_bitmap_create, 60 56 .bitmap_destroy = dummygc_bitmap_destroy, … … 109 105 } 110 106 111 /** Set clipping rectangle on dummy GC 107 /** Set color on dummy GC 108 * 109 * @param arg Argument (dummy_gc_t) 110 * @param color Color 111 * @return EOK on success or an error code 112 */ 113 static errno_t dummygc_set_color(void *arg, gfx_color_t *color) 114 { 115 (void) arg; 116 (void) color; 117 return EOK; 118 } 119 120 /** Fill rectangle on dummy GC 112 121 * 113 122 * @param arg Argument (dummy_gc_t) … … 115 124 * @return EOK on success or an error code 116 125 */ 117 static errno_t dummygc_ set_clip_rect(void *arg, gfx_rect_t *rect)126 static errno_t dummygc_fill_rect(void *arg, gfx_rect_t *rect) 118 127 { 119 128 (void) arg; 120 129 (void) rect; 121 return EOK;122 }123 124 /** Set color on dummy GC125 *126 * @param arg Argument (dummy_gc_t)127 * @param color Color128 * @return EOK on success or an error code129 */130 static errno_t dummygc_set_color(void *arg, gfx_color_t *color)131 {132 (void) arg;133 (void) color;134 return EOK;135 }136 137 /** Fill rectangle on dummy GC138 *139 * @param arg Argument (dummy_gc_t)140 * @param rect Rectangle141 * @return EOK on success or an error code142 */143 static errno_t dummygc_fill_rect(void *arg, gfx_rect_t *rect)144 {145 (void) arg;146 (void) rect;147 return EOK;148 }149 150 /** Update dummy GC151 *152 * @param arg Argument (dummy_gc_t)153 * @return EOK on success or an error code154 */155 static errno_t dummygc_update(void *arg)156 {157 (void) arg;158 130 return EOK; 159 131 } … … 181 153 sizeof(uint32_t); 182 154 tbm->alloc.off0 = 0; 183 tbm->alloc.pixels = calloc( 155 tbm->alloc.pixels = calloc(sizeof(uint32_t), 184 156 (params->rect.p1.x - params->rect.p0.x) * 185 (params->rect.p1.y - params->rect.p0.y), 186 sizeof(uint32_t)); 157 (params->rect.p1.y - params->rect.p0.y)); 187 158 tbm->myalloc = true; 188 159 if (tbm->alloc.pixels == NULL) { … … 228 199 { 229 200 dummygc_bitmap_t *tbm = (dummygc_bitmap_t *)bm; 230 231 201 tbm->dgc->bm_rendered = true; 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 202 tbm->dgc->bm_srect = *srect; 203 tbm->dgc->bm_offs = *offs; 247 204 return EOK; 248 205 }
Note:
See TracChangeset
for help on using the changeset viewer.