Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-08-22 15:04:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-22 15:07:25 +0300
commit2f195592587c652c7bf84bf26a6805e41773c2d5 (patch)
tree1e1a4b483685bddae57865441bfe76001a614d0b /source
parent9457715d9a6feb574d9f33246842079a9cb15288 (diff)
Cleanup: naming for mesh dirty flags
- NOCHECK -> ALL - ALL -> MAYBE_ALL Where 'MAYBE_ALL' checks to see if the mesh has changed. This is clearer that `BKE_MESH_BATCH_DIRTY_ALL` is dirty and going to be updated without any guess-work.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_mesh.h2
-rw-r--r--source/blender/blenkernel/intern/deform.c2
-rw-r--r--source/blender/blenkernel/intern/object_deform.c2
-rw-r--r--source/blender/blenkernel/intern/object_update.c2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c22
-rw-r--r--source/blender/draw/modes/paint_weight_mode.c2
-rw-r--r--source/blender/editors/mesh/editface.c4
-rw-r--r--source/blender/editors/object/object_edit.c2
-rw-r--r--source/blender/editors/object/object_transform.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c8
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c8
-rw-r--r--source/blender/makesrna/intern/rna_mesh_api.c2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c2
13 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 9463ea81bfc..5ee3b9be5f9 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -408,8 +408,8 @@ void BKE_mesh_eval_geometry(const struct EvaluationContext *eval_ctx,
/* Draw Cache */
enum {
BKE_MESH_BATCH_DIRTY_ALL = 0,
+ BKE_MESH_BATCH_DIRTY_MAYBE_ALL,
BKE_MESH_BATCH_DIRTY_SELECT,
- BKE_MESH_BATCH_DIRTY_NOCHECK,
BKE_MESH_BATCH_DIRTY_SHADING,
BKE_MESH_BATCH_DIRTY_SCULPT_COORDS,
};
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 584942628fa..1fc83b69bfe 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -74,7 +74,7 @@ bDeformGroup *BKE_defgroup_new(Object *ob, const char *name)
BLI_addtail(&ob->defbase, defgroup);
defgroup_unique_name(defgroup, ob);
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
return defgroup;
}
diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c
index 887618415be..81fa25b1b03 100644
--- a/source/blender/blenkernel/intern/object_deform.c
+++ b/source/blender/blenkernel/intern/object_deform.c
@@ -407,7 +407,7 @@ void BKE_object_defgroup_remove(Object *ob, bDeformGroup *defgroup)
else
object_defgroup_remove_object_mode(ob, defgroup);
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
}
/**
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index c5d267ace9d..99010c7a9fc 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -337,7 +337,7 @@ void BKE_object_eval_uber_data(const EvaluationContext *eval_ctx,
switch (ob->type) {
case OB_MESH:
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_MAYBE_ALL);
break;
case OB_LATTICE:
BKE_lattice_batch_cache_dirty(ob->data, BKE_LATTICE_BATCH_DIRTY_ALL);
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index f77411c91e8..6b3ef31f8dd 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -1494,8 +1494,8 @@ typedef struct MeshBatchCache {
Gwn_Batch *overlay_paint_edges;
/* settings to determine if cache is invalid */
- bool is_dirty;
- bool is_really_dirty; /* Instantly invalidates cache, skipping mesh check */
+ bool is_maybe_dirty;
+ bool is_dirty; /* Instantly invalidates cache, skipping mesh check */
int edge_len;
int tri_len;
int poly_len;
@@ -1519,18 +1519,18 @@ static bool mesh_batch_cache_valid(Mesh *me)
/* XXX find another place for this */
if (cache->mat_len != mesh_render_mat_len_get(me)) {
- cache->is_dirty = true;
+ cache->is_maybe_dirty = true;
}
if (cache->is_editmode != (me->edit_btmesh != NULL)) {
return false;
}
- if (cache->is_really_dirty) {
+ if (cache->is_dirty) {
return false;
}
- if (cache->is_dirty == false) {
+ if (cache->is_maybe_dirty == false) {
return true;
}
else {
@@ -1572,8 +1572,8 @@ static void mesh_batch_cache_init(Mesh *me)
cache->mat_len = mesh_render_mat_len_get(me);
+ cache->is_maybe_dirty = false;
cache->is_dirty = false;
- cache->is_really_dirty = false;
}
static MeshBatchCache *mesh_batch_cache_get(Mesh *me)
@@ -1592,8 +1592,8 @@ void DRW_mesh_batch_cache_dirty(Mesh *me, int mode)
return;
}
switch (mode) {
- case BKE_MESH_BATCH_DIRTY_ALL:
- cache->is_dirty = true;
+ case BKE_MESH_BATCH_DIRTY_MAYBE_ALL:
+ cache->is_maybe_dirty = true;
break;
case BKE_MESH_BATCH_DIRTY_SELECT:
GWN_VERTBUF_DISCARD_SAFE(cache->ed_tri_data);
@@ -1612,13 +1612,13 @@ void DRW_mesh_batch_cache_dirty(Mesh *me, int mode)
GWN_BATCH_DISCARD_SAFE(cache->edges_with_select_id);
GWN_BATCH_DISCARD_SAFE(cache->verts_with_select_id);
break;
- case BKE_MESH_BATCH_DIRTY_NOCHECK:
- cache->is_really_dirty = true;
+ case BKE_MESH_BATCH_DIRTY_ALL:
+ cache->is_dirty = true;
break;
case BKE_MESH_BATCH_DIRTY_SHADING:
/* TODO: This should only update UV and tangent data,
* and not free the entire cache. */
- cache->is_really_dirty = true;
+ cache->is_dirty = true;
break;
case BKE_MESH_BATCH_DIRTY_SCULPT_COORDS:
cache->is_sculpt_points_tag = true;
diff --git a/source/blender/draw/modes/paint_weight_mode.c b/source/blender/draw/modes/paint_weight_mode.c
index 809be5ef8b1..d837b273404 100644
--- a/source/blender/draw/modes/paint_weight_mode.c
+++ b/source/blender/draw/modes/paint_weight_mode.c
@@ -92,7 +92,7 @@ static void PAINT_WEIGHT_engine_init(void *UNUSED(vedata))
if (e_data.actdef != draw_ctx->obact->actdef) {
e_data.actdef = draw_ctx->obact->actdef;
- BKE_mesh_batch_cache_dirty(draw_ctx->obact->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(draw_ctx->obact->data, BKE_MESH_BATCH_DIRTY_ALL);
}
if (!e_data.weight_face_shader) {
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 94fe433e5d7..870eb68600a 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -107,7 +107,7 @@ void paintface_flush_flags(Object *ob, short flag)
GPU_drawobject_free(dm);
}
- BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_ALL);
}
void paintface_hide(Object *ob, const bool unselected)
@@ -518,7 +518,7 @@ void paintvert_flush_flags(Object *ob)
}
}
- BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_ALL);
}
/* note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 953dedab02d..d9d81cbc1fd 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1263,7 +1263,7 @@ static int shade_smooth_exec(bContext *C, wmOperator *op)
if (ob->type == OB_MESH) {
BKE_mesh_smooth_flag_set(ob, !clear);
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 32c342f9f02..944fbb0bbe1 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -1091,7 +1091,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
for (tob = bmain->object.first; tob; tob = tob->id.next) {
if (tob->data && (((ID *)tob->data)->tag & LIB_TAG_DOIT)) {
- BKE_mesh_batch_cache_dirty(tob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(tob->data, BKE_MESH_BATCH_DIRTY_ALL);
DEG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA);
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 321ce1fe306..2da808b3a78 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -1825,7 +1825,7 @@ static int wpaint_mode_toggle_exec(bContext *C, wmOperator *op)
ED_vgroup_sync_from_pose(ob);
}
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
/* Weightpaint works by overriding colors in mesh,
* so need to make sure we recalc on enter and
@@ -2391,7 +2391,7 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* also needed for "View Selected" on last stroke */
paint_last_stroke_update(scene, vc->ar, mval);
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
DEG_id_tag_update(ob->data, 0);
ED_region_tag_redraw(vc->ar);
@@ -2598,7 +2598,7 @@ static int vpaint_mode_toggle_exec(bContext *C, wmOperator *op)
BKE_paint_init(scene, ePaintVertex, PAINT_CURSOR_VERTEX_PAINT);
}
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
/* update modifier stack for mapping requirements */
DEG_id_tag_update(&me->id, 0);
@@ -2874,7 +2874,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P
/* also needed for "View Selected" on last stroke */
paint_last_stroke_update(scene, vc->ar, mval);
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
ED_region_tag_redraw(vc->ar);
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 8ff5474ed91..e94b724043f 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -239,7 +239,7 @@ static void rna_Mesh_update_data_edit_color(Main *bmain, Scene *scene, PointerRN
static void rna_Mesh_update_data_edit_weight(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- BKE_mesh_batch_cache_dirty(rna_mesh(ptr), BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(rna_mesh(ptr), BKE_MESH_BATCH_DIRTY_ALL);
rna_Mesh_update_data(bmain, scene, ptr);
}
@@ -247,7 +247,7 @@ static void rna_Mesh_update_data_edit_weight(Main *bmain, Scene *scene, PointerR
static void rna_Mesh_update_data_edit_active_color(Main *bmain, Scene *scene, PointerRNA *ptr)
{
- BKE_mesh_batch_cache_dirty(rna_mesh(ptr), BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(rna_mesh(ptr), BKE_MESH_BATCH_DIRTY_ALL);
rna_Mesh_update_data(bmain, scene, ptr);
}
@@ -277,7 +277,7 @@ static void rna_Mesh_update_vertmask(Main *bmain, Scene *scene, PointerRNA *ptr)
me->editflag &= ~ME_EDIT_PAINT_FACE_SEL;
}
- BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_ALL);
rna_Mesh_update_draw(bmain, scene, ptr);
}
@@ -289,7 +289,7 @@ static void rna_Mesh_update_facemask(Main *bmain, Scene *scene, PointerRNA *ptr)
me->editflag &= ~ME_EDIT_PAINT_VERT_SEL;
}
- BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(me, BKE_MESH_BATCH_DIRTY_ALL);
rna_Mesh_update_draw(bmain, scene, ptr);
}
diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c
index 6886321a498..f1f7c9a3b99 100644
--- a/source/blender/makesrna/intern/rna_mesh_api.c
+++ b/source/blender/makesrna/intern/rna_mesh_api.c
@@ -217,7 +217,7 @@ static void rna_Mesh_split_faces(Mesh *mesh, int free_loop_normals)
static void rna_Mesh_update_gpu_tag(Mesh *mesh)
{
- BKE_mesh_batch_cache_dirty(mesh, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(mesh, BKE_MESH_BATCH_DIRTY_ALL);
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 9fb60a13dda..f61e0212f63 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2703,7 +2703,7 @@ static void rna_LayerCollectionEngineSettings_wire_update(bContext *C, PointerRN
Object *ob = OBACT_NEW(sl);
if (ob != NULL && ob->type == OB_MESH) {
- BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_NOCHECK);
+ BKE_mesh_batch_cache_dirty(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
}
/* TODO(sergey): Use proper flag for tagging here. */