[gtk+/rendering-cleanup: 59/89] testing: Use Cairo calls instead of gdk_draw_line() to test server sync



commit 442222f711a0edb5bb99c3f2a90d382351ad2c92
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 6208ac6..d5b1582 100644
--- a/gtk/tests/testing.c
+++ b/gtk/tests/testing.c
@@ -136,16 +136,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);
@@ -156,8 +159,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]