[Bf-blender-cvs] [43abc5dabfb] blender2.8: GP: Use original datablock and not evaluated version
Antonioya
noreply at git.blender.org
Tue Sep 11 10:33:39 CEST 2018
Commit: 43abc5dabfb0ecc0a481e1f0597245fd5ff44af4
Author: Antonioya
Date: Tue Sep 11 10:29:33 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB43abc5dabfb0ecc0a481e1f0597245fd5ff44af4
GP: Use original datablock and not evaluated version
This is required to avoid COW delay while drawing.
===================================================================
M source/blender/draw/engines/gpencil/gpencil_engine.c
===================================================================
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 5dd1cb50405..aa033dd36e0 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -42,6 +42,8 @@
#include "gpencil_engine.h"
+#include "DEG_depsgraph_query.h"
+
#include "ED_screen.h"
#include "ED_gpencil.h"
@@ -381,9 +383,11 @@ void GPENCIL_cache_init(void *vedata)
(obact_gpd->flag & GP_DATA_STROKE_PAINTMODE) &&
(stl->storage->is_playing == false))
{
- if (((obact_gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) &&
- (obact_gpd->runtime.sbuffer_size > 0) &&
- ((obact_gpd->flag & GP_DATA_STROKE_POLYGON) == 0))
+ /* need the original to avoid cow overhead while drawing */
+ bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&obact_gpd->id);
+ if (((gpd_orig->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) &&
+ (gpd_orig->runtime.sbuffer_size > 0) &&
+ ((gpd_orig->flag & GP_DATA_STROKE_POLYGON) == 0))
{
stl->g_data->session_flag |= GP_DRW_PAINT_PAINTING;
}
More information about the Bf-blender-cvs
mailing list