[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49452] branches/soc-2011-tomato/source/ blender: Remove mask cache hack added for mango project a while ago
Sergey Sharybin
sergey.vfx at gmail.com
Wed Aug 1 16:19:42 CEST 2012
Revision: 49452
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49452
Author: nazgul
Date: 2012-08-01 14:19:42 +0000 (Wed, 01 Aug 2012)
Log Message:
-----------
Remove mask cache hack added for mango project a while ago
We've got new rasterizer which doesn't require cacheing anymore.
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
branches/soc-2011-tomato/source/blender/blenloader/intern/readblenentry.c
branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.h
branches/soc-2011-tomato/source/blender/makesdna/DNA_mask_types.h
Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-08-01 14:14:22 UTC (rev 49451)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/mask.c 2012-08-01 14:19:42 UTC (rev 49452)
@@ -56,21 +56,6 @@
#include "BKE_movieclip.h"
#include "BKE_utildefines.h"
-#ifdef USE_MANGO_MASK_CACHE_HACK
-
-#include "BLI_threads.h"
-
-typedef struct MaskRasterCache {
- float *buffer;
- int width, height;
- short do_aspect_correct;
- short do_mask_aa;
- short do_feather;
-
- ListBase layers;
-} MaskRasterCache;
-#endif
-
static MaskSplinePoint *mask_spline_point_next(MaskSpline *spline, MaskSplinePoint *points_array, MaskSplinePoint *point)
{
if (point == &points_array[spline->tot_point - 1]) {
@@ -1560,41 +1545,9 @@
}
-#ifdef USE_MANGO_MASK_CACHE_HACK
-void BKE_mask_raster_cache_free(Mask *mask)
-{
- MaskRasterCache *cache = mask->raster_cache;
-
- if (cache) {
- MaskLayer *layer;
-
- layer = cache->layers.first;
- while (layer) {
- MaskLayer *layer_next = layer->next;
-
- BKE_mask_layer_free(layer);
- layer = layer_next;
- }
-
- MEM_freeN(cache->buffer);
- MEM_freeN(cache);
-
- mask->raster_cache = NULL;
- }
-}
-#endif
-
void BKE_mask_free(Mask *mask)
{
BKE_mask_layer_free_list(&mask->masklayers);
-
-#ifdef USE_MANGO_MASK_CACHE_HACK
- if (mask->raster_cache) {
- BKE_mask_raster_cache_free(mask);
-
- mask->raster_cache = NULL;
- }
-#endif
}
void BKE_mask_unlink(Main *bmain, Mask *mask)
Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readblenentry.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/readblenentry.c 2012-08-01 14:14:22 UTC (rev 49451)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/readblenentry.c 2012-08-01 14:19:42 UTC (rev 49452)
@@ -310,9 +310,6 @@
/* makes lookup of existing video clips in old main */
blo_make_movieclip_pointer_map(fd, oldmain);
- /* makes lookup of existing masks in old main */
- blo_make_mask_pointer_map(fd, oldmain);
-
bfd = blo_read_file_internal(fd, filename);
/* ensures relinked images are not freed */
@@ -321,9 +318,6 @@
/* ensures relinked movie clips are not freed */
blo_end_movieclip_pointer_map(fd, oldmain);
- /* ensures relinked masks are not freed */
- blo_end_mask_pointer_map(fd, oldmain);
-
/* move libraries from old main to new main */
if (bfd && mainlist.first != mainlist.last) {
Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c 2012-08-01 14:14:22 UTC (rev 49451)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.c 2012-08-01 14:19:42 UTC (rev 49452)
@@ -1090,10 +1090,6 @@
oldnewmap_free(fd->imamap);
if (fd->movieclipmap)
oldnewmap_free(fd->movieclipmap);
-#ifdef USE_MANGO_MASK_CACHE_HACK
- if (fd->maskmap)
- oldnewmap_free(fd->maskmap);
-#endif
if (fd->libmap && !(fd->flags & FD_FLAGS_NOT_MY_LIBMAP))
oldnewmap_free(fd->libmap);
if (fd->bheadmap)
@@ -1178,16 +1174,6 @@
return NULL;
}
-#ifdef USE_MANGO_MASK_CACHE_HACK
-static void *newmaskadr(FileData *fd, void *adr) /* used to restore mask data after undo */
-{
- if (fd->maskmap && adr)
- return oldnewmap_lookup_and_inc(fd->maskmap, adr);
- return NULL;
-}
-#endif
-
-
static void *newlibadr(FileData *fd, void *lib, void *adr) /* only lib data */
{
return oldnewmap_liblookup(fd->libmap, adr, lib);
@@ -1382,39 +1368,6 @@
}
}
-#ifdef USE_MANGO_MASK_CACHE_HACK
-void blo_make_mask_pointer_map(FileData *fd, Main *oldmain)
-{
- Mask *mask;
-
- fd->maskmap = oldnewmap_new();
-
- for (mask = oldmain->mask.first; mask; mask = mask->id.next) {
- if (mask->raster_cache)
- oldnewmap_insert(fd->maskmap, mask->raster_cache, mask->raster_cache, 0);
- }
-}
-
-/* set old main mask caches to zero if it has been restored */
-/* this works because freeing old main only happens after this call */
-void blo_end_mask_pointer_map(FileData *fd, Main *oldmain)
-{
- OldNew *entry = fd->maskmap->entries;
- Mask *mask;
- int i;
-
- /* used entries were restored, so we put them to zero */
- for (i = 0; i < fd->maskmap->nentries; i++, entry++) {
- if (entry->nr > 0)
- entry->newp = NULL;
- }
-
- for (mask = oldmain->mask.first; mask; mask = mask->id.next) {
- mask->raster_cache = newmclipadr(fd, mask->raster_cache);
- }
-}
-#endif
-
/* undo file support: add all library pointers in lookup */
void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd)
{
@@ -6314,11 +6267,6 @@
{
MaskLayer *masklay;
-#ifdef USE_MANGO_MASK_CACHE_HACK
- if (fd->maskmap) mask->raster_cache = newmaskadr(fd, mask->raster_cache);
- else mask->raster_cache = NULL;
-#endif
-
mask->adt = newdataadr(fd, mask->adt);
link_list(fd, &mask->masklayers);
Modified: branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.h 2012-08-01 14:14:22 UTC (rev 49451)
+++ branches/soc-2011-tomato/source/blender/blenloader/intern/readfile.h 2012-08-01 14:19:42 UTC (rev 49452)
@@ -83,7 +83,6 @@
struct OldNewMap *libmap;
struct OldNewMap *imamap;
struct OldNewMap *movieclipmap;
- struct OldNewMap *maskmap;
struct bheadsort *bheadmap;
int tot_bheadmap;
@@ -128,8 +127,6 @@
void blo_end_image_pointer_map(FileData *fd, Main *oldmain);
void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain);
void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain);
-void blo_make_mask_pointer_map(FileData *fd, Main *oldmain);
-void blo_end_mask_pointer_map(FileData *fd, Main *oldmain);
void blo_add_library_pointer_map(ListBase *mainlist, FileData *fd);
void blo_freefiledata(FileData *fd);
Modified: branches/soc-2011-tomato/source/blender/makesdna/DNA_mask_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesdna/DNA_mask_types.h 2012-08-01 14:14:22 UTC (rev 49451)
+++ branches/soc-2011-tomato/source/blender/makesdna/DNA_mask_types.h 2012-08-01 14:19:42 UTC (rev 49452)
@@ -40,8 +40,6 @@
#include "DNA_listBase.h"
#include "DNA_curve_types.h"
-#define USE_MANGO_MASK_CACHE_HACK
-
typedef struct Mask {
ID id;
struct AnimData *adt;
More information about the Bf-blender-cvs
mailing list