From 7e18e60824115036600c0f23700da72863edf7f7 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 25 Mar 2008 13:57:39 +0000 Subject: [summary-chart] Use a global background image. Only load the png once. --- src/summary-chart.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/summary-chart.c') diff --git a/src/summary-chart.c b/src/summary-chart.c index b6a84e7..53751bc 100644 --- a/src/summary-chart.c +++ b/src/summary-chart.c @@ -492,6 +492,8 @@ summary_chart_query_tooltip (GtkWidget *widget, return TRUE; } +static cairo_surface_t *background; + static void summary_chart_class_init (SummaryChartClass *klass) { @@ -516,6 +518,10 @@ summary_chart_class_init (SummaryChartClass *klass) G_PARAM_STATIC_BLURB | G_PARAM_STATIC_NAME | G_PARAM_READWRITE)); + + background = cairo_image_surface_create_from_png (DATADIR G_DIR_SEPARATOR_S "odin.png"); + if (cairo_surface_status (background)) + background = NULL; } @@ -523,9 +529,7 @@ static void summary_chart_init (SummaryChart *self) { self->others.frame = (gchar *) "Others"; - self->image = cairo_image_surface_create_from_png (DATADIR G_DIR_SEPARATOR_S "odin.png"); - if (cairo_surface_status (self->image)) - self->image = NULL; + self->image = cairo_surface_reference (background); gtk_widget_set_has_tooltip (&self->widget, TRUE); } -- cgit v1.2.3