diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2009-03-15 15:50:13 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2009-03-15 15:50:13 -0400 |
commit | 4eb4cf81312691516c2129f04f245401b5566235 (patch) | |
tree | 8b9c1505ed6db4c3e9ad76bcb947ff86b9ed8806 /pango-view/viewer-cairo.c | |
parent | a3e3ba07b6da4bacb85ae6874cab10286d239903 (diff) | |
download | pango-4eb4cf81312691516c2129f04f245401b5566235.tar.gz |
[pango-view] Don't clear the background for vector output
Diffstat (limited to 'pango-view/viewer-cairo.c')
-rw-r--r-- | pango-view/viewer-cairo.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/pango-view/viewer-cairo.c b/pango-view/viewer-cairo.c index f50ddb57..5ecfb964 100644 --- a/pango-view/viewer-cairo.c +++ b/pango-view/viewer-cairo.c @@ -39,12 +39,22 @@ cairo_x_view_iface_create_surface (gpointer instance, 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 = { @@ -83,8 +93,18 @@ cairo_image_view_create_surface (gpointer instance, 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 |