[Bf-blender-cvs] [af0ba709f8c] greasepencil-object: Remove DRW_gpencil_create_blank_texture function

Antonio Vazquez noreply at git.blender.org
Fri May 11 19:31:03 CEST 2018


Commit: af0ba709f8caa1005008bbe85569879eb4ca7a4d
Author: Antonio Vazquez
Date:   Fri May 11 19:30:57 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBaf0ba709f8caa1005008bbe85569879eb4ca7a4d

Remove DRW_gpencil_create_blank_texture function

This function is not needed and the same can be done with less lines.

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

M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 7dbc70dff75..7c5882d5dc1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -1032,19 +1032,6 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene
 	cache->is_dirty = false;
 }
 
-struct GPUTexture *DRW_gpencil_create_blank_texture(int width, int height)
-{
-	struct GPUTexture *tex;
-	int w = width;
-	int h = height;
-	float *final_rect = MEM_callocN(sizeof(float) * 4 * w * h, "Gpencil Blank Texture");
-
-	tex = DRW_texture_create_2D(w, h, GPU_RGBA8, DRW_TEX_FILTER, final_rect);
-	MEM_freeN(final_rect);
-
-	return tex;
-}
-
 /* Helper for gpencil_instance_modifiers()
  * See also MOD_gpencilinstance.c -> gp_bakeModifier()
  */
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index c9a9fefc226..11fc62b75de 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -193,7 +193,8 @@ static void GPENCIL_engine_init(void *vedata)
 
 	/* blank texture used if no texture defined for fill shader */
 	if (!e_data.gpencil_blank_texture) {
-		e_data.gpencil_blank_texture = DRW_gpencil_create_blank_texture(16, 16);
+		float rect[16][16][4] = { 0.0f };
+		e_data.gpencil_blank_texture = DRW_texture_create_2D(16, 16, GPU_RGBA8, DRW_TEX_FILTER, (float *)rect);
 	}
 }
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 57256bb9679..699a17b2d42 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -253,8 +253,6 @@ struct Gwn_Batch *DRW_gpencil_get_buffer_point_geom(struct bGPdata *gpd, float m
 
 void DRW_gpencil_recalc_geometry_caches(struct Object *ob, struct MaterialGPencilStyle *gp_style, struct bGPDstroke *gps);
 
-struct GPUTexture *DRW_gpencil_create_blank_texture(int width, int height);
-
 bool gpencil_can_draw_stroke(struct MaterialGPencilStyle *gp_style, const struct bGPDstroke *gps, const bool onion);
 
 /* object cache functions */



More information about the Bf-blender-cvs mailing list