Revision: 49187
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49187
Author:   campbellbarton
Date:     2012-07-24 21:11:22 +0000 (Tue, 24 Jul 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r49177:49186

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

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c
    branches/soc-2011-tomato/release/scripts/startup/bl_operators/wm.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
    branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
    branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h
    branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c
    branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c
    branches/soc-2011-tomato/source/blender/editors/mask/mask_intern.h
    branches/soc-2011-tomato/source/blender/editors/mesh/editmesh_tools.c
    branches/soc-2011-tomato/source/blender/editors/screen/screen_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_editor.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-tomato/source/blender/editors/space_image/space_image.c
    
branches/soc-2011-tomato/source/blender/editors/space_sequencer/sequencer_draw.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_space_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_space.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-49177
   + 
/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-49186

Modified: branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c       
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/intern/guardedalloc/intern/mallocn.c       
2012-07-24 21:11:22 UTC (rev 49187)
@@ -55,6 +55,14 @@
 #include "MEM_guardedalloc.h"
 
 /* Only for debugging:
+ * store original buffer's name when doing MEM_dupallocN
+ * helpful to profile issues with non-freed "dup_alloc" buffers,
+ * but this introduces some overhead to memory header and makes
+ * things slower a bit, so betterto keep disabled by default
+ */
+//#define DEBUG_MEMDUPLINAME
+
+/* Only for debugging:
  * lets you count the allocations so as to find the allocator of unfreed memory
  * in situations where the leak is predictable */
 
@@ -96,6 +104,10 @@
 #ifdef DEBUG_MEMCOUNTER
        int _count;
 #endif
+
+#ifdef DEBUG_MEMDUPLINAME
+       int need_free_name, pad;
+#endif
 } MemHead;
 
 typedef struct MemTail {
@@ -243,14 +255,37 @@
        if (vmemh) {
                MemHead *memh = vmemh;
                memh--;
-               
+
+#ifndef DEBUG_MEMDUPLINAME
                if (memh->mmap)
                        newp = MEM_mapallocN(memh->len, "dupli_mapalloc");
                else
                        newp = MEM_mallocN(memh->len, "dupli_alloc");
 
                if (newp == NULL) return NULL;
+#else
+               {
+                       MemHead *nmemh;
+                       char *name = malloc(strlen(memh->name) + 24);
 
+                       if (memh->mmap) {
+                               sprintf(name, "%s %s", "dupli_mapalloc", 
memh->name);
+                               newp = MEM_mapallocN(memh->len, name);
+                       }
+                       else {
+                               sprintf(name, "%s %s", "dupli_alloc", 
memh->name);
+                               newp = MEM_mallocN(memh->len, name);
+                       }
+
+                       if (newp == NULL) return NULL;
+
+                       nmemh = newp;
+                       nmemh--;
+
+                       nmemh->need_free_name = 1;
+               }
+#endif
+
                memcpy(newp, vmemh, memh->len);
        }
 
@@ -289,6 +324,10 @@
        memh->len = len;
        memh->mmap = 0;
        memh->tag2 = MEMTAG2;
+
+#ifdef DEBUG_MEMDUPLINAME
+       memh->need_free_name = 0;
+#endif
        
        memt = (MemTail *)(((char *) memh) + sizeof(MemHead) + len);
        memt->tag3 = MEMTAG3;
@@ -733,6 +772,11 @@
        totblock--;
        mem_in_use -= memh->len;
 
+#ifdef DEBUG_MEMDUPLINAME
+       if (memh->need_free_name)
+               free((char *) memh->name);
+#endif
+
        if (memh->mmap) {
                mmap_in_use -= memh->len;
                if (munmap(memh, memh->len + sizeof(MemHead) + sizeof(MemTail)))

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_operators/wm.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_operators/wm.py 
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_operators/wm.py 
2012-07-24 21:11:22 UTC (rev 49187)
@@ -101,7 +101,6 @@
     return (isinstance(id_data, bpy.types.ID) and
             (not isinstance(id_data, (bpy.types.WindowManager,
                                       bpy.types.Screen,
-                                      bpy.types.Scene,
                                       bpy.types.Brush,
                                       ))))
 

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c    
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c    
2012-07-24 21:11:22 UTC (rev 49187)
@@ -1533,8 +1533,8 @@
                                if (sl->spacetype == SPACE_CLIP) {
                                        SpaceClip *sc = (SpaceClip *) sl;
 
-                                       if (sc->mask == mask)
-                                               sc->mask = NULL;
+                                       if (sc->mask_info.mask == mask)
+                                               sc->mask_info.mask = NULL;
                                }
                        }
                }

Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c        
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c        
2012-07-24 21:11:22 UTC (rev 49187)
@@ -5342,7 +5342,8 @@
                                                SpaceImage *sima = (SpaceImage 
*)sl;
                                                
                                                sima->image = newlibadr_us(fd, 
sc->id.lib, sima->image);
-                                               
+                                               sima->mask_info.mask = 
newlibadr_us(fd, sc->id.lib, sima->mask_info.mask);
+
                                                /* NOTE: pre-2.5, this was 
local data not lib data, but now we need this as lib data
                                                 * so fingers crossed this 
works fine!
                                                 */
@@ -5428,7 +5429,7 @@
                                                SpaceClip *sclip = (SpaceClip 
*)sl;
                                                
                                                sclip->clip = newlibadr_us(fd, 
sc->id.lib, sclip->clip);
-                                               sclip->mask = newlibadr_us(fd, 
sc->id.lib, sclip->mask);
+                                               sclip->mask_info.mask = 
newlibadr_us(fd, sc->id.lib, sclip->mask_info.mask);
                                                
                                                sclip->scopes.track_search = 
NULL;
                                                sclip->scopes.track_preview = 
NULL;
@@ -5717,7 +5718,7 @@
                                        SpaceClip *sclip = (SpaceClip *)sl;
                                        
                                        sclip->clip = 
restore_pointer_by_name(newmain, (ID *)sclip->clip, 1);
-                                       sclip->mask = 
restore_pointer_by_name(newmain, (ID *)sclip->mask, 1);
+                                       sclip->mask_info.mask = 
restore_pointer_by_name(newmain, (ID *)sclip->mask_info.mask, 1);
                                        
                                        sclip->scopes.ok = 0;
                                }

Modified: branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h   
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h   
2012-07-24 21:11:22 UTC (rev 49187)
@@ -35,13 +35,22 @@
 struct MaskLayer;
 struct MaskLayerShape;
 
-/* mask_editor.c */
+/* mask_edit.c */
+void ED_mask_size(const struct bContext *C, int *width, int *height);
+void ED_mask_aspect(const struct bContext *C, float *aspx, float *aspy);
+
 void ED_operatortypes_mask(void);
 void ED_keymap_mask(struct wmKeyConfig *keyconf);
 void ED_operatormacros_mask(void);
 
 /* mask_draw.c */
 void ED_mask_draw(const bContext *C, const char draw_flag, const char 
draw_type);
+void ED_mask_draw_region(struct Mask *mask, struct ARegion *ar,
+                         const char draw_flag, const char draw_type,
+                         int width, int height,
+                         const short do_scale_applied, const short 
do_post_draw,
+                         float stabmat[4][4],
+                         const bContext *C);
 
 /* mask_shapekey.c */
 void ED_mask_layer_shape_auto_key(struct MaskLayer *masklay, const int frame);


Property changes on: 
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49177
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c: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/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49186

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c    
2012-07-24 21:07:29 UTC (rev 49186)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_draw.c    
2012-07-24 21:11:22 UTC (rev 49187)
@@ -32,17 +32,21 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_utildefines.h"
+#include "BLI_math.h"
 
 #include "BKE_context.h"
 #include "BKE_mask.h"
 
 #include "DNA_mask_types.h"
+#include "DNA_screen_types.h"
 #include "DNA_object_types.h"   /* SELECT */
 
 #include "ED_mask.h"  /* own include */
+#include "ED_space_api.h"
 #include "BIF_gl.h"
 
 #include "UI_resources.h"
+#include "UI_view2d.h"
 
 #include "mask_intern.h"  /* own include */
 
@@ -462,3 +466,73 @@
 
        draw_masklays(mask, draw_flag, draw_type, width, height);
 }
+
+/* sets up the opengl context.
+ * width, height are to match the values from ED_mask_size() */
+void ED_mask_draw_region(Mask *mask, ARegion *ar,
+                         const char draw_flag, const char draw_type,
+                         int width, int height,
+                         const short do_scale_applied, const short 
do_post_draw,
+                         float stabmat[4][4], /* optional - only used by clip 
*/
+                         const bContext *C    /* optional - only used when 
do_post_draw is set */
+                         )
+{
+       struct View2D *v2d = &ar->v2d;
+
+       int x, y;
+       int w, h;
+       float zoomx, zoomy;
+
+       /* frame image */
+       float maxdim;
+       float xofs, yofs;
+
+       /* find window pixel coordinates of origin */
+       UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
+
+       w = v2d->tot.xmax - v2d->tot.xmin;

@@ 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