Changeset 71cbe5c in mainline
- Timestamp:
- 2019-12-06T17:48:48Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0b63dc2
- Parents:
- 87a7cdb
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ipcgfx/src/client.c
r87a7cdb r71cbe5c 123 123 gfx_coord2_t dim; 124 124 async_exch_t *exch = NULL; 125 as_area_info_t info; 125 126 ipc_call_t answer; 127 size_t asize; 126 128 aid_t req; 127 129 errno_t rc; … … 148 150 } else { 149 151 /* 150 * XXX We could allow this if the pixels point to a shareable151 * area or we could do a copy of the data when rendering152 * Accept user allocation if it points to a an acceptable 153 * memory area. 152 154 */ 153 rc = ENOTSUP; 154 goto error; 155 rc = as_area_get_info(alloc->pixels, &info); 156 if (rc != EOK) 157 goto error; 158 159 /* Pixels should start at the beginning of the area */ 160 if (info.start_addr != (uintptr_t) alloc->pixels) { 161 rc = EINVAL; 162 goto error; 163 } 164 165 /* Size of area should be size of bitmap rounded up to page size */ 166 asize = PAGES2SIZE(SIZE2PAGES(alloc->pitch * dim.y)); 167 if (info.size != asize) { 168 rc = EINVAL; 169 goto error; 170 } 171 172 ipcbm->alloc = *alloc; 155 173 } 156 174 -
uspace/srv/hid/rfb/main.c
r87a7cdb r71cbe5c 224 224 gfx_rect_t drect; 225 225 gfx_coord2_t offs; 226 gfx_coord2_t bmdim; 226 227 gfx_coord2_t dim; 228 gfx_coord_t x, y; 229 pixelmap_t pbm; 230 pixel_t color; 227 231 228 232 if (srect0 != NULL) … … 240 244 /* Destination rectangle */ 241 245 gfx_rect_translate(&offs, &srect, &drect); 242 243 246 gfx_coord2_subtract(&drect.p1, &drect.p0, &dim); 247 gfx_coord2_subtract(&rfbbm->rect.p1, &rfbbm->rect.p0, &bmdim); 248 249 pbm.width = bmdim.x; 250 pbm.height = bmdim.y; 251 pbm.data = rfbbm->alloc.pixels; 252 253 for (y = srect.p0.y; y < srect.p1.y; y++) { 254 for (x = srect.p0.x; x < srect.p1.x; x++) { 255 color = pixelmap_get_pixel(&pbm, x, y); 256 pixelmap_put_pixel(&rfbbm->rfb->rfb.framebuffer, 257 x + offs.x, y + offs.y, color); 258 } 259 } 260 261 rfb_gc_invalidate_rect(rfbbm->rfb, &drect); 244 262 245 263 return EOK;
Note:
See TracChangeset
for help on using the changeset viewer.