[Bf-blender-cvs] [5d7ce96b5df] master: GP: Don't set cache as dirty with Onion
Antonioya
noreply at git.blender.org
Sun Feb 24 17:02:12 CET 2019
Commit: 5d7ce96b5df1851a559c84907ea0cd935a0be267
Author: Antonioya
Date: Sun Feb 24 17:00:12 2019 +0100
Branches: master
https://developer.blender.org/rB5d7ce96b5df1851a559c84907ea0cd935a0be267
GP: Don't set cache as dirty with Onion
===================================================================
M source/blender/draw/engines/gpencil/gpencil_cache_utils.c
M source/blender/draw/engines/gpencil/gpencil_draw_utils.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
index c99c7befa32..f6702f6f56b 100644
--- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c
@@ -185,13 +185,6 @@ static bool gpencil_batch_cache_valid(GpencilBatchCache *cache, bGPdata *gpd, in
gpd->flag &= ~GP_DATA_PYTHON_UPDATED;
valid = false;
}
- else if (DRW_gpencil_onion_active(gpd)) {
- /* if onion, set as dirty always
- * This reduces performance, but avoid any crash in the multiple
- * overlay and multiwindow options and keep all windows working
- */
- valid = false;
- }
else if (cache->is_editmode) {
valid = false;
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 816bc554bc7..c2932b34b65 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -65,6 +65,10 @@ static void gpencil_calc_vertex(
GpencilBatchCache *cache, bGPdata *gpd,
int cfra_eval)
{
+ if (!cache->is_dirty) {
+ return;
+ }
+
Object *ob = cache_ob->ob;
const DRWContextState *draw_ctx = DRW_context_state_get();
const bool main_onion = draw_ctx->v3d != NULL ? (draw_ctx->v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) : true;
More information about the Bf-blender-cvs
mailing list