Parcourir la source

Show how we could optimise dirty rectangle handling in a box fill. Disabled

for now because it does not work with fullwidth characters.
tags/v0.99.beta17
Sam Hocevar sam il y a 15 ans
Parent
révision
60b44cc5be
1 fichiers modifiés avec 15 ajouts et 1 suppressions
  1. +15
    -1
      caca/box.c

+ 15
- 1
caca/box.c Voir le fichier

@@ -1,6 +1,6 @@
/*
* libcaca Colour ASCII-Art library
* Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
* Copyright (c) 2002-2009 Sam Hocevar <sam@hocevar.net>
* All Rights Reserved
*
* $Id$
@@ -139,10 +139,24 @@ int caca_fill_box(caca_canvas_t *cv, int x, int y, int w, int h,
if(x2 > xmax) x2 = xmax;
if(y2 > ymax) y2 = ymax;

#if 0
/* FIXME: this fails with fullwidth character blits. Also, the dirty
* rectangle handling may miss fullwidth cells. */
/* Optimise dirty rectangle handling, part 1 */
cv->dirty_disabled++;
#endif

for(j = y; j <= y2; j++)
for(i = x; i <= x2; i++)
caca_put_char(cv, i, j, ch);

#if 0
/* Optimise dirty rectangle handling, part 2 */
cv->dirty_disabled--;
if(!cv->dirty_disabled)
caca_add_dirty_rect(cv, x, y, x2 - x + 1, y2 - y + 1);
#endif

return 0;
}



Chargement…
Annuler
Enregistrer