Ignore:
Timestamp:
Jul 26, 2009, 9:17:35 PM (10 years ago)
Author:
Sam Hocevar
Message:

Allow to temporarily disable dirty rectangle handling. This allows for huge
speedups when the calling application knows the dirty rectangle covered by
a complex operation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/string.c

    r3581 r3583  
    181181     * in the canvas, ie. if CACA_MAGIC_FULLWIDTH lies at illegal places,
    182182     * but it's the caller's responsibility not to corrupt the contents. */
    183     if(curchar[0] != ch || curattr[0] != attr)
     183    if(!cv->dirty_disabled
     184        && (curchar[0] != ch || curattr[0] != attr))
    184185        caca_add_dirty_rect(cv, xmin, y, xmax - xmin + 1, 1);
    185186
     
    328329    }
    329330
    330     caca_add_dirty_rect(cv, 0, 0, cv->width, cv->height);
     331    if(!cv->dirty_disabled)
     332        caca_add_dirty_rect(cv, 0, 0, cv->width, cv->height);
    331333
    332334    return 0;
     
    454456                    dst->chars[dstix + i] = src->chars[srcix + i];
    455457                    dst->attrs[dstix + i] = src->attrs[srcix + i];
    456                     caca_add_dirty_rect(dst, x + starti + i, y + j, 1, 1);
     458                    if(!dst->dirty_disabled)
     459                        caca_add_dirty_rect(dst, x + starti + i, y + j, 1, 1);
    457460                }
    458461            }
     
    466469                memcpy(dst->chars + dstix, src->chars + srcix, stride * 4);
    467470                memcpy(dst->attrs + dstix, src->attrs + srcix, stride * 4);
    468                 caca_add_dirty_rect(dst, x + starti, y + j, stride, 1);
     471                if(!dst->dirty_disabled)
     472                    caca_add_dirty_rect(dst, x + starti, y + j, stride, 1);
    469473            }
    470474        }
     
    543547
    544548    /* FIXME: this may be optimised somewhat */
    545     caca_add_dirty_rect(cv, 0, 0, cv->width, cv->height);
     549    if(!cv->dirty_disabled)
     550        caca_add_dirty_rect(cv, 0, 0, cv->width, cv->height);
    546551
    547552    return 0;
Note: See TracChangeset for help on using the changeset viewer.