diff options
author | Ton Roosendaal <ton@blender.org> | 2009-06-01 20:22:53 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2009-06-01 20:22:53 +0400 |
commit | cb96aa47dbcefa8be8db63dc8fc2607b16b2d5d1 (patch) | |
tree | da0a2de7e32c2bc47423d4f448ff48b12acf807f /source/blender/editors/include/UI_view2d.h | |
parent | dbbe06b690c8c133cfd5be87db22cc10cf987f8d (diff) |
2.5
Added support for cached text drawing in View2D. Cache is needed to
prevent the viewmatrix being set/restored on each text drawing.
Adding a string:
void UI_view2d_text_cache_add(View2D *v2d, float x, float y, char *str)
Drawing:
void UI_view2d_text_cache_draw(ARegion *ar)
Nothing else needed; just make sure cache-draw is always called at end
of a view2d drawing function, to clear cache memory.
On todo for next: a version with a rectf boundary to clip text within.
Diffstat (limited to 'source/blender/editors/include/UI_view2d.h')
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 7ff312151c5..3c58e218f09 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -129,6 +129,7 @@ struct View2DScrollers; struct wmWindowManager; struct bScreen; struct ScrArea; +struct ARegion; struct bContext; struct rctf; @@ -181,6 +182,9 @@ void UI_view2d_getscale(struct View2D *v2d, float *x, float *y); short UI_view2d_mouse_in_scrollers(const struct bContext *C, struct View2D *v2d, int x, int y); +/* cached text drawing in v2d, to allow pixel-aligned draw as post process */ +void UI_view2d_text_cache_add(struct View2D *v2d, float x, float y, char *str); +void UI_view2d_text_cache_draw(struct ARegion *ar); /* operators */ void ui_view2d_operatortypes(void); |