Branch: Tag:

2000-06-03

2000-06-03 22:48:01 by Per Hedbor <ph@opera.com>

Oups. I used return inside THREADS_{DIS,}ALLOW.

Rev: src/modules/Image/blit.c:1.40

1: - /* $Id: blit.c,v 1.39 2000/06/03 21:00:43 per Exp $ */ + /* $Id: blit.c,v 1.40 2000/06/03 22:48:01 per Exp $ */   #include "global.h"      /*   **! module Image   **! note - **! $Id: blit.c,v 1.39 2000/06/03 21:00:43 per Exp $ + **! $Id: blit.c,v 1.40 2000/06/03 22:48:01 per Exp $   **! class Image   */   
126:   {    if(!size) return;    THREADS_ALLOW(); +  if( ( rgb.r == rgb.g && rgb.r == rgb.b ) ) +  MEMSET(dest, rgb.r, size*sizeof(rgb_group) );   #ifdef ASSEMBLY_OK -  if( size > 512 ) +  else if( size > 512 && (image_cpuid & IMAGE_MMX) )    { -  if( image_cpuid & IMAGE_MMX ) -  { -  if( ( rgb.r == rgb.g && rgb.g == rgb.b ) ) -  image_clear_buffer_mmx_x86asm_eq( dest, size/8, rgb.g ); -  else -  { -  /* clear a few bytes the slow way. */ -  /* 8 pixels */ +  int *q = (int *)dest; +  /* 8 pixels, 24 bytes */    dest[0] = rgb; dest[1] = rgb; dest[2] = rgb; dest[3] = rgb; -  dest[4] = rgb; dest[5] = rgb; dest[6] = rgb; dest[7] = rgb; -  /* clear the rest the fast way */ +  q[4] = q[0]; q[5] = q[1]; q[6] = q[2]; +  /* clear the rest the fast way.. */    image_clear_buffer_mmx_x86asm_from( dest, size/8 ); -  } +     dest += size; size = size%8; dest -= size;    while(size--) *(dest++) = rgb; -  return; +     } -  } +    #endif -  if(!rgb.r && !rgb.b && !rgb.g) -  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;
167:    }    if(size>0) MEMCPY(dest,from,size*sizeof(rgb_group));    } -  } +     THREADS_DISALLOW();   }