Commit 6dd7e5af authored by Benjamin Otte's avatar Benjamin Otte

tests: Make testoffscreen use Cairo

parent a625e587
......@@ -24,13 +24,12 @@ layout_expose_handler (GtkWidget *widget,
GdkEventExpose *event)
{
GtkLayout *layout = GTK_LAYOUT (widget);
GdkWindow *bin_window;
GdkWindow *bin_window = gtk_layout_get_bin_window (layout);
cairo_t *cr;
gint i,j;
gint imin, imax, jmin, jmax;
bin_window = gtk_layout_get_bin_window (layout);
if (event->window != bin_window)
return FALSE;
......@@ -40,14 +39,18 @@ layout_expose_handler (GtkWidget *widget,
jmin = (event->area.y) / 10;
jmax = (event->area.y + event->area.height + 9) / 10;
cr = gdk_cairo_create (bin_window);
for (i = imin; i < imax; i++)
for (j = jmin; j < jmax; j++)
if ((i + j) % 2)
gdk_draw_rectangle (bin_window,
widget->style->black_gc,
TRUE,
10 * i, 10 * j,
1 + i % 10, 1 + j % 10);
cairo_rectangle (cr,
10 * i, 10 * j,
1 + i % 10, 1 + j % 10);
cairo_fill (cr);
cairo_destroy (cr);
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment