summaryrefslogtreecommitdiff
path: root/pango-view
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-03-15 15:50:13 -0400
committerBehdad Esfahbod <behdad@behdad.org>2009-03-15 15:50:13 -0400
commit4eb4cf81312691516c2129f04f245401b5566235 (patch)
tree8b9c1505ed6db4c3e9ad76bcb947ff86b9ed8806 /pango-view
parenta3e3ba07b6da4bacb85ae6874cab10286d239903 (diff)
downloadpango-4eb4cf81312691516c2129f04f245401b5566235.tar.gz
[pango-view] Don't clear the background for vector output
Diffstat (limited to 'pango-view')
-rw-r--r--pango-view/viewer-cairo.c28
-rw-r--r--pango-view/viewer-pangocairo.c3
2 files changed, 24 insertions, 7 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
diff --git a/pango-view/viewer-pangocairo.c b/pango-view/viewer-pangocairo.c
index a4770741..9631c059 100644
--- a/pango-view/viewer-pangocairo.c
+++ b/pango-view/viewer-pangocairo.c
@@ -318,9 +318,6 @@ pangocairo_view_render (gpointer instance G_GNUC_UNUSED,
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);