[Bf-blender-cvs] [31355076836] greasepencil-object: Cleaunp code

Antonio Vazquez noreply at git.blender.org
Mon May 8 12:57:45 CEST 2017


Commit: 31355076836a1864b780b63d382669e3ee0e9a5b
Author: Antonio Vazquez
Date:   Mon May 8 12:57:37 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB31355076836a1864b780b63d382669e3ee0e9a5b

Cleaunp code

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

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 c458675d7db..b7789cd4ab3 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -123,6 +123,7 @@ static void GPENCIL_engine_init(void *vedata)
 			datatoc_gpencil_fill_frag_glsl,
 			NULL);
 	}
+
 	/* normal stroke shader using geometry to display lines */
 	if (!e_data.gpencil_stroke_sh) {
 		e_data.gpencil_stroke_sh = DRW_shader_create(datatoc_gpencil_stroke_vert_glsl,
@@ -130,10 +131,12 @@ static void GPENCIL_engine_init(void *vedata)
 			datatoc_gpencil_stroke_frag_glsl,
 			NULL);
 	}
+
 	/* used for edit points or strokes with one point only */
 	if (!e_data.gpencil_volumetric_sh) {
 		e_data.gpencil_volumetric_sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_POINT_VARYING_SIZE_VARYING_COLOR);
 	}
+
 	/* used to filling during drawing */
 	if (!e_data.gpencil_drawing_fill_sh) {
 		e_data.gpencil_drawing_fill_sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_SMOOTH_COLOR);
@@ -142,11 +145,11 @@ static void GPENCIL_engine_init(void *vedata)
 	if (!stl->storage) {
 		stl->storage = MEM_callocN(sizeof(GPENCIL_Storage), "GPENCIL_Storage");
 	}
-
 }
 
 static void GPENCIL_engine_free(void)
 {
+	/* only free custom shaders, builtin shaders are freed in blender close */
 	DRW_SHADER_FREE_SAFE(e_data.gpencil_fill_sh);
 	DRW_SHADER_FREE_SAFE(e_data.gpencil_stroke_sh);
 }




More information about the Bf-blender-cvs mailing list