[gtk+/gtk-2-22] testing: Use Cairo calls instead of gdk_draw_line() to test server sync
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-22] testing: Use Cairo calls instead of gdk_draw_line() to test server sync
- Date: Sat, 7 Aug 2010 13:55:29 +0000 (UTC)
commit e95f6da1161d604b254b3b1e42de2a47caeff223
Author: Benjamin Otte <otte redhat com>
Date: Thu Jul 15 01:08:03 2010 +0200
testing: Use Cairo calls instead of gdk_draw_line() to test server sync
gtk/tests/testing.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c
index dcc2d02..40c7a02 100644
--- a/gtk/tests/testing.c
+++ b/gtk/tests/testing.c
@@ -137,16 +137,19 @@ test_xserver_sync (void)
gtk_widget_show_now (window);
while (repeat--)
{
- gint i, many = 100;
+ gint i, many = 200;
double nosync_time, sync_time;
+ cairo_t *cr;
+
while (gtk_events_pending ())
gtk_main_iteration ();
+ cr = gdk_cairo_create (darea->window);
+ cairo_set_source_rgba (cr, 0, 1, 0, 0.1);
/* run a number of consecutive drawing requests, just using drawing queue */
g_timer_start (gtimer);
for (i = 0; i < many; i++)
{
- gdk_draw_line (darea->window, darea->style->black_gc, 0, 0, 320, 200);
- gdk_draw_line (darea->window, darea->style->black_gc, 320, 0, 0, 200);
+ cairo_paint (cr);
}
g_timer_stop (gtimer);
nosync_time = g_timer_elapsed (gtimer, NULL);
@@ -157,8 +160,7 @@ test_xserver_sync (void)
/* run a number of consecutive drawing requests with intermediate drawing syncs */
for (i = 0; i < many; i++)
{
- gdk_draw_line (darea->window, darea->style->black_gc, 0, 0, 320, 200);
- gdk_draw_line (darea->window, darea->style->black_gc, 320, 0, 0, 200);
+ cairo_paint (cr);
gdk_test_render_sync (darea->window);
}
g_timer_stop (gtimer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]