Changeset 7b882c1f in mainline for uspace/lib/congfx/src/console.c
- Timestamp:
- 2019-10-21T18:23:29Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0008c0f
- Parents:
- 1822545
- git-author:
- Jiri Svoboda <jiri@…> (2019-10-21 00:37:28)
- git-committer:
- Jiri Svoboda <jiri@…> (2019-10-21 18:23:29)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/congfx/src/console.c
r1822545 r7b882c1f 40 40 #include <congfx/console.h> 41 41 #include <gfx/context.h> 42 #include <gfx/coord.h> 42 43 #include <gfx/render.h> 43 44 #include <io/pixel.h> … … 191 192 console_gc_t *cgc = (console_gc_t *) arg; 192 193 console_gc_bitmap_t *cbm = NULL; 193 gfx_coord _t w, h;194 gfx_coord2_t dim; 194 195 errno_t rc; 195 196 … … 198 199 return ENOMEM; 199 200 200 w = params->rect.p1.x - params->rect.p0.x; 201 h = params->rect.p1.y - params->rect.p0.y; 201 gfx_coord2_subtract(¶ms->rect.p1, ¶ms->rect.p0, &dim); 202 202 cbm->rect = params->rect; 203 203 204 204 if (alloc == NULL) { 205 cbm->alloc.pitch = w* sizeof(uint32_t);205 cbm->alloc.pitch = dim.x * sizeof(uint32_t); 206 206 cbm->alloc.off0 = 0; 207 cbm->alloc.pixels = calloc( w * h, sizeof(uint32_t));207 cbm->alloc.pixels = calloc(dim.x * dim.y, sizeof(uint32_t)); 208 208 if (cbm->alloc.pixels == NULL) { 209 209 rc = ENOMEM; … … 271 271 272 272 // XXX Add function to translate rectangle 273 drect.p0.x = srect.p0.x + offs.x; 274 drect.p0.y = srect.p0.y + offs.y; 275 drect.p1.x = srect.p1.x + offs.x; 276 drect.p1.y = srect.p1.y + offs.y; 273 gfx_rect_translate(&offs, &srect, &drect); 277 274 278 275 pixelmap.width = cbm->rect.p1.x - cbm->rect.p0.x; … … 313 310 } 314 311 315 316 312 /** @} 317 313 */
Note:
See TracChangeset
for help on using the changeset viewer.