diff options
author | Antonioya <blendergit@gmail.com> | 2019-06-27 17:42:18 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-06-27 17:42:38 +0300 |
commit | 58996e3057f9a2a6ce4a87a0b36b8fcfafcb8967 (patch) | |
tree | 62c641eaa05b99dbb7db59a40b1ee0d9c81ac391 /source/blender/draw | |
parent | 91e00bd7032ef5e7f7b94a415fd732fc35dff6d7 (diff) |
Cleanup: GPencil remove DRW_ prefix for internal functions.
The prefix DRW_ must be used only for modules inside Draw Manager and not in the Engines.
Diffstat (limited to 'source/blender/draw')
6 files changed, 261 insertions, 261 deletions
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 7b2c0ed168e..18950f00823 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -130,11 +130,11 @@ static void gpencil_vbo_ensure_size(GpencilBatchCacheElem *be, int totvertex) } /* create batch geometry data for points stroke shader */ -void DRW_gpencil_get_point_geom(GpencilBatchCacheElem *be, - bGPDstroke *gps, - short thickness, - const float ink[4], - const int alignment_mode) +void gpencil_get_point_geom(GpencilBatchCacheElem *be, + bGPDstroke *gps, + short thickness, + const float ink[4], + const int alignment_mode) { int totvertex = gps->totpoints; if (be->vbo == NULL) { @@ -211,10 +211,10 @@ void DRW_gpencil_get_point_geom(GpencilBatchCacheElem *be, } /* create batch geometry data for stroke shader */ -void DRW_gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be, - bGPDstroke *gps, - short thickness, - const float ink[4]) +void gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be, + bGPDstroke *gps, + short thickness, + const float ink[4]) { bGPDspoint *points = gps->points; int totpoints = gps->totpoints; @@ -319,17 +319,17 @@ void DRW_gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be, } /* create batch geometry data for stroke shader */ -void DRW_gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, - Object *ob, - bGPDstroke *gps, - const float color[4]) +void gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, + Object *ob, + bGPDstroke *gps, + const float color[4]) { BLI_assert(gps->totpoints >= 3); /* Calculate triangles cache for filling area (must be done only after changes) */ if ((gps->flag & GP_STROKE_RECALC_GEOMETRY) || (gps->tot_triangles == 0) || (gps->triangles == NULL)) { - DRW_gpencil_triangulate_stroke_fill(ob, gps); + gpencil_triangulate_stroke_fill(ob, gps); } BLI_assert(gps->tot_triangles >= 1); @@ -365,7 +365,7 @@ void DRW_gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, } /* create batch geometry data for current buffer stroke shader */ -GPUBatch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, short thickness) +GPUBatch *gpencil_get_buffer_stroke_geom(bGPdata *gpd, short thickness) { const DRWContextState *draw_ctx = DRW_context_state_get(); Scene *scene = draw_ctx->scene; @@ -467,7 +467,7 @@ GPUBatch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, short thickness) } /* create batch geometry data for current buffer point shader */ -GPUBatch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, short thickness) +GPUBatch *gpencil_get_buffer_point_geom(bGPdata *gpd, short thickness) { const DRWContextState *draw_ctx = DRW_context_state_get(); Scene *scene = draw_ctx->scene; @@ -550,7 +550,7 @@ GPUBatch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, short thickness) } /* create batch geometry data for current buffer control point shader */ -GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(bGPdata *gpd) +GPUBatch *gpencil_get_buffer_ctrlpoint_geom(bGPdata *gpd) { bGPDcontrolpoint *cps = gpd->runtime.cp_points; int totpoints = gpd->runtime.tot_cp_points; @@ -614,7 +614,7 @@ GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(bGPdata *gpd) } /* create batch geometry data for current buffer fill shader */ -GPUBatch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd) +GPUBatch *gpencil_get_buffer_fill_geom(bGPdata *gpd) { if (gpd == NULL) { return NULL; @@ -694,10 +694,10 @@ GPUBatch *DRW_gpencil_get_buffer_fill_geom(bGPdata *gpd) } /* Draw selected verts for strokes being edited */ -void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, - bGPDstroke *gps, - float alpha, - short dflag) +void gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, + bGPDstroke *gps, + float alpha, + short dflag) { const DRWContextState *draw_ctx = DRW_context_state_get(); Object *ob = draw_ctx->obact; @@ -797,10 +797,10 @@ void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, } /* Draw lines for strokes being edited */ -void DRW_gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, - bGPDstroke *gps, - float alpha, - short UNUSED(dflag)) +void gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, + bGPDstroke *gps, + float alpha, + short UNUSED(dflag)) { const DRWContextState *draw_ctx = DRW_context_state_get(); Object *ob = draw_ctx->obact; @@ -896,7 +896,7 @@ static void set_grid_point(GPUVertBuf *vbo, } /* Draw grid lines */ -GPUBatch *DRW_gpencil_get_grid(Object *ob) +GPUBatch *gpencil_get_grid(Object *ob) { const DRWContextState *draw_ctx = DRW_context_state_get(); Scene *scene = draw_ctx->scene; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index b41085868d1..fa706812715 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -86,7 +86,7 @@ static void gpencil_calc_vertex(GPENCIL_StorageList *stl, (bool)((draw_ctx->v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) : true; const bool do_onion = (bool)((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0) && overlay && - main_onion && DRW_gpencil_onion_active(gpd) && !playing; + main_onion && gpencil_onion_active(gpd) && !playing; const bool time_remap = BKE_gpencil_has_time_modifiers(ob); const bool is_multiedit = (bool)GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); @@ -232,10 +232,10 @@ static void gpencil_calc_stroke_fill_uv( } /* recalc the internal geometry caches for fill and uvs */ -static void DRW_gpencil_recalc_geometry_caches(Object *ob, - bGPDlayer *gpl, - MaterialGPencilStyle *gp_style, - bGPDstroke *gps) +static void gpencil_recalc_geometry_caches(Object *ob, + bGPDlayer *gpl, + MaterialGPencilStyle *gp_style, + bGPDstroke *gps) { if (gps->flag & GP_STROKE_RECALC_GEOMETRY) { /* Calculate triangles cache for filling area (must be done only after changes) */ @@ -243,7 +243,7 @@ static void DRW_gpencil_recalc_geometry_caches(Object *ob, if ((gps->totpoints > 2) && ((gp_style->fill_rgba[3] > GPENCIL_ALPHA_OPACITY_THRESH) || (gp_style->fill_style > 0) || (gpl->blend_mode != eGplBlendMode_Regular))) { - DRW_gpencil_triangulate_stroke_fill(ob, gps); + gpencil_triangulate_stroke_fill(ob, gps); } } @@ -355,15 +355,15 @@ static void set_wireframe_color(Object *ob, } /* create shading group for filling */ -static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_Data *vedata, - DRWPass *pass, - GPUShader *shader, - Object *ob, - bGPdata *gpd, - bGPDlayer *gpl, - MaterialGPencilStyle *gp_style, - int id, - int shading_type[2]) +static DRWShadingGroup *gpencil_shgroup_fill_create(GPENCIL_Data *vedata, + DRWPass *pass, + GPUShader *shader, + Object *ob, + bGPdata *gpd, + bGPDlayer *gpl, + MaterialGPencilStyle *gp_style, + int id, + int shading_type[2]) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const DRWContextState *draw_ctx = DRW_context_state_get(); @@ -484,7 +484,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_Data *vedata, } /* check if some onion is enabled */ -bool DRW_gpencil_onion_active(bGPdata *gpd) +bool gpencil_onion_active(bGPdata *gpd) { for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { if (gpl->onion_flag & GP_LAYER_ONIONSKIN) { @@ -495,18 +495,18 @@ bool DRW_gpencil_onion_active(bGPdata *gpd) } /* create shading group for strokes */ -DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_Data *vedata, - DRWPass *pass, - GPUShader *shader, - Object *ob, - bGPdata *gpd, - bGPDlayer *gpl, - bGPDstroke *gps, - MaterialGPencilStyle *gp_style, - int id, - bool onion, - const float scale, - const int shading_type[2]) +DRWShadingGroup *gpencil_shgroup_stroke_create(GPENCIL_Data *vedata, + DRWPass *pass, + GPUShader *shader, + Object *ob, + bGPdata *gpd, + bGPDlayer *gpl, + bGPDstroke *gps, + MaterialGPencilStyle *gp_style, + int id, + bool onion, + const float scale, + const int shading_type[2]) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const float *viewport_size = DRW_viewport_size_get(); @@ -646,18 +646,18 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_Data *vedata, } /* create shading group for points */ -static DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_Data *vedata, - DRWPass *pass, - GPUShader *shader, - Object *ob, - bGPdata *gpd, - bGPDlayer *gpl, - bGPDstroke *gps, - MaterialGPencilStyle *gp_style, - int id, - bool onion, - const float scale, - const int shading_type[2]) +static DRWShadingGroup *gpencil_shgroup_point_create(GPENCIL_Data *vedata, + DRWPass *pass, + GPUShader *shader, + Object *ob, + bGPdata *gpd, + bGPDlayer *gpl, + bGPDstroke *gps, + MaterialGPencilStyle *gp_style, + int id, + bool onion, + const float scale, + const int shading_type[2]) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const float *viewport_size = DRW_viewport_size_get(); @@ -837,7 +837,7 @@ static void gpencil_add_fill_vertexdata(GpencilBatchCache *cache, } /* create vertex data */ const int old_len = cache->b_fill.vbo_len; - DRW_gpencil_get_fill_geom(&cache->b_fill, ob, gps, color); + gpencil_get_fill_geom(&cache->b_fill, ob, gps, color); /* add to list of groups */ if (old_len < cache->b_fill.vbo_len) { @@ -903,7 +903,7 @@ static void gpencil_add_stroke_vertexdata(GpencilBatchCache *cache, if ((gps->totpoints > 1) && (gp_style->mode == GP_STYLE_MODE_LINE)) { /* create vertex data */ const int old_len = cache->b_stroke.vbo_len; - DRW_gpencil_get_stroke_geom(&cache->b_stroke, gps, sthickness, ink); + gpencil_get_stroke_geom(&cache->b_stroke, gps, sthickness, ink); /* add to list of groups */ if (old_len < cache->b_stroke.vbo_len) { @@ -921,7 +921,7 @@ static void gpencil_add_stroke_vertexdata(GpencilBatchCache *cache, else { /* create vertex data */ const int old_len = cache->b_point.vbo_len; - DRW_gpencil_get_point_geom(&cache->b_point, gps, sthickness, ink, alignment_mode); + gpencil_get_point_geom(&cache->b_point, gps, sthickness, ink, alignment_mode); /* add to list of groups */ if (old_len < cache->b_point.vbo_len) { @@ -965,7 +965,7 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache, if ((obact == ob) && ((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) && (v3d->gp_flag & V3D_GP_SHOW_EDIT_LINES)) { /* line of the original stroke */ - DRW_gpencil_get_edlin_geom(&cache->b_edlin, gps, edit_alpha, gpd->flag); + gpencil_get_edlin_geom(&cache->b_edlin, gps, edit_alpha, gpd->flag); /* add to list of groups */ cache->grp_cache = gpencil_group_cache_add(cache->grp_cache, @@ -983,7 +983,7 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache, if ((gpl->flag & GP_LAYER_UNLOCK_COLOR) || ((gp_style->flag & GP_STYLE_COLOR_LOCKED) == 0)) { if (obact == ob) { - DRW_gpencil_get_edit_geom(&cache->b_edit, gps, edit_alpha, gpd->flag); + gpencil_get_edit_geom(&cache->b_edit, gps, edit_alpha, gpd->flag); /* add to list of groups */ cache->grp_cache = gpencil_group_cache_add(cache->grp_cache, @@ -1070,7 +1070,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, /* be sure recalc all cache in source stroke to avoid recalculation when frame change * and improve fps */ if (src_gps) { - DRW_gpencil_recalc_geometry_caches(ob, gpl, gp_style, src_gps); + gpencil_recalc_geometry_caches(ob, gpl, gp_style, src_gps); } /* if the fill has any value, it's considered a fill and is not drawn if simplify fill is @@ -1377,7 +1377,7 @@ static void gpencil_copy_frame(bGPDframe *gpf, bGPDframe *derived_gpf) /* Triangulate stroke for high quality fill (this is done only if cache is null or stroke was * modified) */ -void DRW_gpencil_triangulate_stroke_fill(Object *ob, bGPDstroke *gps) +void gpencil_triangulate_stroke_fill(Object *ob, bGPDstroke *gps) { BLI_assert(gps->totpoints >= 3); @@ -1460,10 +1460,10 @@ static bool gpencil_is_stencil_required(MaterialGPencilStyle *gp_style) } /* draw stroke in drawing buffer */ -void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, - void *vedata, - ToolSettings *ts, - Object *ob) +void gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, + void *vedata, + ToolSettings *ts, + Object *ob) { GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl; GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; @@ -1508,7 +1508,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, /* if only one point, don't need to draw buffer because the user has no time to see it */ if (gpd->runtime.sbuffer_size > 1) { if ((gp_style) && (gp_style->mode == GP_STYLE_MODE_LINE)) { - stl->g_data->shgrps_drawing_stroke = DRW_gpencil_shgroup_stroke_create( + stl->g_data->shgrps_drawing_stroke = gpencil_shgroup_stroke_create( vedata, psl->drawing_pass, e_data->gpencil_stroke_sh, @@ -1532,7 +1532,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, } } else { - stl->g_data->shgrps_drawing_stroke = DRW_gpencil_shgroup_point_create( + stl->g_data->shgrps_drawing_stroke = gpencil_shgroup_point_create( vedata, psl->drawing_pass, e_data->gpencil_point_sh, @@ -1552,10 +1552,10 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, /* use unit matrix because the buffer is in screen space and does not need conversion */ if (gpd->runtime.mode == GP_STYLE_MODE_LINE) { - stl->g_data->batch_buffer_stroke = DRW_gpencil_get_buffer_stroke_geom(gpd, lthick); + stl->g_data->batch_buffer_stroke = gpencil_get_buffer_stroke_geom(gpd, lthick); } else { - stl->g_data->batch_buffer_stroke = DRW_gpencil_get_buffer_point_geom(gpd, lthick); + stl->g_data->batch_buffer_stroke = gpencil_get_buffer_point_geom(gpd, lthick); } /* buffer strokes, must show stroke always */ @@ -1577,7 +1577,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, DRW_shgroup_state_disable(stl->g_data->shgrps_drawing_stroke, DRW_STATE_WRITE_STENCIL | DRW_STATE_STENCIL_NEQUAL); - stl->g_data->batch_buffer_fill = DRW_gpencil_get_buffer_fill_geom(gpd); + stl->g_data->batch_buffer_fill = gpencil_get_buffer_fill_geom(gpd); DRW_shgroup_call(stl->g_data->shgrps_drawing_fill, stl->g_data->batch_buffer_fill, NULL); } } @@ -1598,14 +1598,14 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, DRW_shgroup_uniform_vec2(shgrp, "Viewport", viewport_size, 1); /* Disable stencil for this type */ DRW_shgroup_state_disable(shgrp, DRW_STATE_WRITE_STENCIL | DRW_STATE_STENCIL_NEQUAL); - stl->g_data->batch_buffer_ctrlpoint = DRW_gpencil_get_buffer_ctrlpoint_geom(gpd); + stl->g_data->batch_buffer_ctrlpoint = gpencil_get_buffer_ctrlpoint_geom(gpd); DRW_shgroup_call(shgrp, stl->g_data->batch_buffer_ctrlpoint, NULL); } } /* create all missing batches */ -static void DRW_gpencil_create_batches(GpencilBatchCache *cache) +static void gpencil_create_batches(GpencilBatchCache *cache) { if ((cache->b_point.vbo) && (cache->b_point.batch == NULL)) { cache->b_point.batch = GPU_batch_create_ex( @@ -1630,11 +1630,11 @@ static void DRW_gpencil_create_batches(GpencilBatchCache *cache) } /* create all shading groups */ -static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, - void *vedata, - Object *ob, - GpencilBatchCache *cache, - tGPencilObjectCache *cache_ob) +static void gpencil_shgroups_create(GPENCIL_e_data *e_data, + void *vedata, + Object *ob, + GpencilBatchCache *cache, + tGPencilObjectCache *cache_ob) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; GPENCIL_PassList *psl = ((GPENCIL_Data *)vedata)->psl; @@ -1658,7 +1658,7 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, true; const bool main_onion = v3d != NULL ? (v3d->gp_flag & V3D_GP_SHOW_ONION_SKIN) : true; const bool do_onion = (bool)((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0) && main_onion && - DRW_gpencil_onion_active(gpd) && overlay; + gpencil_onion_active(gpd) && overlay; int start_stroke = 0; int start_point = 0; @@ -1713,18 +1713,18 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, case eGpencilBatchGroupType_Stroke: { const int len = elm->vertex_idx - start_stroke; - shgrp = DRW_gpencil_shgroup_stroke_create(vedata, - stroke_pass, - e_data->gpencil_stroke_sh, - ob, - gpd, - gpl, - gps, - gp_style, - stl->storage->shgroup_id, - elm->onion, - scale, - cache_ob->shading_type); + shgrp = gpencil_shgroup_stroke_create(vedata, + stroke_pass, + e_data->gpencil_stroke_sh, + ob, + gpd, + gpl, + gps, + gp_style, + stl->storage->shgroup_id, + elm->onion, + scale, + cache_ob->shading_type); if ((do_onion) || (elm->onion == false)) { DRW_shgroup_call_range_obmat(shgrp, cache->b_stroke.batch, obmat, start_stroke, len); } @@ -1747,18 +1747,18 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, case eGpencilBatchGroupType_Point: { const int len = elm->vertex_idx - start_point; - shgrp = DRW_gpencil_shgroup_point_create(vedata, - stroke_pass, - e_data->gpencil_point_sh, - ob, - gpd, - gpl, - gps, - gp_style, - stl->storage->shgroup_id, - elm->onion, - scale, - cache_ob->shading_type); + shgrp = gpencil_shgroup_point_create(vedata, + stroke_pass, + e_data->gpencil_point_sh, + ob, + gpd, + gpl, + gps, + gp_style, + stl->storage->shgroup_id, + elm->onion, + scale, + cache_ob->shading_type); if ((do_onion) || (elm->onion == false)) { DRW_shgroup_call_range_obmat(shgrp, cache->b_point.batch, obmat, start_point, len); @@ -1775,15 +1775,15 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, case eGpencilBatchGroupType_Fill: { const int len = elm->vertex_idx - start_fill; - shgrp = DRW_gpencil_shgroup_fill_create(vedata, - stroke_pass, - e_data->gpencil_fill_sh, - ob, - gpd, - gpl, - gp_style, - stl->storage->shgroup_id, - cache_ob->shading_type); + shgrp = gpencil_shgroup_fill_create(vedata, + stroke_pass, + e_data->gpencil_fill_sh, + ob, + gpd, + gpl, + gp_style, + stl->storage->shgroup_id, + cache_ob->shading_type); if ((do_onion) || (elm->onion == false)) { DRW_shgroup_call_range_obmat(shgrp, cache->b_fill.batch, obmat, start_fill, len); @@ -1843,10 +1843,10 @@ static void DRW_gpencil_shgroups_create(GPENCIL_e_data *e_data, } } /* populate a datablock for multiedit (no onions, no modifiers) */ -void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, - void *vedata, - Object *ob, - tGPencilObjectCache *cache_ob) +void gpencil_populate_multiedit(GPENCIL_e_data *e_data, + void *vedata, + Object *ob, + tGPencilObjectCache *cache_ob) { bGPdata *gpd = (bGPdata *)ob->data; bGPDframe *gpf = NULL; @@ -1908,8 +1908,8 @@ void DRW_gpencil_populate_multiedit(GPENCIL_e_data *e_data, } /* create batchs and shading groups */ - DRW_gpencil_create_batches(cache); - DRW_gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); + gpencil_create_batches(cache); + gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); cache->is_dirty = false; } @@ -1937,10 +1937,10 @@ static void gpencil_ensure_derived_frame(bGPdata *gpd, } /* helper for populate a complete grease pencil datablock */ -void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, - void *vedata, - Object *ob, - tGPencilObjectCache *cache_ob) +void gpencil_populate_datablock(GPENCIL_e_data *e_data, + void *vedata, + Object *ob, + tGPencilObjectCache *cache_ob) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const DRWContextState *draw_ctx = DRW_context_state_get(); @@ -1967,7 +1967,7 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, /* if object is duplicate, only create shading groups */ if (cache_ob->is_dup_ob) { - DRW_gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); + gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); return; } @@ -2062,13 +2062,13 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, } /* create batchs and shading groups */ - DRW_gpencil_create_batches(cache); - DRW_gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); + gpencil_create_batches(cache); + gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); cache->is_dirty = false; } -void DRW_gpencil_populate_particles(GPENCIL_e_data *e_data, GHash *gh_objects, void *vedata) +void gpencil_populate_particles(GPENCIL_e_data *e_data, GHash *gh_objects, void *vedata) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; @@ -2084,7 +2084,7 @@ void DRW_gpencil_populate_particles(GPENCIL_e_data *e_data, GHash *gh_objects, v cache_ob->gpd = (bGPdata *)ob->data; GpencilBatchCache *cache = ob->runtime.gpencil_cache; if (cache != NULL) { - DRW_gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); + gpencil_shgroups_create(e_data, vedata, ob, cache, cache_ob); } } } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index f736034a887..b4c015b8527 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -70,7 +70,7 @@ static GPENCIL_e_data e_data = {NULL}; /* Engine data */ /* *********** FUNCTIONS *********** */ /* create a multisample buffer if not present */ -void DRW_gpencil_multisample_ensure(GPENCIL_Data *vedata, int rect_w, int rect_h) +void gpencil_multisample_ensure(GPENCIL_Data *vedata, int rect_w, int rect_h) { GPENCIL_FramebufferList *fbl = vedata->fbl; GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; @@ -114,7 +114,7 @@ static void GPENCIL_create_framebuffers(void *vedata) /* create multiframe framebuffer for AA */ if ((stl->storage->framebuffer_flag & GP_FRAMEBUFFER_MULTISAMPLE) && (stl->storage->multisamples > 0)) { - DRW_gpencil_multisample_ensure(vedata, size[0], size[1]); + gpencil_multisample_ensure(vedata, size[0], size[1]); } /* Framebufers for basic object drawing */ @@ -571,10 +571,10 @@ static void gpencil_add_draw_data(void *vedata, Object *ob) if (!cache_ob->is_dup_ob) { /* fill shading groups */ if ((!is_multiedit) || (stl->storage->is_render)) { - DRW_gpencil_populate_datablock(&e_data, vedata, ob, cache_ob); + gpencil_populate_datablock(&e_data, vedata, ob, cache_ob); } else { - DRW_gpencil_populate_multiedit(&e_data, vedata, ob, cache_ob); + gpencil_populate_multiedit(&e_data, vedata, ob, cache_ob); } } @@ -584,7 +584,7 @@ static void gpencil_add_draw_data(void *vedata, Object *ob) (BKE_shaderfx_has_gpencil(ob))) { cache_ob->has_fx = true; if ((!stl->storage->simplify_fx) && (!is_multiedit)) { - DRW_gpencil_fx_prepare(&e_data, vedata, cache_ob); + gpencil_fx_prepare(&e_data, vedata, cache_ob); } } } @@ -653,7 +653,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) bGPdata *gpd_orig = (bGPdata *)DEG_get_original_id(&gpd->id); if ((draw_ctx->obact == ob) && ((gpd_orig->runtime.ar == NULL) || (gpd_orig->runtime.ar == draw_ctx->ar))) { - DRW_gpencil_populate_buffer_strokes(&e_data, vedata, ts, ob); + gpencil_populate_buffer_strokes(&e_data, vedata, ts, ob); } /* grid */ @@ -662,7 +662,7 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_VIEW) == 0) && ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) == 0)) { - stl->g_data->batch_grid = DRW_gpencil_get_grid(ob); + stl->g_data->batch_grid = gpencil_get_grid(ob); /* define grid orientation */ switch (ts->gp_sculpt.lock_axis) { @@ -717,7 +717,7 @@ void GPENCIL_cache_finish(void *vedata) } /* draw particles */ - DRW_gpencil_populate_particles(&e_data, gh_objects, vedata); + gpencil_populate_particles(&e_data, gh_objects, vedata); /* free hash */ BLI_ghash_free(gh_objects, MEM_freeN, NULL); @@ -1098,7 +1098,7 @@ void GPENCIL_draw_scene(void *ved) /* fx passes */ if (cache_ob->has_fx == true) { stl->storage->tonemapping = 0; - DRW_gpencil_fx_draw(&e_data, vedata, cache_ob); + gpencil_fx_draw(&e_data, vedata, cache_ob); } stl->g_data->input_depth_tx = stl->g_data->temp_depth_tx_a; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index 98eaee343bb..416331e7aeb 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -397,65 +397,65 @@ typedef struct GpencilBatchCache { } GpencilBatchCache; /* general drawing functions */ -struct DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(struct GPENCIL_Data *vedata, - struct DRWPass *pass, - struct GPUShader *shader, - struct Object *ob, - struct bGPdata *gpd, - struct bGPDlayer *gpl, - struct bGPDstroke *gps, - struct MaterialGPencilStyle *gp_style, - int id, - bool onion, - const float scale, - const int shading_type[2]); -void DRW_gpencil_populate_datablock(struct GPENCIL_e_data *e_data, - void *vedata, - struct Object *ob, - struct tGPencilObjectCache *cache_ob); -void DRW_gpencil_populate_buffer_strokes(struct GPENCIL_e_data *e_data, - void *vedata, - struct ToolSettings *ts, - struct Object *ob); -void DRW_gpencil_populate_multiedit(struct GPENCIL_e_data *e_data, - void *vedata, - struct Object *ob, - struct tGPencilObjectCache *cache_ob); -void DRW_gpencil_triangulate_stroke_fill(struct Object *ob, struct bGPDstroke *gps); -void DRW_gpencil_populate_particles(struct GPENCIL_e_data *e_data, - struct GHash *gh_objects, - void *vedata); - -void DRW_gpencil_multisample_ensure(struct GPENCIL_Data *vedata, int rect_w, int rect_h); +struct DRWShadingGroup *gpencil_shgroup_stroke_create(struct GPENCIL_Data *vedata, + struct DRWPass *pass, + struct GPUShader *shader, + struct Object *ob, + struct bGPdata *gpd, + struct bGPDlayer *gpl, + struct bGPDstroke *gps, + struct MaterialGPencilStyle *gp_style, + int id, + bool onion, + const float scale, + const int shading_type[2]); +void gpencil_populate_datablock(struct GPENCIL_e_data *e_data, + void *vedata, + struct Object *ob, + struct tGPencilObjectCache *cache_ob); +void gpencil_populate_buffer_strokes(struct GPENCIL_e_data *e_data, + void *vedata, + struct ToolSettings *ts, + struct Object *ob); +void gpencil_populate_multiedit(struct GPENCIL_e_data *e_data, + void *vedata, + struct Object *ob, + struct tGPencilObjectCache *cache_ob); +void gpencil_triangulate_stroke_fill(struct Object *ob, struct bGPDstroke *gps); +void gpencil_populate_particles(struct GPENCIL_e_data *e_data, + struct GHash *gh_objects, + void *vedata); + +void gpencil_multisample_ensure(struct GPENCIL_Data *vedata, int rect_w, int rect_h); /* create geometry functions */ -void DRW_gpencil_get_point_geom(struct GpencilBatchCacheElem *be, - struct bGPDstroke *gps, - short thickness, - const float ink[4], - const int follow_mode); -void DRW_gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be, - struct bGPDstroke *gps, - short thickness, - const float ink[4]); -void DRW_gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, - struct Object *ob, - struct bGPDstroke *gps, - const float color[4]); -void DRW_gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, - struct bGPDstroke *gps, - float alpha, - short dflag); -void DRW_gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, - struct bGPDstroke *gps, - float alpha, - short dflag); - -struct GPUBatch *DRW_gpencil_get_buffer_stroke_geom(struct bGPdata *gpd, short thickness); -struct GPUBatch *DRW_gpencil_get_buffer_fill_geom(struct bGPdata *gpd); -struct GPUBatch *DRW_gpencil_get_buffer_point_geom(struct bGPdata *gpd, short thickness); -struct GPUBatch *DRW_gpencil_get_buffer_ctrlpoint_geom(struct bGPdata *gpd); -struct GPUBatch *DRW_gpencil_get_grid(Object *ob); +void gpencil_get_point_geom(struct GpencilBatchCacheElem *be, + struct bGPDstroke *gps, + short thickness, + const float ink[4], + const int follow_mode); +void gpencil_get_stroke_geom(struct GpencilBatchCacheElem *be, + struct bGPDstroke *gps, + short thickness, + const float ink[4]); +void gpencil_get_fill_geom(struct GpencilBatchCacheElem *be, + struct Object *ob, + struct bGPDstroke *gps, + const float color[4]); +void gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, + struct bGPDstroke *gps, + float alpha, + short dflag); +void gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, + struct bGPDstroke *gps, + float alpha, + short dflag); + +struct GPUBatch *gpencil_get_buffer_stroke_geom(struct bGPdata *gpd, short thickness); +struct GPUBatch *gpencil_get_buffer_fill_geom(struct bGPdata *gpd); +struct GPUBatch *gpencil_get_buffer_point_geom(struct bGPdata *gpd, short thickness); +struct GPUBatch *gpencil_get_buffer_ctrlpoint_geom(struct bGPdata *gpd); +struct GPUBatch *gpencil_get_grid(Object *ob); /* object cache functions */ struct tGPencilObjectCache *gpencil_object_cache_add(struct tGPencilObjectCache *cache_array, @@ -463,7 +463,7 @@ struct tGPencilObjectCache *gpencil_object_cache_add(struct tGPencilObjectCache int *gp_cache_size, int *gp_cache_used); -bool DRW_gpencil_onion_active(struct bGPdata *gpd); +bool gpencil_onion_active(struct bGPdata *gpd); /* shading groups cache functions */ struct GpencilBatchGroup *gpencil_group_cache_add(struct GpencilBatchGroup *cache_array, @@ -484,12 +484,12 @@ void GPENCIL_create_fx_shaders(struct GPENCIL_e_data *e_data); void GPENCIL_delete_fx_shaders(struct GPENCIL_e_data *e_data); void GPENCIL_create_fx_passes(struct GPENCIL_PassList *psl); -void DRW_gpencil_fx_prepare(struct GPENCIL_e_data *e_data, - struct GPENCIL_Data *vedata, - struct tGPencilObjectCache *cache_ob); -void DRW_gpencil_fx_draw(struct GPENCIL_e_data *e_data, - struct GPENCIL_Data *vedata, - struct tGPencilObjectCache *cache_ob); +void gpencil_fx_prepare(struct GPENCIL_e_data *e_data, + struct GPENCIL_Data *vedata, + struct tGPencilObjectCache *cache_ob); +void gpencil_fx_draw(struct GPENCIL_e_data *e_data, + struct GPENCIL_Data *vedata, + struct tGPencilObjectCache *cache_ob); /* main functions */ void GPENCIL_engine_init(void *vedata); diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index d189ccd322d..bdb6d51ca19 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -77,7 +77,7 @@ void GPENCIL_render_init(GPENCIL_Data *ved, RenderEngine *engine, struct Depsgra if (U.gpencil_multisamples > 0) { int rect_w = (int)viewport_size[0]; int rect_h = (int)viewport_size[1]; - DRW_gpencil_multisample_ensure(vedata, rect_w, rect_h); + gpencil_multisample_ensure(vedata, rect_w, rect_h); } vedata->render_depth_tx = DRW_texture_pool_query_2d( diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c index 2f0ce930f24..306444303e2 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c @@ -132,11 +132,11 @@ static void GPENCIL_dof_nearfar(Object *camera, float coc, float nearfar[2]) * The effect is done using two shading groups because is faster to apply horizontal * and vertical in different operations. */ -static void DRW_gpencil_fx_blur(ShaderFxData *fx, - int ob_idx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_blur(ShaderFxData *fx, + int ob_idx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -215,7 +215,7 @@ static void DRW_gpencil_fx_blur(ShaderFxData *fx, } /* Colorize FX */ -static void DRW_gpencil_fx_colorize(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) +static void gpencil_fx_colorize(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) { if (fx == NULL) { return; @@ -239,7 +239,7 @@ static void DRW_gpencil_fx_colorize(ShaderFxData *fx, GPENCIL_e_data *e_data, GP } /* Flip FX */ -static void DRW_gpencil_fx_flip(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) +static void gpencil_fx_flip(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) { if (fx == NULL) { return; @@ -271,10 +271,10 @@ static void DRW_gpencil_fx_flip(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCI } /* Light FX */ -static void DRW_gpencil_fx_light(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_light(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -325,10 +325,10 @@ static void DRW_gpencil_fx_light(ShaderFxData *fx, } /* Pixelate FX */ -static void DRW_gpencil_fx_pixel(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_pixel(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -359,10 +359,10 @@ static void DRW_gpencil_fx_pixel(ShaderFxData *fx, } /* Rim FX */ -static void DRW_gpencil_fx_rim(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_rim(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -421,10 +421,10 @@ static void DRW_gpencil_fx_rim(ShaderFxData *fx, } /* Shadow FX */ -static void DRW_gpencil_fx_shadow(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_shadow(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -505,10 +505,10 @@ static void DRW_gpencil_fx_shadow(ShaderFxData *fx, } /* Glow FX */ -static void DRW_gpencil_fx_glow(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_glow(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -564,10 +564,10 @@ static void DRW_gpencil_fx_glow(ShaderFxData *fx, } /* Swirl FX */ -static void DRW_gpencil_fx_swirl(ShaderFxData *fx, - GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache) +static void gpencil_fx_swirl(ShaderFxData *fx, + GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache) { if (fx == NULL) { return; @@ -605,7 +605,7 @@ static void DRW_gpencil_fx_swirl(ShaderFxData *fx, } /* Wave Distorsion FX */ -static void DRW_gpencil_fx_wave(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) +static void gpencil_fx_wave(ShaderFxData *fx, GPENCIL_e_data *e_data, GPENCIL_Data *vedata) { if (fx == NULL) { return; @@ -717,9 +717,9 @@ void GPENCIL_create_fx_passes(GPENCIL_PassList *psl) } /* prepare fx shading groups */ -void DRW_gpencil_fx_prepare(GPENCIL_e_data *e_data, - GPENCIL_Data *vedata, - tGPencilObjectCache *cache_ob) +void gpencil_fx_prepare(GPENCIL_e_data *e_data, + GPENCIL_Data *vedata, + tGPencilObjectCache *cache_ob) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const bool wiremode = (bool)(cache_ob->shading_type[0] == OB_WIRE); @@ -734,34 +734,34 @@ void DRW_gpencil_fx_prepare(GPENCIL_e_data *e_data, if (effect_is_active(cache_ob->gpd, fx, stl->storage->is_render)) { switch (fx->type) { case eShaderFxType_Blur: - DRW_gpencil_fx_blur(fx, ob_idx, e_data, vedata, cache_ob); + gpencil_fx_blur(fx, ob_idx, e_data, vedata, cache_ob); break; case eShaderFxType_Colorize: - DRW_gpencil_fx_colorize(fx, e_data, vedata); + gpencil_fx_colorize(fx, e_data, vedata); break; case eShaderFxType_Flip: - DRW_gpencil_fx_flip(fx, e_data, vedata); + gpencil_fx_flip(fx, e_data, vedata); break; case eShaderFxType_Light: - DRW_gpencil_fx_light(fx, e_data, vedata, cache_ob); + gpencil_fx_light(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Pixel: - DRW_gpencil_fx_pixel(fx, e_data, vedata, cache_ob); + gpencil_fx_pixel(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Rim: - DRW_gpencil_fx_rim(fx, e_data, vedata, cache_ob); + gpencil_fx_rim(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Shadow: - DRW_gpencil_fx_shadow(fx, e_data, vedata, cache_ob); + gpencil_fx_shadow(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Glow: - DRW_gpencil_fx_glow(fx, e_data, vedata, cache_ob); + gpencil_fx_glow(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Swirl: - DRW_gpencil_fx_swirl(fx, e_data, vedata, cache_ob); + gpencil_fx_swirl(fx, e_data, vedata, cache_ob); break; case eShaderFxType_Wave: - DRW_gpencil_fx_wave(fx, e_data, vedata); + gpencil_fx_wave(fx, e_data, vedata); break; default: break; @@ -996,9 +996,9 @@ static void draw_gpencil_glow_passes(GPENCIL_Data *vedata, GlowShaderFxData *fxd } /* apply all object fx effects */ -void DRW_gpencil_fx_draw(GPENCIL_e_data *UNUSED(e_data), - GPENCIL_Data *vedata, - tGPencilObjectCache *cache_ob) +void gpencil_fx_draw(GPENCIL_e_data *UNUSED(e_data), + GPENCIL_Data *vedata, + tGPencilObjectCache *cache_ob) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; |