[Bf-blender-cvs] [fabf8717b32] greasepencil-object: Use function to avoid duplicated code

Antonio Vazquez noreply at git.blender.org
Wed Dec 6 21:38:11 CET 2017


Commit: fabf8717b32281d6aee7ca74017bca95258a41a8
Author: Antonio Vazquez
Date:   Wed Dec 6 17:50:10 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rBfabf8717b32281d6aee7ca74017bca95258a41a8

Use function to avoid duplicated 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 cd4644144bc..ff233c8e2b9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -595,46 +595,22 @@ static void gpencil_vfx_passes(void *vedata, tGPencilObjectCache *cache)
 	 * Pixelate pass 
 	 * --------------*/
 	if ((cache->init_vfx_pixel_sh) && (cache->end_vfx_pixel_sh)) {
-		DRW_framebuffer_bind(fbl->vfx_color_fb_b);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		/* pixel pass */
-		DRW_draw_pass_subset(psl->vfx_pixel_pass,
-			cache->init_vfx_pixel_sh,
-			cache->end_vfx_pixel_sh);
-		/* copy pass from b to a */
-		DRW_framebuffer_bind(fbl->vfx_color_fb_a);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		DRW_draw_pass(psl->vfx_copy_pass);
+		gpencil_draw_vfx_pass(psl->vfx_pixel_pass, psl->vfx_copy_pass,
+			fbl, cache->init_vfx_pixel_sh, cache->end_vfx_pixel_sh);
 	}
 	/* --------------
 	 * Swirl pass 
 	 * --------------*/
 	if ((cache->init_vfx_swirl_sh) && (cache->end_vfx_swirl_sh)) {
-		DRW_framebuffer_bind(fbl->vfx_color_fb_b);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		/* swirl pass */
-		DRW_draw_pass_subset(psl->vfx_swirl_pass,
-			cache->init_vfx_swirl_sh,
-			cache->end_vfx_swirl_sh);
-		/* copy pass from b to a */
-		DRW_framebuffer_bind(fbl->vfx_color_fb_a);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		DRW_draw_pass(psl->vfx_copy_pass);
+		gpencil_draw_vfx_pass(psl->vfx_swirl_pass, psl->vfx_copy_pass,
+			fbl, cache->init_vfx_swirl_sh, cache->end_vfx_swirl_sh);
 	}
 	/* --------------
 	* Flip pass
 	* --------------*/
 	if ((cache->init_vfx_flip_sh) && (cache->end_vfx_flip_sh)) {
-		DRW_framebuffer_bind(fbl->vfx_color_fb_b);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		/* flip pass */
-		DRW_draw_pass_subset(psl->vfx_flip_pass,
-			cache->init_vfx_flip_sh,
-			cache->end_vfx_flip_sh);
-		/* copy pass from b to a */
-		DRW_framebuffer_bind(fbl->vfx_color_fb_a);
-		DRW_framebuffer_clear(true, true, false, clearcol, 1.0f);
-		DRW_draw_pass(psl->vfx_copy_pass);
+		gpencil_draw_vfx_pass(psl->vfx_flip_pass, psl->vfx_copy_pass,
+			fbl, cache->init_vfx_flip_sh, cache->end_vfx_flip_sh);
 	}
 	/* --------------
 	* Light pass



More information about the Bf-blender-cvs mailing list