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
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2018-09-10 21:24:05 +0300
committerAntonioya <blendergit@gmail.com>2018-09-10 21:24:37 +0300
commit3319f80e034e9994826898c537722c6d664b35f5 (patch)
tree23125646f2f65fc837cb261cbb780b77c524c1b4 /source/blender/draw/engines/gpencil/gpencil_draw_utils.c
parent89295c7f6b47ff3c2837a884c2377f26c1f959d0 (diff)
GP: Fix performance problem with big files
During drawing, the depsgrah was tagged to update and this produced a full copy of the datablock. This tag was done in order to get the right data in drawing engine, but this added a great overhead while drawing and the response of the pen was not good. Now, the depsgraph is not tagged and the drawing engine uses the original copy data of the buffer datablock. This is not a problem because only can draw in one window at time.
Diffstat (limited to 'source/blender/draw/engines/gpencil/gpencil_draw_utils.c')
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 1e24b337466..39ab49cde28 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -906,7 +906,10 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl;
GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl;
Brush *brush = BKE_brush_getactive_gpencil(ts);
- bGPdata *gpd = ob->data;
+ bGPdata *gpd_eval = ob->data;
+ /* need the original to avoid cow overhead while drawing */
+ bGPdata *gpd = (bGPdata *)DEG_get_original_id(&gpd_eval->id);
+
MaterialGPencilStyle *gp_style = NULL;
float obscale = mat4_to_scale(ob->obmat);