Mercurial > hg > svcore
comparison base/View.cpp @ 111:1be256ac7681
* 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.
author | Chris Cannam |
---|---|
date | Tue, 09 May 2006 12:43:55 +0000 |
parents | c1188c5a991d |
children | c30728d5625c |
comparison
equal
deleted
inserted
replaced
110:c1188c5a991d | 111:1be256ac7681 |
---|---|
904 | 904 |
905 // We want a list of all the scrollable layers that are behind the | 905 // We want a list of all the scrollable layers that are behind the |
906 // backmost non-scrollable layer. | 906 // backmost non-scrollable layer. |
907 | 907 |
908 LayerList scrollables; | 908 LayerList scrollables; |
909 bool metUnscrollable = false; | |
910 | |
909 for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { | 911 for (LayerList::const_iterator i = m_layers.begin(); i != m_layers.end(); ++i) { |
910 if ((*i)->isLayerDormant(this)) continue; | 912 if ((*i)->isLayerDormant(this)) continue; |
911 if ((*i)->isLayerOpaque()) { | 913 if ((*i)->isLayerOpaque()) { |
912 // You can't see anything behind an opaque layer! | 914 // You can't see anything behind an opaque layer! |
913 scrollables.clear(); | 915 scrollables.clear(); |
914 } | 916 if (metUnscrollable) break; |
915 if ((*i)->isLayerScrollable(this)) scrollables.push_back(*i); | 917 } |
916 else break; | 918 if (!metUnscrollable && (*i)->isLayerScrollable(this)) { |
919 scrollables.push_back(*i); | |
920 } else { | |
921 metUnscrollable = true; | |
922 } | |
917 } | 923 } |
918 | 924 |
919 if (testChanged && scrollables != m_lastScrollableBackLayers) { | 925 if (testChanged && scrollables != m_lastScrollableBackLayers) { |
920 m_lastScrollableBackLayers = scrollables; | 926 m_lastScrollableBackLayers = scrollables; |
921 changed = true; | 927 changed = true; |
925 | 931 |
926 View::LayerList | 932 View::LayerList |
927 View::getNonScrollableFrontLayers(bool testChanged, bool &changed) const | 933 View::getNonScrollableFrontLayers(bool testChanged, bool &changed) const |
928 { | 934 { |
929 changed = false; | 935 changed = false; |
930 LayerList scrollables = getScrollableBackLayers(testChanged, changed); | |
931 LayerList nonScrollables; | 936 LayerList nonScrollables; |
932 | 937 |
933 // Everything in front of the first non-scrollable from the back | 938 // Everything in front of the first non-scrollable from the back |
934 // should also be considered non-scrollable | 939 // should also be considered non-scrollable |
935 | 940 |