Changeset c2250702 in mainline
 Timestamp:
 20191216T13:31:42Z (15 months ago)
 Branches:
 master
 Children:
 fb420e48
 Parents:
 65160d7
 gitauthor:
 Jiri Svoboda <jiri@…> (20191215 13:23:28)
 gitcommitter:
 Jiri Svoboda <jiri@…> (20191216 13:31:42)
 Location:
 uspace
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

uspace/drv/fb/kfb/port.c
r65160d7 rc2250702 68 68 69 69 sysarg_t paddr; 70 sysarg_t width; 71 sysarg_t height; 70 gfx_rect_t rect; 72 71 size_t offset; 73 72 size_t scanline; … … 154 153 { 155 154 kfb_t *kfb = (kfb_t *) arg; 155 gfx_rect_t crect; 156 156 gfx_coord_t x, y; 157 157 158 // XXX We should handle p0.x > p1.x and p0.y > p1.y 159 160 for (y = rect>p0.y; y < rect>p1.y; y++) { 161 for (x = rect>p0.x; x < rect>p1.x; x++) { 158 /* Make sure we have a sorted, clipped rectangle */ 159 gfx_rect_clip(rect, &kfb>rect, &crect); 160 161 for (y = crect.p0.y; y < crect.p1.y; y++) { 162 for (x = crect.p0.x; x < crect.p1.x; x++) { 162 163 kfb>pixel2visual(kfb>addr + FB_POS(kfb, x, y), 163 164 kfb>color); … … 242 243 gfx_rect_t srect; 243 244 gfx_rect_t drect; 245 gfx_rect_t skfbrect; 246 gfx_rect_t crect; 244 247 gfx_coord2_t offs; 245 248 gfx_coord2_t bmdim; … … 251 254 pixel_t color; 252 255 256 /* Clip source rectangle to bitmap bounds */ 257 253 258 if (srect0 != NULL) 254 srect = *srect0;259 gfx_rect_clip(srect0, &kfbbm>rect, &srect); 255 260 else 256 261 srect = kfbbm>rect; … … 272 277 pbm.data = kfbbm>alloc.pixels; 273 278 274 for (pos.y = srect.p0.y; pos.y < srect.p1.y; pos.y++) { 275 for (pos.x = srect.p0.x; pos.x < srect.p1.x; pos.x++) { 279 /* Transform KFB bounding rectangle back to bitmap coordinate system */ 280 gfx_rect_rtranslate(&offs, &kfb>rect, &skfbrect); 281 282 /* 283 * Make sure we have a sorted source rectangle, clipped so that 284 * destination lies within KFB bounding rectangle 285 */ 286 gfx_rect_clip(&srect, &skfbrect, &crect); 287 288 for (pos.y = crect.p0.y; pos.y < crect.p1.y; pos.y++) { 289 for (pos.x = crect.p0.x; pos.x < crect.p1.x; pos.x++) { 276 290 gfx_coord2_subtract(&pos, &kfbbm>rect.p0, &sp); 277 291 gfx_coord2_add(&pos, &offs, &dp); … … 429 443 kfb>fun = fun; 430 444 431 kfb>width = width; 432 kfb>height = height; 445 kfb>rect.p0.x = 0; 446 kfb>rect.p0.y = 0; 447 kfb>rect.p1.x = width; 448 kfb>rect.p1.y = height; 449 433 450 kfb>paddr = paddr; 434 451 kfb>offset = offset; 
uspace/lib/gfx/src/coord.c
r65160d7 rc2250702 145 145 * 146 146 * If the two rectangles do not intersect, the result will be an empty 147 * rectangle (check with gfx_rect_is_empty()). 147 * rectangle (check with gfx_rect_is_empty()). The resulting rectangle 148 * is always sorted. 148 149 * 149 150 * @param rect Source rectangle 
uspace/srv/hid/display/seat.c
r65160d7 rc2250702 59 59 60 60 ds_display_add_seat(display, seat); 61 seat>pntpos.x = 10;62 seat>pntpos.y = 10;61 seat>pntpos.x = 0; 62 seat>pntpos.y = 0; 63 63 64 64 *rseat = seat; … … 242 242 printf("PTD_MOVE\n"); 243 243 gfx_coord2_add(&seat>pntpos, &event>dmove, &npos); 244 if (npos.x < 10)245 npos.x = 10;246 if (npos.y < 10)247 npos.y = 10;248 if (npos.x > 1024  10)249 npos.x = 1024  10;250 if (npos.y > 768  10)251 npos.y = 768  10;244 if (npos.x < 0) 245 npos.x = 0; 246 if (npos.y < 0) 247 npos.y = 0; 248 if (npos.x > 1024) 249 npos.x = 1024; 250 if (npos.y > 768) 251 npos.y = 768; 252 252 253 253 printf("clear pointer\n");
Note: See TracChangeset
for help on using the changeset viewer.