Changeset 11663

Show
Ignore:
Timestamp:
07/18/08 17:36:48 (6 weeks ago)
Author:
cristy
Message:
 
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ImageMagick/trunk/magick/annotate.c

    r11461 r11663  
    12411241    y; 
    12421242 
    1243   MagickBooleanType 
    1244     active; 
    1245  
    1246   MagickRealType 
    1247     fill_opacity; 
    1248  
    1249   PixelPacket 
    1250     fill_color; 
    1251  
    12521243  PointInfo 
    12531244    point, 
     
    12551246 
    12561247  register long 
    1257     i, 
    1258     x; 
    1259  
    1260   register PixelPacket 
    1261     *q; 
     1248    i; 
    12621249 
    12631250  size_t 
     
    15351522    if (draw_info->render != MagickFalse) 
    15361523      { 
    1537         long 
    1538           x_offset, 
    1539           y_offset; 
    1540  
    1541         register unsigned char 
    1542           *p; 
     1524        MagickBooleanType 
     1525          status; 
    15431526 
    15441527        ViewInfo 
    1545           *image_view; 
     1528          **image_view; 
    15461529 
    15471530        /* 
    15481531          Rasterize the glyph. 
    15491532        */ 
    1550         p=bitmap->bitmap.buffer; 
    1551         image_view=AcquireCacheView(image); 
     1533        status=MagickTrue; 
     1534        image_view=AcquireCacheViewThreadSet(image); 
     1535        #pragma omp parallel for 
    15521536        for (y=0; y < (long) bitmap->bitmap.rows; y++) 
    15531537        { 
     1538          long 
     1539            x_offset, 
     1540            y_offset; 
     1541 
     1542          MagickBooleanType 
     1543            active; 
     1544 
     1545          MagickRealType 
     1546            fill_opacity; 
     1547 
     1548          PixelPacket 
     1549            fill_color; 
     1550 
     1551          register long 
     1552            id, 
     1553            x; 
     1554 
     1555          register PixelPacket 
     1556            *q; 
     1557 
     1558          register unsigned char 
     1559            *p; 
     1560 
     1561          id=GetCacheViewThreadId(); 
    15541562          x_offset=(long) (point.x+0.5); 
    15551563          y_offset=(long) (point.y+y+0.5); 
    15561564          if ((y_offset < 0) || (y_offset >= (long) image->rows)) 
    1557             { 
    1558               p+=bitmap->bitmap.width; 
    1559               continue; 
    1560             } 
    1561           q=GetCacheViewPixels(image_view,x_offset,y_offset, 
     1565            continue; 
     1566          q=GetCacheViewPixels(image_view[id],x_offset,y_offset, 
    15621567            bitmap->bitmap.width,1); 
    15631568          active=q != (PixelPacket *) NULL ? MagickTrue : MagickFalse; 
     1569          p=bitmap->bitmap.buffer+y*bitmap->bitmap.width; 
    15641570          for (x=0; x < (long) bitmap->bitmap.width; x++) 
    15651571          { 
    1566             x_offset=(long) (point.x+x+0.5); 
     1572            x_offset++; 
    15671573            if ((*p == 0) || (x_offset < 0) || 
    15681574                (x_offset >= (long) image->columns)) 
     
    15761582              fill_opacity=fill_opacity > 0.5 ? 1.0 : 0.0; 
    15771583            if (active == MagickFalse) 
    1578               q=GetCacheViewPixels(image_view,x_offset,y_offset,1,1); 
     1584              q=GetCacheViewPixels(image_view[id],x_offset,y_offset,1,1); 
    15791585            if (q == (PixelPacket *) NULL) 
    15801586              { 
     
    15871593              fill_color.opacity); 
    15881594            MagickCompositeOver(&fill_color,fill_opacity,q,q->opacity,q); 
    1589             if (active == MagickFalse) 
    1590               (void) SyncCacheView(image_view); 
     1595            if ((active == MagickFalse) && 
     1596                (SyncCacheView(image_view[id]) == MagickFalse)) 
     1597              status=MagickFalse; 
    15911598            p++; 
    15921599            q++; 
    15931600          } 
    1594           if (SyncCacheView(image_view) == MagickFalse) 
    1595             break; 
     1601          if (SyncCacheView(image_view[id]) == MagickFalse) 
     1602            status=MagickFalse; 
    15961603        } 
    1597         image_view=DestroyCacheView(image_view); 
     1604        image_view=DestroyCacheViewThreadSet(image_view); 
    15981605      } 
    15991606    if ((bitmap->left+bitmap->bitmap.width) > metrics->width)