nitpicker: make redraw debug feature configurable

This commit is contained in:
Norman Feske 2015-06-04 16:32:49 +02:00 committed by Christian Helmuth
parent d7256c60a0
commit 0cc314399c
2 changed files with 9 additions and 4 deletions

View File

@ -1195,8 +1195,6 @@ struct Nitpicker::Main
Main(Server::Entrypoint &ep) : ep(ep)
{
// tmp_fb = &framebuffer;
user_state.default_background(background);
user_state.stack(pointer_origin);
user_state.stack(background);
@ -1345,6 +1343,13 @@ void Nitpicker::Main::handle_config(unsigned)
.attribute("color").value(&background.color);
} catch (...) { }
/* enable or disable redraw debug mode */
try {
tmp_fb = nullptr;
if (config()->xml_node().attribute("flash").has_value("yes"))
tmp_fb = &framebuffer;
} catch (...) { }
configure_reporter(pointer_reporter);
configure_reporter(hover_reporter);
configure_reporter(focus_reporter);

View File

@ -129,8 +129,8 @@ void View::draw(Canvas_base &canvas, Mode const &mode) const
if (!canvas.clip().valid() || !&_session) return;
if (tmp_fb) {
for (unsigned i = 0; i < 7; i++) {
canvas.draw_box(view_rect, Color(i*2,i*6,i*16*2));
for (unsigned i = 0; i < 2; i++) {
canvas.draw_box(view_rect, Color(i*8,i*24,i*16*8));
tmp_fb->refresh(0,0,1024,768);
}
}