Revision: 48912
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48912
Author:   campbellbarton
Date:     2012-07-14 13:04:01 +0000 (Sat, 14 Jul 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r48893:48911

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

Modified Paths:
--------------
    branches/soc-2011-tomato/build_files/cmake/config/blender_lite.cmake
    branches/soc-2011-tomato/intern/guardedalloc/MEM_guardedalloc.h
    branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c
    branches/soc-2011-tomato/source/blender/blenkernel/intern/multires.c
    branches/soc-2011-tomato/source/blender/blenlib/BLI_math_geom.h
    branches/soc-2011-tomato/source/blender/blenlib/BLI_memarena.h
    branches/soc-2011-tomato/source/blender/blenlib/BLI_mempool.h
    branches/soc-2011-tomato/source/blender/blenlib/BLI_utildefines.h
    branches/soc-2011-tomato/source/blender/blenlib/intern/math_geom.c
    branches/soc-2011-tomato/source/blender/blenlib/intern/rct.c
    branches/soc-2011-tomato/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2011-tomato/source/gameengine/Ketsji/KX_BlenderMaterial.cpp
    branches/soc-2011-tomato/source/gameengine/Ketsji/KX_BlenderMaterial.h

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-48893
   + 
/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-48911

Modified: branches/soc-2011-tomato/build_files/cmake/config/blender_lite.cmake
===================================================================
--- branches/soc-2011-tomato/build_files/cmake/config/blender_lite.cmake        
2012-07-14 12:47:49 UTC (rev 48911)
+++ branches/soc-2011-tomato/build_files/cmake/config/blender_lite.cmake        
2012-07-14 13:04:01 UTC (rev 48912)
@@ -17,6 +17,7 @@
 set(WITH_LIBMV               OFF CACHE FORCE BOOL)
 set(WITH_CARVE               OFF CACHE FORCE BOOL)
 set(WITH_GAMEENGINE          OFF CACHE FORCE BOOL)
+set(WITH_COMPOSITOR          OFF CACHE FORCE BOOL)
 set(WITH_GHOST_XDND          OFF CACHE FORCE BOOL)
 set(WITH_IK_ITASC            OFF CACHE FORCE BOOL)
 set(WITH_IMAGE_CINEON        OFF CACHE FORCE BOOL)

Modified: branches/soc-2011-tomato/intern/guardedalloc/MEM_guardedalloc.h
===================================================================
--- branches/soc-2011-tomato/intern/guardedalloc/MEM_guardedalloc.h     
2012-07-14 12:47:49 UTC (rev 48911)
+++ branches/soc-2011-tomato/intern/guardedalloc/MEM_guardedalloc.h     
2012-07-14 13:04:01 UTC (rev 48912)
@@ -60,8 +60,8 @@
 #ifndef __MEM_GUARDEDALLOC_H__
 #define __MEM_GUARDEDALLOC_H__
 
-#include <stdio.h> /* needed for FILE* */
-#include "MEM_sys_types.h" /* needed for uintptr_t */
+#include <stdio.h>          /* needed for FILE* */
+#include "MEM_sys_types.h"  /* needed for uintptr_t */
 
 #ifdef __cplusplus
 extern "C" {
@@ -70,7 +70,7 @@
        /** Returns the length of the allocated memory segment pointed at
         * by vmemh. If the pointer was not previously allocated by this
         * module, the result is undefined.*/
-       size_t MEM_allocN_len(void *vmemh)
+       size_t MEM_allocN_len(const void *vmemh)
 #ifdef __GNUC__
        __attribute__((warn_unused_result))
 #endif
@@ -111,10 +111,10 @@
         * Allocate a block of memory of size len, with tag name str. The
         * memory is cleared. The name must be static, because only a
         * pointer to it is stored ! */
-       void *MEM_callocN(size_t len, const char * str)
+       void *MEM_callocN(size_t len, const char *str)
 #ifdef __GNUC__
        __attribute__((warn_unused_result))
-       __attribute__((nonnull))
+       __attribute__((nonnull(2)))
        __attribute__((alloc_size(1)))
 #endif
        ;
@@ -122,10 +122,10 @@
        /** Allocate a block of memory of size len, with tag name str. The
         * name must be a static, because only a pointer to it is stored !
         * */
-       void *MEM_mallocN(size_t len, const char * str)
+       void *MEM_mallocN(size_t len, const char *str)
 #ifdef __GNUC__
        __attribute__((warn_unused_result))
-       __attribute__((nonnull))
+       __attribute__((nonnull(2)))
        __attribute__((alloc_size(1)))
 #endif
        ;
@@ -133,10 +133,10 @@
        /** Same as callocN, clears memory and uses mmap (disk cached) if 
supported.
         * Can be free'd with MEM_freeN as usual.
         * */
-       void *MEM_mapallocN(size_t len, const char * str)
+       void *MEM_mapallocN(size_t len, const char *str)
 #ifdef __GNUC__
        __attribute__((warn_unused_result))
-       __attribute__((nonnull))
+       __attribute__((nonnull(2)))
        __attribute__((alloc_size(1)))
 #endif
        ;
@@ -213,11 +213,10 @@
                        MEM_freeN(mem);                                         
          \
        }                                                                       
  \
 
-#endif
+#endif  /* __cplusplus */
 
-
 #ifdef __cplusplus
 }
-#endif
+#endif  /* __cplusplus */
 
-#endif
+#endif  /* __MEM_GUARDEDALLOC_H__ */

Modified: branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c       
2012-07-14 12:47:49 UTC (rev 48911)
+++ branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c       
2012-07-14 13:04:01 UTC (rev 48912)
@@ -222,10 +222,10 @@
        malloc_debug_memset = 1;
 }
 
-size_t MEM_allocN_len(void *vmemh)
+size_t MEM_allocN_len(const void *vmemh)
 {
        if (vmemh) {
-               MemHead *memh = vmemh;
+               const MemHead *memh = vmemh;
        
                memh--;
                return memh->len;

Modified: 
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c  
2012-07-14 12:47:49 UTC (rev 48911)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask_rasterize.c  
2012-07-14 13:04:01 UTC (rev 48912)
@@ -34,20 +34,18 @@
 #include "DNA_mask_types.h"
 
 #include "BLI_utildefines.h"
-#include "BLI_kdopbvh.h"
 #include "BLI_scanfill.h"
+#include "BLI_memarena.h"
 
 #include "BLI_math.h"
 #include "BLI_rect.h"
 #include "BLI_listbase.h"
-#include "BLI_mempool.h"
+#include "BLI_linklist.h"
 
 #include "BKE_mask.h"
 
 #ifndef USE_RASKTER
 
-#define RESOL 32
-
 /**
  * A single #MaskRasterHandle contains multile #MaskRasterLayer's,
  * each #MaskRasterLayer does its own lookup which contributes to
@@ -56,17 +54,24 @@
 
 /* internal use only */
 typedef struct MaskRasterLayer {
-       /* xy raytree */
-       BVHTree *bvhtree;
+       /* geometry */
+       unsigned int   tri_tot;
+       unsigned int (*tri_array)[4];  /* access coords tri/quad */
+       float        (*tri_coords)[3]; /* xy, z 0-1 (1.0 == filled) */
 
+
        /* 2d bounds (to quickly skip raytree lookup) */
        rctf bounds;
 
-       /* geometry */
-       unsigned int (*tri_array)[4];  /* access coords tri/quad */
-       float        (*tri_coords)[3]; /* xy, z 0-1 (1.0 == filled) */
 
+       /* buckets */
+       unsigned int **buckets_tri;
+       /* cache divide and subtract */
+       float buckets_xy_scalar[2]; /* 1.0 / (buckets_width + FLT_EPSILON) */
+       unsigned int buckets_x;
+       unsigned int buckets_y;
 
+
        /* copied direct from #MaskLayer.--- */
        /* blending options */
        float  alpha;
@@ -75,6 +80,7 @@
 
 } MaskRasterLayer;
 
+static void layer_bucket_init(MaskRasterLayer *layer);
 
 /**
  * opaque local struct for mask pixel lookup, each MaskLayer needs one of these
@@ -104,7 +110,6 @@
 
        /* raycast vars */
        for (i = 0; i < layers_tot; i++, raslayers++) {
-               BLI_bvhtree_free(raslayers->bvhtree);
 
                if (raslayers->tri_array) {
                        MEM_freeN(raslayers->tri_array);
@@ -113,27 +118,44 @@
                if (raslayers->tri_coords) {
                        MEM_freeN(raslayers->tri_coords);
                }
+
+               if (raslayers->buckets_tri) {
+                       const unsigned int   bucket_tot = raslayers->buckets_x 
* raslayers->buckets_y;
+                       unsigned int bucket_index;
+                       for (bucket_index = 0; bucket_index < bucket_tot; 
bucket_index++) {
+                               unsigned int *tri_index = 
raslayers->buckets_tri[bucket_index];
+                               if (tri_index) {
+                                       MEM_freeN(tri_index);
+                               }
+                       }
+
+                       MEM_freeN(raslayers->buckets_tri);
+               }
        }
 
        MEM_freeN(mr_handle->layers);
        MEM_freeN(mr_handle);
 }
 
+#define RESOL 32
+
 #define PRINT_MASK_DEBUG printf
 
 #define SF_EDGE_IS_BOUNDARY 0xff
 
 #define SF_KEYINDEX_TEMP_ID ((unsigned int) -1)
+#define TRI_TERMINATOR_ID   ((unsigned int) -1)
 
 
 void maskrasterize_spline_differentiate_point_inset(float 
(*diff_feather_points)[2], float (*diff_points)[2],
-                                                    const int tot_diff_point, 
const float ofs, const int do_test)
+                                                    const unsigned int 
tot_diff_point, const float ofs,
+                                                    const short do_test)
 {
-       int k_prev = tot_diff_point - 2;
-       int k_curr = tot_diff_point - 1;
-       int k_next = 0;
+       unsigned int k_prev = tot_diff_point - 2;
+       unsigned int k_curr = tot_diff_point - 1;
+       unsigned int k_next = 0;
 
-       int k;
+       unsigned int k;
 
        float d_prev[2];
        float d_next[2];
@@ -153,9 +175,6 @@
        sub_v2_v2v2(d_prev, co_prev, co_curr);
        normalize_v2(d_prev);
 
-       /* TODO, speedup by only doing one normalize per iter */
-
-
        for (k = 0; k < tot_diff_point; k++) {
 
                co_prev = diff_points[k_prev];
@@ -202,7 +221,7 @@
 
        const float zvec[3] = {0.0f, 0.0f, 1.0f};
        MaskLayer *masklay;
-       int masklay_index;
+       unsigned int masklay_index;
 
        mr_handle->layers_tot = BLI_countlist(&mask->masklayers);
        mr_handle->layers = MEM_mallocN(sizeof(MaskRasterLayer) * 
mr_handle->layers_tot, STRINGIFY(MaskRasterLayer));
@@ -366,7 +385,6 @@
                        rctf bounds;
                        int tri_index;
 
-                       BVHTree *bvhtree;
                        float bvhcos[4][3];
 
                        /* now we have all the splines */
@@ -397,9 +415,6 @@
 
                        tri_array = MEM_mallocN(sizeof(*tri_array) * 
(sf_tri_tot + tot_feather_quads), "maskrast_tri_index");
 
-                       /* */
-                       bvhtree = BLI_bvhtree_new(sf_tri_tot + 
tot_feather_quads, 0.000001f, 8, 6);
-
                        /* tri's */
                        tri = (unsigned int *)tri_array;
                        for (sf_tri = sf_ctx.fillfacebase.first, tri_index = 0; 
sf_tri; sf_tri = sf_tri->next, tri_index++) {
@@ -407,12 +422,6 @@
                                *(tri++) = sf_tri->v2->tmp.u;
                                *(tri++) = sf_tri->v3->tmp.u;
                                *(tri++) = TRI_VERT;
-
-                               copy_v3_v3(bvhcos[0], tri_coords[*(tri - 4)]);
-                               copy_v3_v3(bvhcos[1], tri_coords[*(tri - 3)]);
-                               copy_v3_v3(bvhcos[2], tri_coords[*(tri - 2)]);
-
-                               BLI_bvhtree_insert(bvhtree, tri_index, (float 
*)bvhcos, 3);
                        }
 
                        /* start of feather faces... if we have this set,
@@ -435,7 +444,7 @@
                                                copy_v3_v3(bvhcos[2], 
tri_coords[*(tri - 2)]);
                                                copy_v3_v3(bvhcos[3], 
tri_coords[*(tri - 1)]);
 
-                                               BLI_bvhtree_insert(bvhtree, 
tri_index++, (const float *)bvhcos, 4);
+                                               tri_index++;
                                        }
                                }
                        }
@@ -444,21 +453,20 @@
 
                        BLI_assert(tri_index == sf_tri_tot + tot_feather_quads);
 
-                       BLI_bvhtree_balance(bvhtree);
-
                        {
                                MaskRasterLayer *raslayer = 
&mr_handle->layers[masklay_index];
 
+                               raslayer->tri_tot = sf_tri_tot + 
tot_feather_quads;
                                raslayer->tri_coords = tri_coords;
                                raslayer->tri_array  = tri_array;
                                raslayer->bounds  = bounds;
-                               raslayer->bvhtree = bvhtree;
 
                                /* copy as-is */
                                raslayer->alpha = masklay->alpha;
                                raslayer->blend = masklay->blend;

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to