From f49489a63228be00663320a4021f00e50c5b6f20 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Sun, 15 May 2016 23:15:06 +0200 Subject: [PATCH] add _silent functions for gui/timeline.c, the way view/time.c uses it requires those optimizations --- common/utils/T/tracer/gui/gui.h | 3 +++ common/utils/T/tracer/gui/timeline.c | 34 ++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/common/utils/T/tracer/gui/gui.h b/common/utils/T/tracer/gui/gui.h index 2a60e08e96..bb1a495849 100644 --- a/common/utils/T/tracer/gui/gui.h +++ b/common/utils/T/tracer/gui/gui.h @@ -55,8 +55,11 @@ void textlist_get_line(gui *gui, widget *this, int line, void textlist_set_color(gui *gui, widget *this, int line, int color); void timeline_clear(gui *gui, widget *this); +void timeline_clear_silent(gui *gui, widget *this); void timeline_add_points(gui *gui, widget *this, int subline, int color, int *x, int len); +void timeline_add_points_silent(gui *gui, widget *this, int subline, + int color, int *x, int len); void timeline_set_subline_background_color(gui *gui, widget *this, int subline, int color); void timeline_get_width(gui *gui, widget *this, int *width); diff --git a/common/utils/T/tracer/gui/timeline.c b/common/utils/T/tracer/gui/timeline.c index 7c8469f928..0902078071 100644 --- a/common/utils/T/tracer/gui/timeline.c +++ b/common/utils/T/tracer/gui/timeline.c @@ -97,7 +97,7 @@ widget *new_timeline(gui *_gui, int width, int number_of_sublines, /* public functions */ /*************************************************************************/ -void timeline_clear(gui *_gui, widget *_this) +static void _timeline_clear(gui *_gui, widget *_this, int silent) { struct gui *g = _gui; struct timeline_widget *this = _this; @@ -110,13 +110,24 @@ void timeline_clear(gui *_gui, widget *_this) for (j = 0; j < this->s[i].width; j++) this->s[i].color[j] = -1; - send_event(g, DIRTY, this->common.id); + if (silent == 0) + send_event(g, DIRTY, this->common.id); gunlock(g); } -void timeline_add_points(gui *_gui, widget *_this, int subline, int color, - int *x, int len) +void timeline_clear(gui *_gui, widget *_this) +{ + _timeline_clear(_gui, _this, 0); +} + +void timeline_clear_silent(gui *_gui, widget *_this) +{ + _timeline_clear(_gui, _this, 1); +} + +static void _timeline_add_points(gui *_gui, widget *_this, int subline, + int color, int *x, int len, int silent) { struct gui *g = _gui; struct timeline_widget *this = _this; @@ -129,11 +140,24 @@ void timeline_add_points(gui *_gui, widget *_this, int subline, int color, this->s[subline].color[x[i]] = color; } - send_event(g, DIRTY, this->common.id); + if (silent == 0) + send_event(g, DIRTY, this->common.id); gunlock(g); } +void timeline_add_points(gui *_gui, widget *_this, int subline, int color, + int *x, int len) +{ + _timeline_add_points(_gui, _this, subline, color, x, len, 0); +} + +void timeline_add_points_silent(gui *_gui, widget *_this, int subline, + int color, int *x, int len) +{ + _timeline_add_points(_gui, _this, subline, color, x, len, 1); +} + void timeline_set_subline_background_color(gui *_gui, widget *_this, int subline, int color) {