From 1e784c54cd78d75a6eb94eccf81161265e297321 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 9 May 2013 10:41:05 +0000 Subject: bmesh speedup: skip free-realloc while running CustomData_bmesh_merge() when nothing is changed (happens quite often that there is nothing to do). --- source/blender/blenkernel/BKE_customdata.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/BKE_customdata.h') diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index bc94ab8ed41..b72667b5935 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -115,13 +115,13 @@ void CustomData_update_typemap(struct CustomData *data); /* same as the above, except that this will preserve existing layers, and only * add the layers that were not there yet */ -void CustomData_merge(const struct CustomData *source, struct CustomData *dest, +bool CustomData_merge(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, int alloctype, int totelem); /* bmesh version of CustomData_merge; merges the layouts of source and dest, * then goes through the mesh and makes sure all the customdata blocks are * consistent with the new layout.*/ -void CustomData_bmesh_merge(struct CustomData *source, struct CustomData *dest, +bool CustomData_bmesh_merge(struct CustomData *source, struct CustomData *dest, CustomDataMask mask, int alloctype, struct BMesh *bm, const char htype); /** NULL's all members and resets the typemap. */ @@ -167,6 +167,7 @@ bool CustomData_has_layer(const struct CustomData *data, int type); /* returns the number of layers with this type */ int CustomData_number_of_layers(const struct CustomData *data, int type); +int CustomData_number_of_layers_typemask(const struct CustomData *data, CustomDataMask mask); /* duplicate data of a layer with flag NOFREE, and remove that flag. * returns the layer data */ -- cgit v1.2.3