]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 13 Mar 2012 13:48:08 +0000 (13:48 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 13 Mar 2012 13:48:08 +0000 (13:48 +0000)
MagickCore/cache.c

index f571a56d01cdf16cedc4525b396afca27339a347..b431cb93fa44c3fc63427e8d5b081cdd7600c04f 100644 (file)
@@ -4867,6 +4867,9 @@ static Quantum *SetPixelCacheNexusPixels(const Image *image,
 static MagickBooleanType SetCacheAlphaChannel(Image *image,const Quantum alpha,
   ExceptionInfo *exception)
 {
+  CacheView
+    *image_view;
+
   CacheInfo
     *cache_info;
 
@@ -4885,14 +4888,12 @@ static MagickBooleanType SetCacheAlphaChannel(Image *image,const Quantum alpha,
   assert(cache_info->signature == MagickSignature);
   image->matte=MagickTrue;
   status=MagickTrue;
+  image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(static,4) shared(status)
 #endif
   for (y=0; y < (ssize_t) image->rows; y++)
   {
-    const int
-      id = GetOpenMPThreadId();
-
     register Quantum
       *restrict q;
 
@@ -4901,8 +4902,7 @@ static MagickBooleanType SetCacheAlphaChannel(Image *image,const Quantum alpha,
 
     if (status == MagickFalse)
       continue;
-    q=GetAuthenticPixelCacheNexus(image,0,y,image->columns,1,
-      cache_info->nexus_info[id],exception);
+    q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
     if (q == (Quantum *) NULL)
       {
         status=MagickFalse;
@@ -4913,9 +4913,9 @@ static MagickBooleanType SetCacheAlphaChannel(Image *image,const Quantum alpha,
       SetPixelAlpha(image,alpha,q);
       q+=GetPixelChannels(image);
     }
-    status=SyncAuthenticPixelCacheNexus(image,cache_info->nexus_info[id],
-      exception);
+    status=SyncCacheViewAuthenticPixels(image_view,exception);
   }
+  image_view=DestroyCacheView(image_view);
   return(status);
 }