Ignore:
Timestamp:
Jul 26, 2009, 9:17:35 PM (11 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.

Location:
libcaca/trunk/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/tests/.gitignore

    r2824 r3583  
     1bench
     2caca-test
    13simple
    2 caca-test
  • libcaca/trunk/tests/bench.c

    r3582 r3583  
    4848}
    4949
    50 static void putchars(void)
     50static void putchars(int optim)
    5151{
    5252    caca_canvas_t *cv;
    5353    int i;
    5454    cv = caca_create_canvas(40, 40);
     55    if(optim)
     56        caca_disable_dirty_rect(cv);
    5557    for (i = 0; i < PUTCHAR_LOOPS; i++)
    5658    {
    5759        caca_put_char(cv, 1, 1, 'x');
    5860        caca_put_char(cv, 1, 1, 'o');
     61    }
     62    if(optim)
     63    {
     64        caca_enable_dirty_rect(cv);
     65        caca_add_dirty_rect(cv, 1, 1, 1, 1);
    5966    }
    6067    caca_free_canvas(cv);
     
    6774    TIME("blit mask, no clear", blit(1, 0));
    6875    TIME("blit mask, clear", blit(1, 1));
    69     TIME("putchars", putchars());
     76    TIME("putchars, no optim", putchars(0));
     77    TIME("putchars, optim", putchars(1));
    7078    return 0;
    7179}
Note: See TracChangeset for help on using the changeset viewer.