[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59301] branches/soc-2013-paint: Merge trunk -r59300 into soc-2013-paint

Antony Riakiotakis kalast at gmail.com
Mon Aug 19 16:16:24 CEST 2013


Revision: 59301
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59301
Author:   psy-fi
Date:     2013-08-19 14:16:24 +0000 (Mon, 19 Aug 2013)
Log Message:
-----------
Merge trunk -r59300 into soc-2013-paint

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

Modified Paths:
--------------
    branches/soc-2013-paint/extern/recastnavigation/recast-capi.cpp
    branches/soc-2013-paint/extern/recastnavigation/recast-capi.h
    branches/soc-2013-paint/intern/cycles/blender/addon/properties.py
    branches/soc-2013-paint/intern/cycles/kernel/kernel_types.h
    branches/soc-2013-paint/intern/cycles/kernel/shaders/node_subsurface_scattering.osl
    branches/soc-2013-paint/intern/ghost/intern/GHOST_SystemWin32.cpp
    branches/soc-2013-paint/intern/guardedalloc/CMakeLists.txt
    branches/soc-2013-paint/intern/guardedalloc/SConscript
    branches/soc-2013-paint/intern/guardedalloc/intern/mallocn.c
    branches/soc-2013-paint/intern/opencolorio/ocio_impl.cc
    branches/soc-2013-paint/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2013-paint/source/blender/blenkernel/BKE_anim.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_armature.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_curve.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_key.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_lattice.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_mball.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_modifier.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_object.h
    branches/soc-2013-paint/source/blender/blenkernel/BKE_particle.h
    branches/soc-2013-paint/source/blender/blenkernel/CMakeLists.txt
    branches/soc-2013-paint/source/blender/blenkernel/SConscript
    branches/soc-2013-paint/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/anim.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/armature.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/cdderivedmesh.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/constraint.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/curve.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/depsgraph.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/displist.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/effect.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/font.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/key.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/lattice.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/material.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/mball.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/mesh.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/modifier.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/navmesh_conversion.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/object.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/object_deform.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/particle.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/particle_system.c
    branches/soc-2013-paint/source/blender/blenkernel/intern/pbvh_bmesh.c
    branches/soc-2013-paint/source/blender/blenlib/BLI_threads.h
    branches/soc-2013-paint/source/blender/blenlib/CMakeLists.txt
    branches/soc-2013-paint/source/blender/blenlib/PIL_time.h
    branches/soc-2013-paint/source/blender/blenlib/intern/BLI_mempool.c
    branches/soc-2013-paint/source/blender/blenlib/intern/storage.c
    branches/soc-2013-paint/source/blender/blenlib/intern/threads.c
    branches/soc-2013-paint/source/blender/blenloader/intern/readfile.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_log.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_log.h
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_queries.c
    branches/soc-2013-paint/source/blender/bmesh/intern/bmesh_queries.h
    branches/soc-2013-paint/source/blender/bmesh/tools/bmesh_edgenet.c
    branches/soc-2013-paint/source/blender/bmesh/tools/bmesh_edgesplit.c
    branches/soc-2013-paint/source/blender/compositor/intern/COM_MemoryBuffer.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackMaskOperation.cpp
    branches/soc-2013-paint/source/blender/compositor/operations/COM_PlaneTrackWarpImageOperation.cpp
    branches/soc-2013-paint/source/blender/editors/armature/armature_skinning.c
    branches/soc-2013-paint/source/blender/editors/interface/interface_templates.c
    branches/soc-2013-paint/source/blender/editors/mask/mask_relationships.c
    branches/soc-2013-paint/source/blender/editors/mesh/editmesh_rip.c
    branches/soc-2013-paint/source/blender/editors/mesh/meshtools.c
    branches/soc-2013-paint/source/blender/editors/object/object_add.c
    branches/soc-2013-paint/source/blender/editors/object/object_modifier.c
    branches/soc-2013-paint/source/blender/editors/sculpt_paint/sculpt.c
    branches/soc-2013-paint/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2013-paint/source/blender/editors/space_info/info_stats.c
    branches/soc-2013-paint/source/blender/editors/space_outliner/outliner_tree.c
    branches/soc-2013-paint/source/blender/editors/space_view3d/drawarmature.c
    branches/soc-2013-paint/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2013-paint/source/blender/editors/space_view3d/view3d_draw.c
    branches/soc-2013-paint/source/blender/editors/space_view3d/view3d_iterators.c
    branches/soc-2013-paint/source/blender/editors/space_view3d/view3d_view.c
    branches/soc-2013-paint/source/blender/editors/transform/transform_snap.c
    branches/soc-2013-paint/source/blender/editors/util/crazyspace.c
    branches/soc-2013-paint/source/blender/freestyle/intern/stroke/StrokeShader.h
    branches/soc-2013-paint/source/blender/gpu/intern/gpu_buffers.c
    branches/soc-2013-paint/source/blender/makesdna/DNA_curve_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_key_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_lattice_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_meta_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_object_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_particle_types.h
    branches/soc-2013-paint/source/blender/makesdna/DNA_space_types.h
    branches/soc-2013-paint/source/blender/makesdna/intern/CMakeLists.txt
    branches/soc-2013-paint/source/blender/makesdna/intern/SConscript
    branches/soc-2013-paint/source/blender/makesrna/SConscript
    branches/soc-2013-paint/source/blender/makesrna/intern/CMakeLists.txt
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_main_api.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_mesh.c
    branches/soc-2013-paint/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2013-paint/source/blender/modifiers/intern/MOD_array.c
    branches/soc-2013-paint/source/blender/modifiers/intern/MOD_explode.c
    branches/soc-2013-paint/source/blender/modifiers/intern/MOD_particleinstance.c
    branches/soc-2013-paint/source/blender/render/intern/source/convertblender.c
    branches/soc-2013-paint/source/blender/render/intern/source/pointdensity.c
    branches/soc-2013-paint/source/blender/windowmanager/intern/wm_init_exit.c
    branches/soc-2013-paint/source/creator/creator.c
    branches/soc-2013-paint/source/gameengine/Converter/BL_ShapeDeformer.cpp
    branches/soc-2013-paint/source/gameengine/GameLogic/SCA_IScene.cpp
    branches/soc-2013-paint/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    branches/soc-2013-paint/source/gameengine/Ketsji/KX_Scene.cpp
    branches/soc-2013-paint/source/gameengine/Rasterizer/RAS_MeshObject.cpp
    branches/soc-2013-paint/source/gameengine/Rasterizer/RAS_MeshObject.h

Added Paths:
-----------
    branches/soc-2013-paint/intern/atomic/
    branches/soc-2013-paint/intern/atomic/atomic_ops.h
    branches/soc-2013-paint/source/blender/blenlib/BLI_sort.h
    branches/soc-2013-paint/source/blender/blenlib/intern/sort.c

Modified: branches/soc-2013-paint/extern/recastnavigation/recast-capi.cpp
===================================================================
--- branches/soc-2013-paint/extern/recastnavigation/recast-capi.cpp	2013-08-19 14:08:59 UTC (rev 59300)
+++ branches/soc-2013-paint/extern/recastnavigation/recast-capi.cpp	2013-08-19 14:16:24 UTC (rev 59301)
@@ -270,129 +270,3 @@
 	return dmesh->meshes;
 }
 
-//  qsort based on FreeBSD source (libkern\qsort.c)
-typedef int	cmp_t(void *, const void *, const void *);
-static inline char	*med3(char *, char *, char *, cmp_t *, void *);
-static inline void	 swapfunc(char *, char *, int, int);
-
-#define min(a, b)	(a) < (b) ? a : b
-#define swapcode(TYPE, parmi, parmj, n)		\
-{											\
-	long i = (n) / sizeof(TYPE); 			\
-	TYPE *pi = (TYPE *) (parmi); 			\
-	TYPE *pj = (TYPE *) (parmj); 			\
-	do { 									\
-		TYPE	t = *pi;					\
-		*pi++ = *pj;						\
-		*pj++ = t;							\
-	} while (--i > 0);						\
-}
-#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
-	es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
-
-static inline void swapfunc(char* a, char* b, int n, int swaptype)
-{
-	if(swaptype <= 1)
-		swapcode(long, a, b, n)
-	else
-	swapcode(char, a, b, n)
-}
-
-#define swap(a, b)					\
-	if (swaptype == 0) {			\
-		long t = *(long *)(a);		\
-		*(long *)(a) = *(long *)(b);\
-		*(long *)(b) = t;			\
-	} else							\
-		swapfunc(a, b, es, swaptype)
-
-#define vecswap(a, b, n) 	if ((n) > 0) swapfunc(a, b, n, swaptype)
-#define	CMP(t, x, y) (cmp((t), (x), (y)))
-
-static inline char *med3(char *a, char *b, char *c, cmp_t *cmp, void *thunk)
-{
-	return CMP(thunk, a, b) < 0 ?
-		(CMP(thunk, b, c) < 0 ? b : (CMP(thunk, a, c) < 0 ? c : a ))
-		:(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
-}
-
-void recast_qsort(void *a, size_t n, size_t es, void *thunk, cmp_t *cmp)
-{
-	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
-	int d, r, swaptype, swap_cnt;
-
-loop:	
-	SWAPINIT(a, es);
-	swap_cnt = 0;
-	if (n < 7) {
-		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
-			for (pl = pm; 
-				pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
-				pl -= es)
-				swap(pl, pl - es);
-		return;
-	}
-	pm = (char *)a + (n / 2) * es;
-	if (n > 7) {
-		pl = (char *)a;
-		pn = (char *)a + (n - 1) * es;
-		if (n > 40) {
-			d = (n / 8) * es;
-			pl = med3(pl, pl + d, pl + 2 * d, cmp, thunk);
-			pm = med3(pm - d, pm, pm + d, cmp, thunk);
-			pn = med3(pn - 2 * d, pn - d, pn, cmp, thunk);
-		}
-		pm = med3(pl, pm, pn, cmp, thunk);
-	}
-	swap((char *)a, pm);
-	pa = pb = (char *)a + es;
-
-	pc = pd = (char *)a + (n - 1) * es;
-	for (;;) {
-		while (pb <= pc && (r = CMP(thunk, pb, a)) <= 0) {
-			if (r == 0) {
-				swap_cnt = 1;
-				swap(pa, pb);
-				pa += es;
-			}
-			pb += es;
-		}
-		while (pb <= pc && (r = CMP(thunk, pc, a)) >= 0) {
-			if (r == 0) {
-				swap_cnt = 1;
-				swap(pc, pd);
-				pd -= es;
-			}
-			pc -= es;
-		}
-		if (pb > pc)
-			break;
-		swap(pb, pc);
-		swap_cnt = 1;
-		pb += es;
-		pc -= es;
-	}
-	if (swap_cnt == 0) {  /* Switch to insertion sort */
-		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
-			for (pl = pm; 
-				pl > (char *)a && CMP(thunk, pl - es, pl) > 0;
-				pl -= es)
-				swap(pl, pl - es);
-		return;
-	}
-
-	pn = (char *)a + n * es;
-	r = min(pa - (char *)a, pb - pa);
-	vecswap((char *)a, pb - r, r);
-	r = min(pd - pc, pn - pd - es);
-	vecswap(pb, pn - r, r);
-	if ((r = pb - pa) > es)
-		recast_qsort(a, r / es, es, thunk, cmp);
-	if ((r = pd - pc) > es) {
-		/* Iterate rather than recurse to save stack space */
-		a = pn - r;
-		n = r / es;
-		goto loop;
-	}
-}
-

Modified: branches/soc-2013-paint/extern/recastnavigation/recast-capi.h
===================================================================
--- branches/soc-2013-paint/extern/recastnavigation/recast-capi.h	2013-08-19 14:08:59 UTC (rev 59300)
+++ branches/soc-2013-paint/extern/recastnavigation/recast-capi.h	2013-08-19 14:16:24 UTC (rev 59301)
@@ -127,11 +127,6 @@
 
 unsigned int *recast_polyMeshDetailGetMeshes(struct recast_polyMeshDetail *mesh, int *nmeshes);
 
-/* utility function: quick sort reentrant */
-typedef int	recast_cmp_t(void *ctx, const void *a, const void *b);
-
-void recast_qsort(void *a, size_t n, size_t es, void *thunk, recast_cmp_t *cmp);
-
 #ifdef __cplusplus
 }
 #endif

Added: branches/soc-2013-paint/intern/atomic/atomic_ops.h
===================================================================
--- branches/soc-2013-paint/intern/atomic/atomic_ops.h	                        (rev 0)
+++ branches/soc-2013-paint/intern/atomic/atomic_ops.h	2013-08-19 14:16:24 UTC (rev 59301)
@@ -0,0 +1,307 @@
+/*
+ * Adopted from jemalloc with this license:
+ *
+ * Copyright (C) 2002-2013 Jason Evans <jasone at canonware.com>.
+ * All rights reserved.
+ * Copyright (C) 2007-2012 Mozilla Foundation.  All rights reserved.
+ * Copyright (C) 2009-2013 Facebook, Inc.  All rights reserved.
+
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 1. Redistributions of source code must retain the above copyright notice(s),
+ *    this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice(s),
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ATOMIC_OPS_H__
+#define ATOMIC_OPS_H__
+
+#include <assert.h>
+
+#if defined (__APPLE__)
+#  include <libkern/OSAtomic.h>
+#elif defined(_MSC_VER)
+#  include <windows.h>
+#endif
+
+/* needed for int types */
+#include "../../source/blender/blenlib/BLI_sys_types.h"
+
+/* little macro so inline keyword works */
+#if defined(_MSC_VER)
+#  define ATOMIC_INLINE static __forceinline
+#else
+#  if (defined(__APPLE__) && defined(__ppc__))
+/* static inline __attribute__ here breaks osx ppc gcc42 build */
+#    define ATOMIC_INLINE static __attribute__((always_inline))
+#  else
+#    define ATOMIC_INLINE static inline __attribute__((always_inline))
+#  endif
+#endif
+
+#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)
+#  define LG_SIZEOF_PTR 3
+#  define LG_SIZEOF_INT 2
+#else
+#  define LG_SIZEOF_PTR 2
+#  define LG_SIZEOF_INT 2
+#endif
+
+/******************************************************************************/
+/* 64-bit operations. */
+#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)
+#  ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	return (__sync_add_and_fetch(p, x));
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	return (__sync_sub_and_fetch(p, x));
+}
+#elif (defined(_MSC_VER))
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	return (InterlockedExchangeAdd64(p, x));
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	return (InterlockedExchangeAdd64(p, -((int64_t)x)));
+}
+#elif (defined(__APPLE__))
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	return (OSAtomicAdd64((int64_t)x, (int64_t *)p));
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	return (OSAtomicAdd64(-((int64_t)x), (int64_t *)p));
+}
+#  elif (defined(__amd64__) || defined(__x86_64__))
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	asm volatile (
+	    "lock; xaddq %0, %1;"
+	    : "+r" (x), "=m" (*p) /* Outputs. */
+	    : "m" (*p) /* Inputs. */
+	    );
+	return (x);
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	x = (uint64_t)(-(int64_t)x);
+	asm volatile (
+	    "lock; xaddq %0, %1;"
+	    : "+r" (x), "=m" (*p) /* Outputs. */
+	    : "m" (*p) /* Inputs. */
+	    );
+	return (x);
+}
+#  elif (defined(JEMALLOC_ATOMIC9))
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	/*
+	 * atomic_fetchadd_64() doesn't exist, but we only ever use this
+	 * function on LP64 systems, so atomic_fetchadd_long() will do.
+	 */
+	assert(sizeof(uint64_t) == sizeof(unsigned long));
+
+	return (atomic_fetchadd_long(p, (unsigned long)x) + x);
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	assert(sizeof(uint64_t) == sizeof(unsigned long));
+
+	return (atomic_fetchadd_long(p, (unsigned long)(-(long)x)) - x);
+}
+#  elif (defined(JE_FORCE_SYNC_COMPARE_AND_SWAP_8))
+ATOMIC_INLINE uint64_t
+atomic_add_uint64(uint64_t *p, uint64_t x)
+{
+	return (__sync_add_and_fetch(p, x));
+}
+
+ATOMIC_INLINE uint64_t
+atomic_sub_uint64(uint64_t *p, uint64_t x)
+{
+	return (__sync_sub_and_fetch(p, x));
+}
+#  else
+#    error "Missing implementation for 64-bit atomic operations"
+#  endif
+#endif
+
+/******************************************************************************/
+/* 32-bit operations. */
+#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+ATOMIC_INLINE uint32_t
+atomic_add_uint32(uint32_t *p, uint32_t x)
+{
+	return (__sync_add_and_fetch(p, x));
+}
+
+ATOMIC_INLINE uint32_t
+atomic_sub_uint32(uint32_t *p, uint32_t x)
+{
+	return (__sync_sub_and_fetch(p, x));
+}
+#elif (defined(_MSC_VER))
+ATOMIC_INLINE uint32_t
+atomic_add_uint32(uint32_t *p, uint32_t x)
+{
+	return (InterlockedExchangeAdd(p, x));
+}
+
+ATOMIC_INLINE uint32_t
+atomic_sub_uint32(uint32_t *p, uint32_t x)
+{
+	return (InterlockedExchangeAdd(p, -((int32_t)x)));
+}
+#elif (defined(__APPLE__))
+ATOMIC_INLINE uint32_t
+atomic_add_uint32(uint32_t *p, uint32_t x)
+{
+	return (OSAtomicAdd32((int32_t)x, (int32_t *)p));
+}
+
+ATOMIC_INLINE uint32_t
+atomic_sub_uint32(uint32_t *p, uint32_t x)
+{
+	return (OSAtomicAdd32(-((int32_t)x), (int32_t *)p));
+}
+#elif (defined(__i386__) || defined(__amd64__) || defined(__x86_64__))
+ATOMIC_INLINE uint32_t

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list