# HG changeset patch # User Chris Cannam # Date 1147178635 0 # Node ID 1be256ac7681438fb495777016772a4d542c2b11 # Parent c1188c5a991d4d774134d952a7814fcab47b3c9a * It turns out we can be more efficient in the spectrogram repaints by marking the spectrogram layer as non-scrollable, and using the spectrogram cache alone instead of both spectrogram and view caches. diff -r c1188c5a991d -r 1be256ac7681 base/View.cpp --- a/base/View.cpp Mon May 08 20:15:23 2006 +0000 +++ b/base/View.cpp Tue May 09 12:43:55 2006 +0000 @@ -906,14 +906,20 @@ // backmost non-scrollable layer. LayerList scrollables; + bool metUnscrollable = false; + for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { if ((*i)->isLayerDormant(this)) continue; if ((*i)->isLayerOpaque()) { // You can't see anything behind an opaque layer! scrollables.clear(); + if (metUnscrollable) break; } - if ((*i)->isLayerScrollable(this)) scrollables.push_back(*i); - else break; + if (!metUnscrollable && (*i)->isLayerScrollable(this)) { + scrollables.push_back(*i); + } else { + metUnscrollable = true; + } } if (testChanged && scrollables != m_lastScrollableBackLayers) { @@ -927,7 +933,6 @@ View::getNonScrollableFrontLayers(bool testChanged, bool &changed) const { changed = false; - LayerList scrollables = getScrollableBackLayers(testChanged, changed); LayerList nonScrollables; // Everything in front of the first non-scrollable from the back