Branch: Tag:

1997-11-23

1997-11-23 21:58:55 by Per Hedbor <ph@opera.com>

foo

Rev: src/modules/Image/blit.c:1.22
Rev: src/modules/Image/image.c:1.68

1: - /* $Id: blit.c,v 1.21 1997/11/23 07:22:44 per Exp $ */ + /* $Id: blit.c,v 1.22 1997/11/23 21:58:53 per Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.21 1997/11/23 07:22:44 per Exp $ + **! $Id: blit.c,v 1.22 1997/11/23 21:58:53 per Exp $   **! class image   */   
104:      void img_clear(rgb_group *dest,rgb_group rgb,INT32 size)   { -  int ok = 0; +  if(!size) return;    THREADS_ALLOW(); -  if(sizeof(rgb.r) == 1) -  { -  if(rgb.r == rgb.b && rgb.b == rgb.g) -  (ok = 1),MEMSET(dest, rgb.r, size*sizeof(rgb_group)); -  } else { +     if(!rgb.r && !rgb.b && !rgb.g) -  (ok = 1),MEMSET(dest, 0, size*sizeof(rgb_group)); -  } -  if(!ok) +  MEMSET(dest, 0, size*sizeof(rgb_group)); +  else if((sizeof(rgb.r) == 1) && (rgb.r == rgb.b && rgb.b == rgb.g)) +  MEMSET(dest, rgb.r, size*sizeof(rgb_group)); +  else if(size)    {    int increment = 1;    rgb_group *from = dest;    *(dest++)=rgb; -  for (; size > increment; size-=increment,dest+=increment,increment*=2) +  size--; +  for (; size > increment; size-=increment,dest+=increment) +  {    MEMCPY(dest,from,increment*sizeof(rgb_group)); -  MEMCPY(dest,from,size*sizeof(rgb_group)); +  if(increment < 1024) increment *= 2;    } -  +  if(size>0) MEMCPY(dest,from,size*sizeof(rgb_group)); +  }    THREADS_DISALLOW();   }