From 21c8b0c749be00fff27e41e4c2d677dd7d320fa0 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Tue, 24 Jan 2012 09:42:25 +0100 Subject: Imported Upstream version 0.4.1 --- src/images/renderedText.vala | 52 +++----------------------------------------- 1 file changed, 3 insertions(+), 49 deletions(-) (limited to 'src/images') diff --git a/src/images/renderedText.vala b/src/images/renderedText.vala index e4bb4cb..41146d6 100644 --- a/src/images/renderedText.vala +++ b/src/images/renderedText.vala @@ -22,34 +22,6 @@ namespace GnomePie { ///////////////////////////////////////////////////////////////////////// public class RenderedText : Image { - - ///////////////////////////////////////////////////////////////////// - /// A cache which stores images. It is cleared when the theme of - /// Gnome-Pie changes. - /// The key is in form @x:. - ///////////////////////////////////////////////////////////////////// - - private static Gee.HashMap cache { private get; private set; } - - ///////////////////////////////////////////////////////////////////// - /// Initializes the cache. - ///////////////////////////////////////////////////////////////////// - - public static void init() { - clear_cache(); - - Config.global.notify["theme"].connect(() => { - clear_cache(); - }); - } - - ///////////////////////////////////////////////////////////////////// - /// Clears the cache. - ///////////////////////////////////////////////////////////////////// - - static void clear_cache() { - cache = new Gee.HashMap(); - } ///////////////////////////////////////////////////////////////////// /// C'tor, creates a new image representation of a string. @@ -58,16 +30,7 @@ public class RenderedText : Image { public RenderedText(string text, int width, int height, string font, Color color, double scale) { - var cached = this.cache.get("%s@%ux%u@%f:%s:%f:%f:%f:%f".printf(text, width, height, scale, font, - color.r, color.g, color.b, color.a)); - - if (cached == null) { - this.render_text(text, width, height, font, color, scale); - this.cache.set("%s@%ux%u@%f:%s:%f:%f:%f:%f".printf(text, width, height, scale, font, - color.r, color.g, color.b, color.a), this.surface); - } else { - this.surface = cached; - } + this.render_text(text, width, height, font, color, scale); } ///////////////////////////////////////////////////////////////////// @@ -77,17 +40,8 @@ public class RenderedText : Image { public RenderedText.with_markup(string text, int width, int height, string font, Color color, double scale) { - - var cached = this.cache.get("%s@%ux%u@%f:%s:%f:%f:%f:%f".printf(text, width, height, scale, font, - color.r, color.g, color.b, color.a)); - - if (cached == null) { - this.render_markup(text, width, height, font, color, scale); - this.cache.set("%s@%ux%u@%f:%s:%f:%f:%f:%f".printf(text, width, height, scale, font, - color.r, color.g, color.b, color.a), this.surface); - } else { - this.surface = cached; - } + + this.render_markup(text, width, height, font, color, scale); } ///////////////////////////////////////////////////////////////////// -- cgit v1.2.3