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:
authorCampbell Barton <ideasman42@gmail.com>2012-08-16 16:32:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-16 16:32:48 +0400
commit3bc16fd60dd573f8289552a0046b0735d1c7e02b (patch)
tree3936a357fd922e96b622f29f04804b20cb11f234 /source/blender/compositor/operations/COM_AntiAliasOperation.cpp
parent883e9df1ccdaaa847c86e2d1457fd88333b87c84 (diff)
compositor: replace C++ new/delete with guardedalloc.
Diffstat (limited to 'source/blender/compositor/operations/COM_AntiAliasOperation.cpp')
-rw-r--r--source/blender/compositor/operations/COM_AntiAliasOperation.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
index 12bf651992e..c37830a9d92 100644
--- a/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
+++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
@@ -23,6 +23,10 @@
#include "COM_AntiAliasOperation.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
+#include "BKE_utildefines.h"
+
+#include "MEM_guardedalloc.h"
+
extern "C" {
#include "RE_render_ext.h"
}
@@ -58,7 +62,7 @@ void AntiAliasOperation::deinitExecution()
{
this->m_valueReader = NULL;
if (this->m_buffer) {
- delete this->m_buffer;
+ MEM_freeN(this->m_buffer);
}
NodeOperation::deinitMutex();
}
@@ -90,12 +94,10 @@ void *AntiAliasOperation::initializeTileData(rcti *rect)
MemoryBuffer *tile = (MemoryBuffer *)this->m_valueReader->initializeTileData(rect);
int size = tile->getHeight() * tile->getWidth();
float *input = tile->getBuffer();
- char *valuebuffer = new char[size];
+ char *valuebuffer = (char *)MEM_mallocN(sizeof(char) * size, __func__);
for (int i = 0; i < size; i++) {
float in = input[i * COM_NUMBER_OF_CHANNELS];
- if (in < 0.0f) { in = 0.0f; }
- if (in > 1.0f) {in = 1.0f; }
- valuebuffer[i] = in * 255;
+ valuebuffer[i] = FTOCHAR(in);
}
antialias_tagbuf(tile->getWidth(), tile->getHeight(), valuebuffer);
this->m_buffer = valuebuffer;