Changeset 3467
- Timestamp:
- May 16, 2009, 10:14:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver/x11.c
r2962 r3467 295 295 int height = caca_get_canvas_height(dp->cv); 296 296 int x, y, len; 297 int xmin, ymin, xmax, ymax; 298 299 caca_get_dirty_rectangle(dp->cv, &xmin, &ymin, &xmax, &ymax); 300 if(xmin < 0 || ymin < 0 || xmax < 0 || ymax < 0 || xmin >= width || ymin >= height) 301 return; 297 302 298 303 /* First draw the background colours. Splitting the process in two 299 304 * loops like this is actually slightly faster. */ 300 for(y = 0; y < height; y++)301 { 302 for(x = 0; x < width; x += len)305 for(y = ymin; y <= ymax; y++) 306 { 307 for(x = xmin; x <= xmax; x += len) 303 308 { 304 309 uint32_t const *attrs = cvattrs + x + y * width; … … 321 326 322 327 /* Then print the foreground characters */ 323 for(y = 0; y < height; y++)328 for(y = ymin; y <= ymax; y++) 324 329 { 325 330 int yoff = (y + 1) * dp->drv.p->font_height … … 328 333 uint32_t const *attrs = cvattrs + y * width; 329 334 330 for(x = 0; x < width; x++, chars++, attrs++)335 for(x = xmin; x <= xmax; x++, chars++, attrs++) 331 336 { 332 337 XSetForeground(dp->drv.p->dpy, dp->drv.p->gc,
Note: See TracChangeset
for help on using the changeset viewer.