[retro-gtk/wip/aplazas/gl-display] gl-display: Mesure draw
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk/wip/aplazas/gl-display] gl-display: Mesure draw
- Date: Fri, 17 Nov 2017 19:16:47 +0000 (UTC)
commit 6aef735ad2275c797ca20cb187d7eeadcb64cb4b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Fri Nov 17 20:15:26 2017 +0100
gl-display: Mesure draw
retro-gtk/retro-gl-display.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/retro-gl-display.c b/retro-gtk/retro-gl-display.c
index 8063d2f..5bfbb7f 100644
--- a/retro-gtk/retro-gl-display.c
+++ b/retro-gtk/retro-gl-display.c
@@ -378,6 +378,21 @@ retro_gl_display_set_property (GObject *object,
}
}
+static gboolean (*gtk_gl_area_draw) (GtkWidget *widget, cairo_t *cr);
+
+static gboolean
+retro_gl_display_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ GTimer *timer = g_timer_new ();
+ gboolean result = gtk_gl_area_draw (widget, cr);
+
+ g_message ("draw took %lf msec ", g_timer_elapsed (timer, NULL) * 1000.0);
+ g_timer_destroy (timer);
+
+ return result;
+}
+
static void
retro_gl_display_class_init (RetroGLDisplayClass *klass)
{
@@ -391,6 +406,8 @@ retro_gl_display_class_init (RetroGLDisplayClass *klass)
widget_class->realize = retro_gl_display_realize;
widget_class->unrealize = retro_gl_display_unrealize;
+ gtk_gl_area_draw = widget_class->draw;
+ widget_class->draw = retro_gl_display_draw;
glarea_class->render = retro_gl_display_render;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]