summaryrefslogtreecommitdiff
path: root/src/summary-chart.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-03-25 13:57:39 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2008-03-25 13:57:39 +0000
commit7e18e60824115036600c0f23700da72863edf7f7 (patch)
treec2d93781759053111d2020f91f106ab12384e96c /src/summary-chart.c
parent91943cc97d205f69c315d9b4e91e925218da7607 (diff)
[summary-chart] Use a global background image.
Only load the png once.
Diffstat (limited to 'src/summary-chart.c')
-rw-r--r--src/summary-chart.c10
1 files changed, 7 insertions, 3 deletions
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);
}