[Bf-blender-cvs] [6d359e44988] blender2.8: Cleanup: use explicit 2d suffix for imm utils
Campbell Barton
noreply at git.blender.org
Wed Sep 13 17:16:44 CEST 2017
Commit: 6d359e4498848d795b8043e923850d0a0da7f4ed
Author: Campbell Barton
Date: Thu Sep 14 00:39:28 2017 +1000
Branches: blender2.8
https://developer.blender.org/rB6d359e4498848d795b8043e923850d0a0da7f4ed
Cleanup: use explicit 2d suffix for imm utils
Avoid ambiguity between 2d/3d (which were already named).
===================================================================
M source/blender/editors/gpencil/gpencil_brush.c
M source/blender/editors/gpencil/gpencil_paint.c
M source/blender/editors/interface/interface_draw.c
M source/blender/editors/interface/interface_widgets.c
M source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
M source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
M source/blender/editors/physics/particle_edit.c
M source/blender/editors/screen/area.c
M source/blender/editors/screen/screendump.c
M source/blender/editors/sculpt_paint/paint_cursor.c
M source/blender/editors/sculpt_paint/sculpt_uv.c
M source/blender/editors/space_clip/clip_draw.c
M source/blender/editors/space_clip/clip_graph_draw.c
M source/blender/editors/space_file/file_draw.c
M source/blender/editors/space_image/image_draw.c
M source/blender/editors/space_nla/nla_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/drawobject.c
M source/blender/editors/space_view3d/view3d_draw.c
M source/blender/editors/space_view3d/view3d_draw_legacy.c
M source/blender/editors/space_view3d/view3d_ruler.c
M source/blender/gpu/GPU_immediate_util.h
M source/blender/gpu/intern/gpu_immediate_util.c
M source/blender/windowmanager/intern/wm_gesture.c
M source/blender/windowmanager/intern/wm_operators.c
M source/blender/windowmanager/intern/wm_playanim.c
===================================================================
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index ea21aa81d3d..1cee8db792a 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -991,11 +991,11 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customda
/* Inner Ring: Light color for action of the brush */
/* TODO: toggle between add and remove? */
immUniformColor4ub(255, 255, 255, 200);
- imm_draw_circle_wire(pos, x, y, brush->size, 40);
+ imm_draw_circle_wire_2d(pos, x, y, brush->size, 40);
/* Outer Ring: Dark color for contrast on light backgrounds (e.g. gray on white) */
immUniformColor3ub(30, 30, 30);
- imm_draw_circle_wire(pos, x, y, brush->size + 1, 40);
+ imm_draw_circle_wire_2d(pos, x, y, brush->size + 1, 40);
immUnbindProgram();
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index ffad8da84ff..e0751985bcd 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1865,7 +1865,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
immUniformColor4ub(255, 100, 100, 20);
- imm_draw_circle_fill(shdr_pos, x, y, p->radius, 40);
+ imm_draw_circle_fill_2d(shdr_pos, x, y, p->radius, 40);
immUnbindProgram();
@@ -1880,7 +1880,7 @@ static void gpencil_draw_eraser(bContext *UNUSED(C), int x, int y, void *p_ptr)
immUniform1f("dash_width", 12.0f);
immUniform1f("dash_factor", 0.5f);
- imm_draw_circle_wire(shdr_pos, x, y, p->radius,
+ imm_draw_circle_wire_2d(shdr_pos, x, y, p->radius,
/* XXX Dashed shader gives bad results with sets of small segments currently,
* temp hack around the issue. :( */
max_ii(8, p->radius / 2)); /* was fixed 40 */
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index bdedb265d73..25a7fbd09ef 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -604,7 +604,7 @@ void UI_draw_safe_areas(
float maxx = x2 - margin_x;
float maxy = y2 - margin_y;
- imm_draw_line_box(pos, minx, miny, maxx, maxy);
+ imm_draw_line_box_2d(pos, minx, miny, maxx, maxy);
}
}
}
@@ -1377,7 +1377,7 @@ void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti
/* layer: box outline */
immUniformColor4f(0.0f, 0.0f, 0.0f, 1.0f);
- imm_draw_line_box(position, x1, y1, x1 + sizex, rect->ymax);
+ imm_draw_line_box_2d(position, x1, y1, x1 + sizex, rect->ymax);
/* layer: box outline */
glEnable(GL_BLEND);
@@ -1460,7 +1460,7 @@ void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
- imm_draw_circle_wire(pos, 0.0f, 0.0f, 1.0f, 32);
+ imm_draw_circle_wire_2d(pos, 0.0f, 0.0f, 1.0f, 32);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
@@ -1717,7 +1717,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3ubv((unsigned char *)wcol->outline);
- imm_draw_line_box(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
+ imm_draw_line_box_2d(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
immUnbindProgram();
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 73e549e703b..74ea8c60427 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -2272,12 +2272,12 @@ static void ui_hsv_cursor(float x, float y)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3f(1.0f, 1.0f, 1.0f);
- imm_draw_circle_fill(pos, x, y, 3.0f * U.pixelsize, 8);
+ imm_draw_circle_fill_2d(pos, x, y, 3.0f * U.pixelsize, 8);
glEnable(GL_BLEND);
glEnable(GL_LINE_SMOOTH);
immUniformColor3f(0.0f, 0.0f, 0.0f);
- imm_draw_circle_wire(pos, x, y, 3.0f * U.pixelsize, 12);
+ imm_draw_circle_wire_2d(pos, x, y, 3.0f * U.pixelsize, 12);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
@@ -2397,7 +2397,7 @@ static void ui_draw_but_HSVCIRCLE(uiBut *but, uiWidgetColors *wcol, const rcti *
glEnable(GL_LINE_SMOOTH);
immUniformColor3ubv((unsigned char *)wcol->outline);
- imm_draw_circle_wire(pos, centx, centy, radius, tot);
+ imm_draw_circle_wire_2d(pos, centx, centy, radius, tot);
immUnbindProgram();
@@ -2637,7 +2637,7 @@ static void ui_draw_but_HSVCUBE(uiBut *but, const rcti *rect)
unsigned int pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor3ub(0, 0, 0);
- imm_draw_line_box(pos, (rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax));
+ imm_draw_line_box_2d(pos, (rect->xmin), (rect->ymin), (rect->xmax), (rect->ymax));
immUnbindProgram();
}
@@ -4172,8 +4172,8 @@ void ui_draw_pie_center(uiBlock *block)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4ubv((unsigned char *)btheme->tui.wcol_pie_menu.outline);
- imm_draw_circle_wire(pos, 0.0f, 0.0f, pie_radius_internal, subd);
- imm_draw_circle_wire(pos, 0.0f, 0.0f, pie_radius_external, subd);
+ imm_draw_circle_wire_2d(pos, 0.0f, 0.0f, pie_radius_internal, subd);
+ imm_draw_circle_wire_2d(pos, 0.0f, 0.0f, pie_radius_external, subd);
immUnbindProgram();
diff --git a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
index f637b098cca..0769d128b4d 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/dial3d_manipulator.c
@@ -140,10 +140,10 @@ static void dial_geom_draw(
immUniformColor4fv(color);
if (filled) {
- imm_draw_circle_fill(pos, 0, 0, 1.0, DIAL_RESOLUTION);
+ imm_draw_circle_fill_2d(pos, 0, 0, 1.0, DIAL_RESOLUTION);
}
else {
- imm_draw_circle_wire(pos, 0, 0, 1.0, DIAL_RESOLUTION);
+ imm_draw_circle_wire_2d(pos, 0, 0, 1.0, DIAL_RESOLUTION);
}
immUnbindProgram();
@@ -187,7 +187,7 @@ static void dial_ghostarc_draw(
uint pos = GWN_vertformat_attr_add(format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv(color);
- imm_draw_disk_partial_fill(
+ imm_draw_disk_partial_fill_2d(
pos, 0, 0, 0.0, width_inner, DIAL_RESOLUTION, RAD2DEGF(angle_ofs), RAD2DEGF(angle_delta));
immUnbindProgram();
}
diff --git a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
index fd1f5a0cf25..5353104a1fd 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/grab3d_manipulator.c
@@ -115,10 +115,10 @@ static void grab_geom_draw(
if (draw_style == ED_MANIPULATOR_GRAB_STYLE_RING_2D) {
if (filled) {
- imm_draw_circle_fill(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
+ imm_draw_circle_fill_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
}
else {
- imm_draw_circle_wire(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
+ imm_draw_circle_wire_2d(pos, 0, 0, 1.0f, DIAL_RESOLUTION);
}
}
else if (draw_style == ED_MANIPULATOR_GRAB_STYLE_CROSS_2D) {
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 171c5f4ed30..6a5a3c73f81 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -2746,7 +2746,7 @@ static void brush_drawcursor(bContext *C, int x, int y, void *UNUSED(customdata)
glEnable(GL_LINE_SMOOTH);
glEnable(GL_BLEND);
- imm_draw_circle_wire(pos, (float)x, (float)y, pe_brush_size_get(scene, brush), 40);
+ imm_draw_circle_wire_2d(pos, (float)x, (float)y, pe_brush_size_get(scene, brush), 40);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 5eb51667988..8fa6a363230 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -228,7 +228,7 @@ static void area_draw_azone_fullscreen(short x1, short y1, short x2, short y2, f
immAttrib4ub(color, 255, 0, 0, alpha_debug);
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
- imm_draw_line_box(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
+ imm_draw_line_box_2d(pos, click_rect.xmin, click_rect.ymin, click_rect.xmax, click_rect.ymax);
immAttrib4ub(color, 0, 255, 255, alpha_debug);
immBegin(GWN_PRIM_LINES, 4);
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 6fa8905293c..69891a727d4 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -462,10 +462,10 @@ static void screencast_draw_cursor(bContext *UNUSED(C), int x, int y, void *UNUS
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformColor4ub(0, 0, 0, 32);
- imm_draw_circle_fill(pos, (float)x, (float)y, 20, 40);
+ imm_draw_circle_fill_2d(pos, (float)x, (float)y, 20, 40);
immUniformColor4ub(255, 255, 255, 128);
- imm_draw_circle_wire(pos, (float)x, (float)y, 20, 40);
+ imm_draw_circle_wire_2d(pos, (float)x, (float)y, 20, 40);
immUnbindProgram();
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index a9b4df81277..36f7eadea1e 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -849,12 +849,12 @@ BLI_INLINE void draw_rect_point(
float maxx = co[0] + w;
float maxy = co[1] + w;
- imm_draw_line_box(pos, minx, miny, maxx, maxy);
+ imm_draw_line_box_2d(pos, minx, min
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list