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:
authorAntonioya <blendergit@gmail.com>2019-02-24 19:00:12 +0300
committerAntonioya <blendergit@gmail.com>2019-02-24 19:00:12 +0300
commit5d7ce96b5df1851a559c84907ea0cd935a0be267 (patch)
treef01fb594bfe132d35d2879db82955883f5804aaf /source
parentccfda7dc2c5d7fe26f0461df2c8209fa6698f9c3 (diff)
GP: Don't set cache as dirty with Onion
Diffstat (limited to 'source')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_cache_utils.c7
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c4
2 files changed, 4 insertions, 7 deletions
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;