summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk/window/gtksalframe.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-03-09 10:40:14 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-03-11 16:42:33 +0000
commit082f7a97f40f1ebacf64b7a1b9fdee2bbde60a07 (patch)
tree2fac7a4de871bfaf398ce3120233f3d14cea6e55 /vcl/unx/gtk/window/gtksalframe.cxx
parent21e2dee9029c2a6cb240991ecf07de4ef87653f9 (diff)
debug helpers
Change-Id: I75e697a1500cd51ba714d16e3a5f131d922e2906
Diffstat (limited to 'vcl/unx/gtk/window/gtksalframe.cxx')
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx29
1 files changed, 22 insertions, 7 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 8e32df6f9d78..3a84f9865830 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -382,6 +382,8 @@ struct DamageTracker : public basebmp::IBitmapDeviceDamageTracker
GtkSalFrame& m_rFrame;
};
}
+
+static bool dumpframes = false;
#endif
void GtkSalFrame::doKeyCallback( guint state,
@@ -406,10 +408,23 @@ void GtkSalFrame::doKeyCallback( guint state,
// shift-zero forces a re-draw and event is swallowed
if (keyval == GDK_0)
{
- fprintf( stderr, "force re-draw\n");
+ fprintf( stderr, "force widget_queue_draw\n");
gtk_widget_queue_draw (m_pWindow);
return;
}
+ else if (keyval == GDK_1)
+ {
+ fprintf( stderr, "force repaint all\n");
+ TriggerPaintEvent();
+ return;
+ }
+ else if (keyval == GDK_2)
+ {
+ dumpframes = !dumpframes;
+ fprintf(stderr, "toggle dump frames to %d\n", dumpframes);
+ return;
+ }
+
#endif
/*
@@ -3367,14 +3382,14 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
(int) rDamageRect.getHeight(),
area );
}
-
-#if FRAME_BY_FRAME_DEBUG
- static int frame;
- OString tmp("/tmp/frame" + OString::number(frame++) + ".png");
- cairo_surface_write_to_png(cairo_get_target(getCairoContext()), tmp.getStr());
#endif
-#endif
+ if (dumpframes)
+ {
+ static int frame;
+ OString tmp("/tmp/frame" + OString::number(frame++) + ".png");
+ cairo_surface_write_to_png(cairo_get_target(getCairoContext()), tmp.getStr());
+ }
/* FIXME: this is a dirty hack, to render buttons correctly, we
* should of course remove the -1 and +2, but the whole area