[Bf-blender-cvs] [6d37f37cf28] greasepencil-object: Cleanup redundant parameters
Antonio Vazquez
noreply at git.blender.org
Thu Jan 18 13:16:30 CET 2018
Commit: 6d37f37cf282064b1653a1e97a9807f1139981c7
Author: Antonio Vazquez
Date: Thu Jan 18 13:16:21 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6d37f37cf282064b1653a1e97a9807f1139981c7
Cleanup redundant parameters
===================================================================
M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M source/blender/draw/engines/gpencil/gpencil_engine.h
M source/blender/draw/engines/gpencil/gpencil_geom.c
===================================================================
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 9091a0fcc98..31c05de7778 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -872,7 +872,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T
}
stl->g_data->shgrps_drawing_fill = DRW_shgroup_create(e_data->gpencil_drawing_fill_sh, psl->drawing_pass);
stl->g_data->tot_sh++;
- stl->g_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd, gpd->sbuffer, gpd->sbuffer_size, gpd->sfill);
+ stl->g_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd);
DRW_shgroup_call_add(stl->g_data->shgrps_drawing_fill, stl->g_data->batch_buffer_fill, stl->storage->unit_matrix);
}
}
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index 2d9421f731f..fd5d8e5b954 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -319,7 +319,7 @@ struct Gwn_Batch *DRW_gpencil_get_fill_geom(struct bGPDstroke *gps, const float
struct Gwn_Batch *DRW_gpencil_get_edit_geom(struct bGPDstroke *gps, float alpha, short dflag);
struct Gwn_Batch *DRW_gpencil_get_edlin_geom(struct bGPDstroke *gps, float alpha, short dflag);
struct Gwn_Batch *DRW_gpencil_get_buffer_stroke_geom(struct bGPdata *gpd, float matrix[4][4], short thickness);
-struct Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(struct bGPdata *gpd, const struct tGPspoint *points, int totpoints, float ink[4]);
+struct Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(struct bGPdata *gpd);
struct Gwn_Batch *DRW_gpencil_get_buffer_point_geom(struct bGPdata *gpd, float matrix[4][4], short thickness);
struct GPUTexture *DRW_gpencil_create_blank_texture(int width, int height);
diff --git a/source/blender/draw/engines/gpencil/gpencil_geom.c b/source/blender/draw/engines/gpencil/gpencil_geom.c
index 02b0b524de6..c540440a34f 100644
--- a/source/blender/draw/engines/gpencil/gpencil_geom.c
+++ b/source/blender/draw/engines/gpencil/gpencil_geom.c
@@ -315,8 +315,14 @@ Gwn_Batch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, float matrix[4][4], s
}
/* create batch geometry data for current buffer fill shader */
-Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd, const tGPspoint *points, int totpoints, float ink[4])
+Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd)
{
+ if (gpd == NULL) {
+ return NULL;
+ }
+
+ const tGPspoint *points = gpd->sbuffer;
+ int totpoints = gpd->sbuffer_size;
if (totpoints < 3) {
return NULL;
}
@@ -372,7 +378,7 @@ Gwn_Batch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd, const tGPspoint *point
tpt = &points[tmp_triangles[i][j]];
gpencil_tpoint_to_point(scene, ar, v3d, origin, tpt, &pt);
GWN_vertbuf_attr_set(vbo, pos_id, idx, &pt.x);
- GWN_vertbuf_attr_set(vbo, color_id, idx, ink);
+ GWN_vertbuf_attr_set(vbo, color_id, idx, gpd->sfill);
idx++;
}
}
More information about the Bf-blender-cvs
mailing list