[gtk+/refactor] gtk/tests/testing.c: Use accessor functions to access GtkWidget
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/refactor] gtk/tests/testing.c: Use accessor functions to access GtkWidget
- Date: Sun, 15 Aug 2010 22:40:04 +0000 (UTC)
commit ace2d721d6c6840573db18672274d33b1b39f129
Author: Javier Jardón <jjardon gnome org>
Date: Sun Aug 15 18:52:05 2010 +0200
gtk/tests/testing.c: Use accessor functions to access GtkWidget
gtk/tests/testing.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c
index 85fadef..b053dd2 100644
--- a/gtk/tests/testing.c
+++ b/gtk/tests/testing.c
@@ -132,14 +132,18 @@ test_xserver_sync (void)
GtkWidget *window = gtk_test_create_simple_window ("Test Window", "Test: test_xserver_sync");
GtkWidget *darea = gtk_drawing_area_new ();
GtkWidget *child;
+ GdkWindow *gdk_window;
GTimer *gtimer = g_timer_new();
gint sync_is_slower = 0, repeat = 5;
child = gtk_bin_get_child (GTK_BIN (window));
+ gdk_window = gtk_widget_get_window (darea);
+
gtk_widget_set_size_request (darea, 320, 200);
gtk_container_add (GTK_CONTAINER (child), darea);
gtk_widget_show (darea);
gtk_widget_show_now (window);
+
while (repeat--)
{
gint i, many = 200;
@@ -148,7 +152,7 @@ test_xserver_sync (void)
while (gtk_events_pending ())
gtk_main_iteration ();
- cr = gdk_cairo_create (darea->window);
+ cr = gdk_cairo_create (gdk_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);
@@ -166,7 +170,7 @@ test_xserver_sync (void)
for (i = 0; i < many; i++)
{
cairo_paint (cr);
- gdk_test_render_sync (darea->window);
+ gdk_test_render_sync (gdk_window);
}
g_timer_stop (gtimer);
sync_time = g_timer_elapsed (gtimer, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]