[Bf-blender-cvs] [81f135677be] master: Depsgraph: Cleanup, use less explicit checks of LIB_TAG_ID_RECALC_DATA

Sergey Sharybin noreply at git.blender.org
Wed Dec 13 14:58:26 CET 2017


Commit: 81f135677be419a505a38f5a23354690a75b678b
Author: Sergey Sharybin
Date:   Wed Dec 13 14:39:56 2017 +0100
Branches: master
https://developer.blender.org/rB81f135677be419a505a38f5a23354690a75b678b

Depsgraph: Cleanup, use less explicit checks of LIB_TAG_ID_RECALC_DATA

This is a part of ongoing work in Blender 2.8, where we need to replace

  `object->id.tag & LIB_TAG_ID_RECALC_DATA`

with

  `object->data->id.tag & LIB_TAG_ID_RECALC`

Should be no user measurable difference.

===================================================================

M	source/blender/blenkernel/intern/depsgraph.c
M	source/blender/blenkernel/intern/mask.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/depsgraph/intern/depsgraph_tag.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 30b7f15da7c..e9b83b27ef2 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -1532,7 +1532,7 @@ static bool check_object_tagged_for_update(Object *object)
 
 	if (ELEM(object->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
 		ID *data_id = object->data;
-		return (data_id->tag & (LIB_TAG_ID_RECALC_DATA | LIB_TAG_ID_RECALC)) != 0;
+		return (data_id->tag & LIB_TAG_ID_RECALC_ALL) != 0;
 	}
 
 	return false;
@@ -2825,8 +2825,7 @@ void DAG_ids_flush_tagged(Main *bmain)
 
 		if (id && bmain->id_tag_update[BKE_idcode_to_index(GS(id->name))]) {
 			for (; id; id = id->next) {
-				if (id->tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)) {
-					
+				if (id->tag & LIB_TAG_ID_RECALC_ALL) {
 					for (dsl = listbase.first; dsl; dsl = dsl->next)
 						dag_id_flush_update(bmain, dsl->scene, id);
 					
@@ -2946,13 +2945,12 @@ void DAG_ids_clear_recalc(Main *bmain)
 
 		if (id && bmain->id_tag_update[BKE_idcode_to_index(GS(id->name))]) {
 			for (; id; id = id->next) {
-				if (id->tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA))
-					id->tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
+				id->tag &= ~LIB_TAG_ID_RECALC_ALL;
 
 				/* some ID's contain semi-datablock nodetree */
 				ntree = ntreeFromID(id);
-				if (ntree && (ntree->id.tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)))
-					ntree->id.tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
+				if (ntree)
+					ntree->id.tag &= ~LIB_TAG_ID_RECALC_ALL;
 			}
 		}
 	}
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index b8a241ed956..cd697cadc0e 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1463,7 +1463,7 @@ void BKE_mask_update_scene(Main *bmain, Scene *scene)
 	Mask *mask;
 
 	for (mask = bmain->mask.first; mask; mask = mask->id.next) {
-		if (mask->id.tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)) {
+		if (mask->id.tag & LIB_TAG_ID_RECALC_ALL) {
 			bool do_new_frame = (mask->id.tag & LIB_TAG_ID_RECALC_DATA) != 0;
 			BKE_mask_evaluate_all_masks(bmain, CFRA, do_new_frame);
 		}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 5e12fc969ab..b6543fc8662 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3077,7 +3077,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
 	ntree->adt = newdataadr(fd, ntree->adt);
 	direct_link_animdata(fd, ntree->adt);
 	
-	ntree->id.tag &= ~(LIB_TAG_ID_RECALC|LIB_TAG_ID_RECALC_DATA);
+	ntree->id.tag &= ~LIB_TAG_ID_RECALC_ALL;
 
 	link_list(fd, &ntree->nodes);
 	for (node = ntree->nodes.first; node; node = node->next) {
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index eafb091e53a..8f91a826760 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -409,12 +409,12 @@ void DEG_ids_clear_recalc(Main *bmain)
 
 		if (id && bmain->id_tag_update[BKE_idcode_to_index(GS(id->name))]) {
 			for (; id; id = (ID *)id->next) {
-				id->tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
+				id->tag &= ~LIB_TAG_ID_RECALC_ALL;
 
 				/* Some ID's contain semi-datablock nodetree */
 				ntree = ntreeFromID(id);
 				if (ntree != NULL) {
-					ntree->id.tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
+					ntree->id.tag &= ~LIB_TAG_ID_RECALC_ALL;
 				}
 			}
 		}



More information about the Bf-blender-cvs mailing list