Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarley Acheson <harley.acheson@gmail.com>2021-08-25 23:30:00 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-08-25 23:30:00 +0300
commit5b751c95f4e58c5f56b1af61c835b4537f19f43c (patch)
tree139e884c0d42c20af4394c893a3e8d5904371e9b /source/blender/editors
parent518b97e674a9e7cdc91bc4048a89eb8a8b37db0b (diff)
BLF: Remove ASCII-only Code Paths
Remove redundant code for drawing text strings that contain only ASCII. See D12293 for much more detail. Differential Revision: https://developer.blender.org/D12293 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/view2d_draw.c4
-rw-r--r--source/blender/editors/space_image/image_draw.c30
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c2
-rw-r--r--source/blender/editors/transform/transform.c4
-rw-r--r--source/blender/editors/transform/transform_ops.c3
6 files changed, 22 insertions, 31 deletions
diff --git a/source/blender/editors/interface/view2d_draw.c b/source/blender/editors/interface/view2d_draw.c
index 95427e49495..fd4dba30c1c 100644
--- a/source/blender/editors/interface/view2d_draw.c
+++ b/source/blender/editors/interface/view2d_draw.c
@@ -349,7 +349,7 @@ static void draw_horizontal_scale_indicators(const ARegion *region,
const float text_width = BLF_width(font_id, text, strlen(text));
if (xpos_region - text_width / 2.0f >= xmin && xpos_region + text_width / 2.0f <= xmax) {
- BLF_draw_default_ascii(xpos_region - text_width / 2.0f, ypos, 0.0f, text, sizeof(text));
+ BLF_draw_default(xpos_region - text_width / 2.0f, ypos, 0.0f, text, sizeof(text));
}
}
}
@@ -411,7 +411,7 @@ static void draw_vertical_scale_indicators(const ARegion *region,
const float text_width = BLF_width(font_id, text, strlen(text));
if (ypos_region - text_width / 2.0f >= ymin && ypos_region + text_width / 2.0f <= ymax) {
- BLF_draw_default_ascii(xpos, ypos_region - text_width / 2.0f, 0.0f, text, sizeof(text));
+ BLF_draw_default(xpos, ypos_region - text_width / 2.0f, 0.0f, text, sizeof(text));
}
}
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 92ceb00d5c0..4f66506d28b 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -196,21 +196,21 @@ void ED_image_draw_info(Scene *scene,
BLF_color3ub(blf_mono_font, 255, 255, 255);
SNPRINTF(str, "X:%-4d Y:%-4d |", x, y);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
if (zp) {
BLF_color3ub(blf_mono_font, 255, 255, 255);
SNPRINTF(str, " Z:%-.4f |", 0.5f + 0.5f * (((float)*zp) / (float)0x7fffffff));
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
}
if (zpf) {
BLF_color3ub(blf_mono_font, 255, 255, 255);
SNPRINTF(str, " Z:%-.3f |", *zpf);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
}
@@ -223,7 +223,7 @@ void ED_image_draw_info(Scene *scene,
}
BLF_color3ub(blf_mono_font, 255, 255, 255);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
}
@@ -239,7 +239,7 @@ void ED_image_draw_info(Scene *scene,
STRNCPY(str, " R:-");
}
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
BLF_color3ubv(blf_mono_font, green);
@@ -253,7 +253,7 @@ void ED_image_draw_info(Scene *scene,
STRNCPY(str, " G:-");
}
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
BLF_color3ubv(blf_mono_font, blue);
@@ -267,7 +267,7 @@ void ED_image_draw_info(Scene *scene,
STRNCPY(str, " B:-");
}
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
if (channels == 4) {
@@ -282,7 +282,7 @@ void ED_image_draw_info(Scene *scene,
STRNCPY(str, "- ");
}
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
}
@@ -307,7 +307,7 @@ void ED_image_draw_info(Scene *scene,
SNPRINTF(str, " | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
}
}
@@ -429,12 +429,12 @@ void ED_image_draw_info(Scene *scene,
SNPRINTF(str, "V:%-.4f", val);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
SNPRINTF(str, " L:%-.4f", lum);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
}
else if (channels >= 3) {
rgb_to_hsv(finalcol[0], finalcol[1], finalcol[2], &hue, &sat, &val);
@@ -442,22 +442,22 @@ void ED_image_draw_info(Scene *scene,
SNPRINTF(str, "H:%-.4f", hue);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
SNPRINTF(str, " S:%-.4f", sat);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
SNPRINTF(str, " V:%-.4f", val);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str, sizeof(str));
SNPRINTF(str, " L:%-.4f", lum);
BLF_position(blf_mono_font, dx, dy, 0);
- BLF_draw_ascii(blf_mono_font, str, sizeof(str));
+ BLF_draw(blf_mono_font, str, sizeof(str));
}
}
void draw_image_sample_line(SpaceImage *sima)
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ec99affe43b..86f79718a68 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1020,7 +1020,7 @@ static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
const char axis_text[2] = {'x' + i, '\0'};
BLF_color4ubv(BLF_default(), axis_col[i]);
- BLF_draw_default_ascii(axis_pos[i][0] + 2, axis_pos[i][1] + 2, 0.0f, axis_text, 1);
+ BLF_draw_default(axis_pos[i][0] + 2, axis_pos[i][1] + 2, 0.0f, axis_text, 1);
}
}
@@ -1458,9 +1458,7 @@ static void draw_grid_unit_name(
BLF_enable(font_id, BLF_SHADOW);
BLF_shadow(font_id, 5, (const float[4]){0.0f, 0.0f, 0.0f, 1.0f});
BLF_shadow_offset(font_id, 1, -1);
- BLF_draw_default_ascii(
- xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit, sizeof(numstr));
-
+ BLF_draw_default(xoffset, *yoffset, 0.0f, numstr[0] ? numstr : grid_unit, sizeof(numstr));
BLF_disable(font_id, BLF_SHADOW);
}
}
@@ -2548,11 +2546,7 @@ void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset)
*yoffset -= VIEW3D_OVERLAY_LINEHEIGHT;
-#ifdef WITH_INTERNATIONAL
BLF_draw_default(xoffset, *yoffset, 0.0f, printable, sizeof(printable));
-#else
- BLF_draw_default_ascii(xoffset, *yoffset, 0.0f, printable, sizeof(printable));
-#endif
BLF_disable(font_id, BLF_SHADOW);
}
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index 05ea35f114f..baa54adaa83 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -300,7 +300,7 @@ static void gizmo_axis_draw(const bContext *C, wmGizmo *gz)
text_color[3] = is_active ? 1.0f : 0.9f;
}
BLF_color4fv(font.id, text_color);
- BLF_draw_ascii(font.id, axis_str, 2);
+ BLF_draw(font.id, axis_str, 2);
GPU_matrix_pop();
}
}
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 7a83fb71c28..7287927a0be 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1372,11 +1372,7 @@ static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *region)
uchar color[3];
UI_GetThemeColorShade3ubv(TH_TEXT_HI, -50, color);
BLF_color3ubv(font_id, color);
-#ifdef WITH_INTERNATIONAL
BLF_draw_default(xco, yco, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
-#else
- BLF_draw_default_ascii(xco, yco, 0.0f, printable, BLF_DRAW_STR_DUMMY_MAX);
-#endif
/* autokey recording icon... */
GPU_blend(GPU_BLEND_ALPHA);
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index cbc2adf641f..9638ec8750e 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -710,7 +710,8 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
}
if (flags & P_VIEW2D_EDGE_PAN) {
- prop = RNA_def_boolean(ot->srna, "view2d_edge_pan", false, "Edge Pan", "Enable edge panning in 2D view");
+ prop = RNA_def_boolean(
+ ot->srna, "view2d_edge_pan", false, "Edge Pan", "Enable edge panning in 2D view");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
}