Changeset 3467 for libcaca/trunk


Ignore:
Timestamp:
May 16, 2009, 10:14:04 PM (11 years ago)
Author:
Pascal Terjan
Message:
  • Only redraw dirty rectangle in x11 driver
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver/x11.c

    r2962 r3467  
    295295    int height = caca_get_canvas_height(dp->cv);
    296296    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;
    297302
    298303    /* First draw the background colours. Splitting the process in two
    299304     * 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)
    303308        {
    304309            uint32_t const *attrs = cvattrs + x + y * width;
     
    321326
    322327    /* Then print the foreground characters */
    323     for(y = 0; y < height; y++)
     328    for(y = ymin; y <= ymax; y++)
    324329    {
    325330        int yoff = (y + 1) * dp->drv.p->font_height
     
    328333        uint32_t const *attrs = cvattrs + y * width;
    329334
    330         for(x = 0; x < width; x++, chars++, attrs++)
     335        for(x = xmin; x <= xmax; x++, chars++, attrs++)
    331336        {
    332337            XSetForeground(dp->drv.p->dpy, dp->drv.p->gc,
Note: See TracChangeset for help on using the changeset viewer.