[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49940] branches/soc-2011-tomato: svn merge ^/trunk/blender -r49933:49939

Campbell Barton ideasman42 at gmail.com
Thu Aug 16 16:48:43 CEST 2012


Revision: 49940
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49940
Author:   campbellbarton
Date:     2012-08-16 14:48:43 +0000 (Thu, 16 Aug 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r49933:49939

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49933

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_ExecutionGroup.cpp
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp
    branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_AntiAliasOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_ConvolutionFilterOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianXBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_GaussianYBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_MovieDistortionOperation.h
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
    branches/soc-2011-tomato/source/blender/editors/include/ED_image.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_node.h
    branches/soc-2011-tomato/source/blender/editors/interface/interface_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_image/image_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_view.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49933
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49939

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_ExecutionGroup.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2012-08-16 14:47:14 UTC (rev 49939)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_ExecutionGroup.cpp	2012-08-16 14:48:43 UTC (rev 49940)
@@ -38,6 +38,7 @@
 #include "COM_ChunkOrder.h"
 #include "COM_ExecutionSystemHelper.h"
 
+#include "MEM_guardedalloc.h"
 #include "BLI_math.h"
 #include "PIL_time.h"
 #include "WM_api.h"
@@ -148,14 +149,14 @@
 void ExecutionGroup::initExecution()
 {
 	if (this->m_chunkExecutionStates != NULL) {
-		delete[] this->m_chunkExecutionStates;
+		MEM_freeN(this->m_chunkExecutionStates);
 	}
 	unsigned int index;
 	determineNumberOfChunks();
 
 	this->m_chunkExecutionStates = NULL;
 	if (this->m_numberOfChunks != 0) {
-		this->m_chunkExecutionStates = new ChunkExecutionState[this->m_numberOfChunks];
+		this->m_chunkExecutionStates = (ChunkExecutionState *)MEM_mallocN(sizeof(ChunkExecutionState) * this->m_numberOfChunks, __func__);
 		for (index = 0; index < this->m_numberOfChunks; index++) {
 			this->m_chunkExecutionStates[index] = COM_ES_NOT_SCHEDULED;
 		}
@@ -180,7 +181,7 @@
 void ExecutionGroup::deinitExecution()
 {
 	if (this->m_chunkExecutionStates != NULL) {
-		delete[] this->m_chunkExecutionStates;
+		MEM_freeN(this->m_chunkExecutionStates);
 		this->m_chunkExecutionStates = NULL;
 	}
 	this->m_numberOfChunks = 0;
@@ -227,7 +228,7 @@
 	this->m_chunksFinished = 0;
 	this->m_bTree = bTree;
 	unsigned int index;
-	unsigned int *chunkOrder = new unsigned int[this->m_numberOfChunks];
+	unsigned int *chunkOrder = (unsigned int *)MEM_mallocN(sizeof(unsigned int) * this->m_numberOfChunks, __func__);
 
 	for (chunkNumber = 0; chunkNumber < this->m_numberOfChunks; chunkNumber++) {
 		chunkOrder[chunkNumber] = chunkNumber;
@@ -256,10 +257,10 @@
 			break;
 		case COM_TO_CENTER_OUT:
 		{
-			ChunkOrderHotspot **hotspots = new ChunkOrderHotspot *[1];
+			ChunkOrderHotspot *hotspots[1];
 			hotspots[0] = new ChunkOrderHotspot(this->m_width * centerX, this->m_height * centerY, 0.0f);
 			rcti rect;
-			ChunkOrder *chunkOrders = new ChunkOrder[this->m_numberOfChunks];
+			ChunkOrder *chunkOrders = (ChunkOrder *)MEM_mallocN(sizeof(ChunkOrder) * this->m_numberOfChunks, __func__);
 			for (index = 0; index < this->m_numberOfChunks; index++) {
 				determineChunkRect(&rect, index);
 				chunkOrders[index].setChunkNumber(index);
@@ -274,13 +275,12 @@
 			}
 
 			delete hotspots[0];
-			delete[] hotspots;
-			delete[] chunkOrders;
+			MEM_freeN(chunkOrders);
 		}
 		break;
 		case COM_TO_RULE_OF_THIRDS:
 		{
-			ChunkOrderHotspot **hotspots = new ChunkOrderHotspot *[9];
+			ChunkOrderHotspot *hotspots[9];
 			unsigned int tx = this->m_width / 6;
 			unsigned int ty = this->m_height / 6;
 			unsigned int mx = this->m_width / 2;
@@ -299,7 +299,7 @@
 			hotspots[7] = new ChunkOrderHotspot(mx, ty, addition * 7);
 			hotspots[8] = new ChunkOrderHotspot(mx, by, addition * 8);
 			rcti rect;
-			ChunkOrder *chunkOrders = new ChunkOrder[this->m_numberOfChunks];
+			ChunkOrder *chunkOrders = (ChunkOrder *)MEM_mallocN(sizeof(ChunkOrder) * this->m_numberOfChunks, __func__);
 			for (index = 0; index < this->m_numberOfChunks; index++) {
 				determineChunkRect(&rect, index);
 				chunkOrders[index].setChunkNumber(index);
@@ -323,8 +323,7 @@
 			delete hotspots[6];
 			delete hotspots[7];
 			delete hotspots[8];
-			delete[] hotspots;
-			delete[] chunkOrders;
+			MEM_freeN(chunkOrders);
 		}
 		break;
 		case COM_TO_TOP_DOWN:
@@ -372,7 +371,7 @@
 		}
 	}
 
-	delete[] chunkOrder;
+	MEM_freeN(chunkOrder);
 }
 
 MemoryBuffer **ExecutionGroup::getInputBuffersOpenCL(int chunkNumber)
@@ -383,10 +382,7 @@
 	determineChunkRect(&rect, chunkNumber);
 
 	this->determineDependingMemoryProxies(&memoryproxies);
-	MemoryBuffer **memoryBuffers = new MemoryBuffer *[this->m_cachedMaxReadBufferOffset];
-	for (index = 0; index < this->m_cachedMaxReadBufferOffset; index++) {
-		memoryBuffers[index] = NULL;
-	}
+	MemoryBuffer **memoryBuffers = (MemoryBuffer **)MEM_callocN(sizeof(MemoryBuffer *) * this->m_cachedMaxReadBufferOffset, __func__);
 	rcti output;
 	for (index = 0; index < this->m_cachedReadOperations.size(); index++) {
 		ReadBufferOperation *readOperation = (ReadBufferOperation *)this->m_cachedReadOperations[index];
@@ -422,7 +418,7 @@
 				}
 			}
 		}
-		delete[] memoryBuffers;
+		MEM_freeN(memoryBuffers);
 	}
 	if (this->m_bTree) {
 		// status report is only performed for top level Execution Groups.

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-08-16 14:47:14 UTC (rev 49939)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.cpp	2012-08-16 14:48:43 UTC (rev 49940)
@@ -75,7 +75,7 @@
 	const unsigned int size = this->determineBufferSize();
 	unsigned int i;
 
-	float *result = new float[size];
+	float *result = (float *)MEM_mallocN(sizeof(float) * size, __func__);
 
 	const float *fp_src = this->m_buffer;
 	float       *fp_dst = result;

Modified: branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp	2012-08-16 14:47:14 UTC (rev 49939)
+++ branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp	2012-08-16 14:48:43 UTC (rev 49940)
@@ -32,6 +32,8 @@
 #include "OCL_opencl.h"
 #include "COM_WriteBufferOperation.h"
 
+#include "MEM_guardedalloc.h"
+
 #include "PIL_time.h"
 #include "BLI_threads.h"
 
@@ -99,20 +101,20 @@
 void COM_startReadHighlights()
 {
 	if (g_highlightedNodesRead) {
-		delete [] g_highlightedNodesRead;
+		MEM_freeN(g_highlightedNodesRead);
 	}
 	
 	g_highlightedNodesRead = g_highlightedNodes;
-	g_highlightedNodes = new void *[MAX_HIGHLIGHT];
+	g_highlightedNodes = (void **)MEM_callocN(sizeof(void *) * MAX_HIGHLIGHT, __func__);
 	g_highlightIndex = 0;
-	for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
-		g_highlightedNodes[i] = 0;
-	}
 }
 
 int COM_isHighlightedbNode(bNode *bnode)
 {
-	if (!g_highlightedNodesRead) return false;
+	if (!g_highlightedNodesRead) {
+		return false;
+	}
+
 	for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
 		void *p = g_highlightedNodesRead[i];
 		if (!p) return false;
@@ -255,8 +257,12 @@
 
 void WorkScheduler::initialize()
 {
-	g_highlightedNodesRead = 0;
-	g_highlightedNodes = 0;
+	if (g_highlightedNodesRead) MEM_freeN(g_highlightedNodesRead);
+	if (g_highlightedNodes)     MEM_freeN(g_highlightedNodes);
+
+	g_highlightedNodesRead = NULL;
+	g_highlightedNodes = NULL;
+
 	COM_startReadHighlights();
 #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
 	int numberOfCPUThreads = BLI_system_thread_count();
@@ -275,7 +281,7 @@
 		error = clGetPlatformIDs(0, 0, &numberOfPlatforms);
 		if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error));  }
 		if (G.f & G_DEBUG) printf("%d number of platforms\n", numberOfPlatforms);
-		cl_platform_id *platforms = new cl_platform_id[numberOfPlatforms];
+		cl_platform_id *platforms = (cl_platform_id *)MEM_mallocN(sizeof(cl_platform_id) * numberOfPlatforms, __func__);
 		error = clGetPlatformIDs(numberOfPlatforms, platforms, 0);
 		unsigned int indexPlatform;
 		for (indexPlatform = 0; indexPlatform < numberOfPlatforms; indexPlatform++) {
@@ -283,7 +289,7 @@
 			cl_uint numberOfDevices = 0;
 			clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, 0, &numberOfDevices);
 			if (numberOfDevices > 0) {
-				cl_device_id *cldevices = new cl_device_id[numberOfDevices];
+				cl_device_id *cldevices = (cl_device_id *)MEM_mallocN(sizeof(cl_device_id) * numberOfDevices, __func__);
 				clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, 0);
 
 				g_context = clCreateContext(NULL, numberOfDevices, cldevices, clContextError, NULL, &error);
@@ -297,12 +303,12 @@
 					printf("CLERROR[%d]: %s\n", error, clewErrorString(error));	
 					error2 = clGetProgramBuildInfo(g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);
 					if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
-					char *build_log =  new char[ret_val_size + 1];
+					char *build_log = (char *)MEM_mallocN(sizeof(char) * ret_val_size + 1, __func__);
 					error2 = clGetProgramBuildInfo(g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
 					if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
 					build_log[ret_val_size] = '\0';
 					printf("%s", build_log);
-					delete build_log;
+					MEM_freeN(build_log);
 				}
 				else {
 					unsigned int indexDevices;
@@ -316,10 +322,10 @@
 						g_gpudevices.push_back(clDevice);
 					}
 				}
-				delete[] cldevices;
+				MEM_freeN(cldevices);
 			}
 		}
-		delete[] platforms;
+		MEM_freeN(platforms);
 	}
 #endif
 #endif
@@ -352,5 +358,13 @@
 	}
 #endif
 #endif
+
+	if (g_highlightedNodes) {
+		MEM_freeN(g_highlightedNodes);
+	}
+
+	if (g_highlightedNodesRead) {
+		MEM_freeN(g_highlightedNodesRead);
+	}
 }
 

Modified: branches/soc-2011-tomato/source/blender/compositor/nodes/COM_BokehBlurNode.cpp
===================================================================

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list