summaryrefslogtreecommitdiff
path: root/src/tsm_screen.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-09-18 15:58:54 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-09-18 15:58:54 +0200
commit3e71989955e1c410bfa47ab6851abba5cc76a3e3 (patch)
treee282e34a92dabcf2945d1207ae78803b171935b9 /src/tsm_screen.c
parent0ee83010ff6ac9366fdb1c5115a334cda6082def (diff)
tsm: screen: introduce TSM_SCREEN_OPT_RENDER_TIMING
Instead of accessing kmscon state from TSM, we now introduce options to control the behavior of TSM-screens. Apart from logging, TSM is now independent of any kmscon state/code. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/tsm_screen.c')
-rw-r--r--src/tsm_screen.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/tsm_screen.c b/src/tsm_screen.c
index c2990a7..0f1cb5e 100644
--- a/src/tsm_screen.c
+++ b/src/tsm_screen.c
@@ -36,7 +36,6 @@
#include <stdlib.h>
#include <string.h>
#include "log.h"
-#include "main.h"
#include "shl_llog.h"
#include "shl_timer.h"
#include "tsm_screen.h"
@@ -1299,7 +1298,7 @@ void tsm_screen_draw(struct tsm_screen *con,
/* render preparation */
if (prepare_cb) {
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
shl_timer_reset(con->timer);
ret = prepare_cb(con, data);
@@ -1308,7 +1307,7 @@ void tsm_screen_draw(struct tsm_screen *con,
return;
}
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
time_prep = shl_timer_elapsed(con->timer);
} else {
time_prep = 0;
@@ -1316,7 +1315,7 @@ void tsm_screen_draw(struct tsm_screen *con,
/* push each character into rendering pipeline */
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
shl_timer_reset(con->timer);
iter = con->sb_pos;
@@ -1371,26 +1370,26 @@ void tsm_screen_draw(struct tsm_screen *con,
}
}
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
time_draw = shl_timer_elapsed(con->timer);
/* perform final rendering steps */
if (render_cb) {
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
shl_timer_reset(con->timer);
ret = render_cb(con, data);
if (ret)
log_warning("cannot render via text-renderer");
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
time_rend = shl_timer_elapsed(con->timer);
} else {
time_rend = 0;
}
- if (kmscon_conf.render_timing)
+ if (con->opts & TSM_SCREEN_OPT_RENDER_TIMING)
log_debug("timing: prepare: %llu draw: %llu render: %llu",
time_prep, time_draw, time_rend);
}