Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2012-06-13 16:34:56 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-06-13 16:34:56 +0400
commitbe1b5f82cee09041fdee355697841ee92b31ef70 (patch)
tree7032f52aaffb862c228d92a476dc9a0e00261ef1 /source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
parent4ba456d1754c29b488b8304c8546af45078e8536 (diff)
* optimized threading
* break out with glare node * Added OpenCL kernels compatible with AMD still need some testing.
Diffstat (limited to 'source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
index 40f492b0f10..df04b889200 100644
--- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
+++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
@@ -23,6 +23,7 @@
#include "COM_DoubleEdgeMaskOperation.h"
#include "BLI_math.h"
#include "DNA_node_types.h"
+#include "MEM_guardedalloc.h"
// this part has been copied from the double edge mask
// Contributor(s): Peter Larabell.
@@ -1215,12 +1216,12 @@ void DoubleEdgeMaskOperation::doDoubleEdgeMask(float *imask, float *omask, float
gsz=rsize[2]; // by the do_*EdgeDetection() function.
fsz=gsz+isz+osz; // calculate size of pixel index buffer needed
- gbuf = new unsigned short[fsz*2]; // allocate edge/gradient pixel index buffer
+ gbuf = (unsigned short*)MEM_callocN(sizeof (unsigned short)*fsz*2, "DEM"); // allocate edge/gradient pixel index buffer
do_createEdgeLocationBuffer(t,rw,lres,res,gbuf,&innerEdgeOffset,&outerEdgeOffset,isz,gsz);
do_fillGradientBuffer(rw,res,gbuf,isz,osz,gsz,innerEdgeOffset,outerEdgeOffset);
- delete [] gbuf; // free the gradient index buffer
+ MEM_freeN(gbuf); // free the gradient index buffer
}
}
@@ -1263,7 +1264,7 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect, MemoryBuffer **mem
{
if (this->cachedInstance) return this->cachedInstance;
- BLI_mutex_lock(getMutex());
+ lockMutex();
if (this->cachedInstance == NULL) {
MemoryBuffer *innerMask = (MemoryBuffer*)inputInnerMask->initializeTileData(rect, memoryBuffers);
MemoryBuffer *outerMask = (MemoryBuffer*)inputOuterMask->initializeTileData(rect, memoryBuffers);
@@ -1275,7 +1276,7 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect, MemoryBuffer **mem
delete omask;
this->cachedInstance = data;
}
- BLI_mutex_unlock(getMutex());
+ unlockMutex();
return this->cachedInstance;
}
void DoubleEdgeMaskOperation::executePixel(float *color, int x, int y, MemoryBuffer *inputBuffers[], void *data)