[Bf-blender-cvs] [e7218e70499] blender2.8: Cleanup: naming
Campbell Barton
noreply at git.blender.org
Tue Oct 9 02:03:27 CEST 2018
Commit: e7218e7049972053140d94410aea75e0c3e87c61
Author: Campbell Barton
Date: Tue Oct 9 11:01:50 2018 +1100
Branches: blender2.8
https://developer.blender.org/rBe7218e7049972053140d94410aea75e0c3e87c61
Cleanup: naming
- immAttrib* -> immAttr*
- immSkipAttrib -> immAttrSkip
Term 'attr' is a convention for GPU module.
===================================================================
M source/blender/draw/intern/draw_debug.c
M source/blender/draw/intern/draw_manager.c
M source/blender/draw/intern/draw_view.c
M source/blender/editors/animation/keyframes_draw.c
M source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
M source/blender/editors/gpencil/annotate_draw.c
M source/blender/editors/gpencil/drawgpencil.c
M source/blender/editors/gpencil/gpencil_fill.c
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_panel.c
M source/blender/editors/interface/interface_widgets.c
M source/blender/editors/interface/view2d.c
M source/blender/editors/screen/area.c
M source/blender/editors/screen/glutil.c
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/space_clip/clip_dopesheet_draw.c
M source/blender/editors/space_clip/clip_draw.c
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_graph/graph_draw.c
M source/blender/editors/space_node/node_draw.c
M source/blender/editors/space_sequencer/sequencer_draw.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/gpu/GPU_immediate.h
M source/blender/gpu/intern/gpu_immediate.c
M source/blender/gpu/intern/gpu_immediate_util.c
M source/blender/windowmanager/intern/wm_operators.c
M source/blender/windowmanager/intern/wm_stereo.c
===================================================================
diff --git a/source/blender/draw/intern/draw_debug.c b/source/blender/draw/intern/draw_debug.c
index 053d266ec34..366da92cf50 100644
--- a/source/blender/draw/intern/draw_debug.c
+++ b/source/blender/draw/intern/draw_debug.c
@@ -161,10 +161,10 @@ static void drw_debug_draw_lines(void)
while (DST.debug.lines) {
void *next = DST.debug.lines->next;
- immAttrib4fv(col, DST.debug.lines->color);
+ immAttr4fv(col, DST.debug.lines->color);
immVertex3fv(pos, DST.debug.lines->pos[0]);
- immAttrib4fv(col, DST.debug.lines->color);
+ immAttr4fv(col, DST.debug.lines->color);
immVertex3fv(pos, DST.debug.lines->pos[1]);
MEM_freeN(DST.debug.lines);
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index f987220e575..163b89e9152 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -270,13 +270,13 @@ void DRW_transform_to_display(GPUTexture *tex, bool use_view_settings)
/* Full screen triangle */
immBegin(GPU_PRIM_TRIS, 3);
- immAttrib2f(texco, 0.0f, 0.0f);
+ immAttr2f(texco, 0.0f, 0.0f);
immVertex2f(pos, -1.0f, -1.0f);
- immAttrib2f(texco, 2.0f, 0.0f);
+ immAttr2f(texco, 2.0f, 0.0f);
immVertex2f(pos, 3.0f, -1.0f);
- immAttrib2f(texco, 0.0f, 2.0f);
+ immAttr2f(texco, 0.0f, 2.0f);
immVertex2f(pos, -1.0f, 3.0f);
immEnd();
@@ -2201,16 +2201,16 @@ static void draw_depth_texture_to_screen(GPUTexture *texture)
immBegin(GPU_PRIM_TRI_STRIP, 4);
- immAttrib2f(texcoord, 0.0f, 0.0f);
+ immAttr2f(texcoord, 0.0f, 0.0f);
immVertex2f(pos, 0.0f, 0.0f);
- immAttrib2f(texcoord, 1.0f, 0.0f);
+ immAttr2f(texcoord, 1.0f, 0.0f);
immVertex2f(pos, w, 0.0f);
- immAttrib2f(texcoord, 0.0f, 1.0f);
+ immAttr2f(texcoord, 0.0f, 1.0f);
immVertex2f(pos, 0.0f, h);
- immAttrib2f(texcoord, 1.0f, 1.0f);
+ immAttr2f(texcoord, 1.0f, 1.0f);
immVertex2f(pos, w, h);
immEnd();
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index d77620bc47b..545c4af878c 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -108,11 +108,11 @@ void DRW_draw_background(void)
UI_GetThemeColor3ubv(TH_HIGH_GRAD, col_hi);
immBegin(GPU_PRIM_TRI_FAN, 4);
- immAttrib3ubv(color, col_lo);
+ immAttr3ubv(color, col_lo);
immVertex2f(pos, -1.0f, -1.0f);
immVertex2f(pos, 1.0f, -1.0f);
- immAttrib3ubv(color, col_hi);
+ immAttr3ubv(color, col_hi);
immVertex2f(pos, 1.0f, 1.0f);
immVertex2f(pos, -1.0f, 1.0f);
immEnd();
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index a8b63e01ac1..8c3ecef5ae8 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -552,9 +552,9 @@ void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type,
}
}
- immAttrib1f(size_id, size);
- immAttrib4ubv(color_id, fill_col);
- immAttrib4ubv(outline_color_id, outline_col);
+ immAttr1f(size_id, size);
+ immAttr4ubv(color_id, fill_col);
+ immAttr4ubv(outline_color_id, outline_col);
immVertex2f(pos_id, x, y);
}
diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
index 0646d689812..04015ee9f1e 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c
@@ -413,7 +413,7 @@ static void cage2d_draw_box_interaction(
if (is_solid) {
BLI_assert(ELEM(prim_type, GPU_PRIM_TRI_FAN));
immBegin(prim_type, verts_len);
- immAttrib3f(attr_id.col, 0.0f, 0.0f, 0.0f);
+ immAttr3f(attr_id.col, 0.0f, 0.0f, 0.0f);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}
@@ -424,7 +424,7 @@ static void cage2d_draw_box_interaction(
GPU_line_width(line_width + 3.0f);
immBegin(prim_type, verts_len);
- immAttrib3f(attr_id.col, 0.0f, 0.0f, 0.0f);
+ immAttr3f(attr_id.col, 0.0f, 0.0f, 0.0f);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}
@@ -433,7 +433,7 @@ static void cage2d_draw_box_interaction(
GPU_line_width(line_width);
immBegin(prim_type, verts_len);
- immAttrib3fv(attr_id.col, color);
+ immAttr3fv(attr_id.col, color);
for (uint i = 0; i < verts_len; i++) {
immVertex2fv(attr_id.pos, verts[i]);
}
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index 0bb14a103f6..47c0b2283ba 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -664,21 +664,21 @@ static void gp_draw_strokes_edit(
/* size and color first */
if (show_direction_hint && i == 0) {
/* start point in green bigger */
- immAttrib3f(color, 0.0f, 1.0f, 0.0f);
- immAttrib1f(size, vsize + 4);
+ immAttr3f(color, 0.0f, 1.0f, 0.0f);
+ immAttr1f(size, vsize + 4);
}
else if (show_direction_hint && (i == gps->totpoints - 1)) {
/* end point in red smaller */
- immAttrib3f(color, 1.0f, 0.0f, 0.0f);
- immAttrib1f(size, vsize + 1);
+ immAttr3f(color, 1.0f, 0.0f, 0.0f);
+ immAttr1f(size, vsize + 1);
}
else if (pt->flag & GP_SPOINT_SELECT) {
- immAttrib3fv(color, selectColor);
- immAttrib1f(size, vsize);
+ immAttr3fv(color, selectColor);
+ immAttr1f(size, vsize);
}
else {
- immAttrib3fv(color, gpl->color);
- immAttrib1f(size, bsize);
+ immAttr3fv(color, gpl->color);
+ immAttr1f(size, bsize);
}
/* then position */
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 51d33c0238e..eba793a37d0 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -118,7 +118,7 @@ static void gp_set_tpoint_varying_color(const tGPspoint *pt, const float ink[4],
{
float alpha = ink[3] * pt->strength;
CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
- immAttrib4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
+ immAttr4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
}
static void gp_set_point_uniform_color(const bGPDspoint *pt, const float ink[4])
@@ -132,7 +132,7 @@ static void gp_set_point_varying_color(const bGPDspoint *pt, const float ink[4],
{
float alpha = ink[3] * pt->strength;
CLAMP(alpha, GPENCIL_STRENGTH_MIN, 1.0f);
- immAttrib4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
+ immAttr4ub(attr_id, F2UB(ink[0]), F2UB(ink[1]), F2UB(ink[2]), F2UB(alpha));
}
/* draw fills for buffer stroke */
@@ -340,7 +340,7 @@ static void gp_draw_stroke_volumetric_buffer(const tGPspoint *points, int totpoi
const tGPspoint *pt = points;
for (int i = 0; i < totpoints; i++, pt++) {
gp_set_tpoint_varying_color(pt, ink, color);
- immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */
+ immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */
immVertex2f(pos, pt->x, pt->y);
}
@@ -374,7 +374,7 @@ static void gp_draw_stroke_volumetric_2d(const bGPDspoint *points, int totpoints
gp_calc_2d_stroke_fxy(fpt, sflag, offsx, offsy, winx, winy, co);
gp_set_point_varying_color(pt, ink, color);
- immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
+ immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immVertex2f(pos, co[0], co[1]);
}
@@ -400,7 +400,7 @@ static void gp_draw_stroke_volumetric_3d(
const bGPDspoint *pt = points;
for (int i = 0; i < totpoints && pt; i++, pt++) {
gp_set_point_varying_color(pt, ink, color);
- immAttrib1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
+ immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
immVertex3fv(pos, &pt->x); /* we can adjust size in vertex shader based on view/projection! */
}
@@ -580,7 +580,7 @@ static void gp_add_filldata_tobuffer(
fpt[2] = 0.0f; /* 2d always is z=0.0f */
}
- immAttrib2f(texcoord, uv[0], uv[1]); /* texture coordinates */
+ immAttr2f(texcoord, uv[0], uv[1]); /* texture coordinates */
immVertex3fv(pos, fpt); /* position */
}
@@ -764,7 +764,7 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
/* first point for adjacency (not drawn) */
if (i == 0) {
gp_set_point_varying_color(points, ink, attr_id.color);
- immAttrib1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
if ((cyclic) && (totpoints > 2)) {
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + totpoints - 1)->x);
}
@@ -776,7 +776,7 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
}
/* set point */
gp_set_point_varying_color(pt, ink, attr_id.color);
- immAttrib1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff(curpressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &pt->x);
immVertex3fv(attr_id.pos, fpt);
@@ -785,19 +785,19 @@ static void gp_draw_stroke_3d(tGPDdraw *tgpw, short thickness, const float ink[4
if (cyclic && totpoints > 2) {
/* draw line to first point to complete the cycle */
- immAttrib1f(attr_id.thickness, max_ff(points->pressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff(points->pressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &points->x);
immVertex3fv(attr_id.pos, fpt);
/* now add adjacency point (not drawn) */
- immAttrib1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f));
+ immAttr1f(attr_id.thickness, max_ff((points + 1)->pressure * thickness, 1.0f));
mul_v3_m4v3(fpt, tgpw->diff_mat, &(points + 1)->x);
immVertex3fv(attr_id.pos, fpt);
}
/* last adjacency point (not drawn) */
else {
gp_set_point_varying_color(points + totpoints - 1, ink, attr_id.color);
- immAttrib1f(attr_id.thickness, max_ff(curpressu
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list