diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-17 09:14:07 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-17 10:04:28 +0400 |
commit | 3e3efae7e9420817a6fe35545d97568a69e2ce7c (patch) | |
tree | b6702eea72f629be453795e317fbcc22c3692535 /source/blender/editors/space_view3d/drawarmature.c | |
parent | 1b9db9911d9cbcb81d58277084b9c4c5daf84e8a (diff) |
Viewport Text Drawing: replace single allocs with a memarena
- pass label strlen since in many cases its already known.
- use single linked list for cached text drawing.
- add BLI_link_utils.h for single linked list macros.
own tests give approx 22% overall speedup.
Diffstat (limited to 'source/blender/editors/space_view3d/drawarmature.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 4a2fd5f7004..5863416f451 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -2065,7 +2065,7 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* Draw names of bone */ if (arm->flag & ARM_DRAWNAMES) { mid_v3_v3v3(vec, pchan->pose_head, pchan->pose_tail); - view3d_cached_text_draw_add(vec, pchan->name, 10, 0, col); + view3d_cached_text_draw_add(vec, pchan->name, strlen(pchan->name), 10, 0, col); } /* Draw additional axes on the bone tail */ @@ -2270,7 +2270,7 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt) if (arm->flag & ARM_DRAWNAMES) { mid_v3_v3v3(vec, eBone->head, eBone->tail); glRasterPos3fv(vec); - view3d_cached_text_draw_add(vec, eBone->name, 10, 0, col); + view3d_cached_text_draw_add(vec, eBone->name, strlen(eBone->name), 10, 0, col); } /* Draw additional axes */ if (arm->flag & ARM_DRAWAXES) { |