API flush static cairo pattern cache

(should probably be cleaned regularly
e.g. meterbridge resize)
This commit is contained in:
Robin Gareus 2014-09-11 02:40:18 +02:00
parent 114792777d
commit 01974b5769
3 changed files with 20 additions and 0 deletions

View file

@ -577,6 +577,7 @@ ARDOUR_UI::~ARDOUR_UI ()
delete secondary_clock;
delete _process_thread;
delete gui_object_state;
FastMeter::flush_pattern_cache ();
}
}

View file

@ -133,6 +133,24 @@ FastMeter::~FastMeter ()
{
}
void
FastMeter::flush_pattern_cache () {
Pattern10Map::iterator i1;
PatternBgMap::iterator ib;
for (ib = hb_pattern_cache.begin(); ib != hb_pattern_cache.end(); ++ib) {
hb_pattern_cache.erase(ib);
}
for (i1 = hm_pattern_cache.begin(); i1 != hm_pattern_cache.end(); ++i1) {
hm_pattern_cache.erase(i1);
}
for (ib = vb_pattern_cache.begin(); ib != vb_pattern_cache.end(); ++ib) {
vb_pattern_cache.erase(ib);
}
for (i1 = vm_pattern_cache.begin(); i1 != vm_pattern_cache.end(); ++i1) {
vm_pattern_cache.erase(i1);
}
}
Cairo::RefPtr<Cairo::Pattern>
FastMeter::generate_meter_pattern (
int width, int height, int *clr, float *stp, int styleflags, bool horiz)

View file

@ -52,6 +52,7 @@ class LIBGTKMM2EXT_API FastMeter : public CairoWidget {
int styleflags = 3
);
virtual ~FastMeter ();
static void flush_pattern_cache();
void set (float level, float peak = -1);
void clear ();