[Bf-blender-cvs] [3319f80e034] blender2.8: GP: Fix performance problem with big files

Antonioya noreply at git.blender.org
Mon Sep 10 20:24:44 CEST 2018


Commit: 3319f80e034e9994826898c537722c6d664b35f5
Author: Antonioya
Date:   Mon Sep 10 20:24:05 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3319f80e034e9994826898c537722c6d664b35f5

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.

===================================================================

M	release/scripts/addons
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/editors/gpencil/gpencil_paint.c

===================================================================

diff --git a/release/scripts/addons b/release/scripts/addons
index 6c3a46dc113..371960484a3 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 6c3a46dc113de870a03191e4c0685238b0823acd
+Subproject commit 371960484a38fc64e0a2635170a41a0d8ab2f6bd
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);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 4ce3899e288..14b7bfc4e1c 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -604,9 +604,6 @@ static short gp_stroke_addpoint(
 			gpd->runtime.sbuffer_size = 2;
 		}
 
-		/* tag depsgraph to update object */
-		DEG_id_tag_update(&gpd->id, OB_RECALC_DATA);
-
 		/* can keep carrying on this way :) */
 		return GP_STROKEADD_NORMAL;
 	}
@@ -739,9 +736,6 @@ static short gp_stroke_addpoint(
 			}
 		}
 
-		/* tag depsgraph to update object */
-		DEG_id_tag_update(&gpd->id, OB_RECALC_DATA);
-
 		/* check if another operation can still occur */
 		if (gpd->runtime.sbuffer_size == GP_STROKE_BUFFER_MAX)
 			return GP_STROKEADD_FULL;
@@ -833,9 +827,6 @@ static short gp_stroke_addpoint(
 		if (gpd->runtime.sbuffer_size == 0)
 			gpd->runtime.sbuffer_size++;
 
-		/* tag depsgraph to update object */
-		DEG_id_tag_update(&gpd->id, OB_RECALC_DATA);
-
 		return GP_STROKEADD_NORMAL;
 	}



More information about the Bf-blender-cvs mailing list