int width,
int height)
{
+ cairo_t *cr;
+ cairo_surface_t *cairo_surface;
+
XViewer *x = (XViewer *)instance;
Drawable drawable = (Drawable) surface;
- return cairo_xlib_surface_create (x->display, drawable,
- DefaultVisual (x->display, x->screen),
- width, height);
+ cairo_surface = cairo_xlib_surface_create (x->display, drawable,
+ DefaultVisual (x->display, x->screen),
+ width, height);
+
+ cr = cairo_create (cairo_surface);
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ return cairo_surface;
}
static CairoViewerIface cairo_x_viewer_iface = {
int width,
int height)
{
+ cairo_t *cr;
+ cairo_surface_t *surface;
+
/* TODO: Be smarter about format? */
- return cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+ surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
+
+ cr = cairo_create (surface);
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ return surface;
}
static void
transform_callback (context, NULL, cr, state);
- cairo_set_source_rgb (cr, 1.0, 1.0, 1.0);
- cairo_paint (cr);
-
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
do_output (context, render_callback, transform_callback, cr, state, width, height);