comparison layer/Colour3DPlotRenderer.cpp @ 1081:cbc7c8675706 spectrogram-minor-refactor

Comments
author Chris Cannam
date Thu, 30 Jun 2016 18:21:11 +0100
parents 2e5945b87aca
children 5b4fe7bb9430
comparison
equal deleted inserted replaced
1080:2e5945b87aca 1081:cbc7c8675706
72 // contain the complete view, but might be scrollable or 72 // contain the complete view, but might be scrollable or
73 // partially usable 73 // partially usable
74 m_cache.scrollTo(startFrame); 74 m_cache.scrollTo(startFrame);
75 75
76 // if we are not time-constrained, then we want to paint 76 // if we are not time-constrained, then we want to paint
77 // the whole area in one go, and we're not going to 77 // the whole area in one go; we don't return a partial
78 // provide the more complex logic to handle that if there 78 // paint. To avoid providing the more complex logic to
79 // are discontiguous areas involved. So if the only valid 79 // handle painting discontiguous areas, if the only valid
80 // part of cache is in the middle, just make the whole 80 // part of cache is in the middle, just make the whole
81 // thing invalid and start again. 81 // thing invalid and start again.
82 if (!timeConstrained) { 82 if (!timeConstrained) {
83 if (m_cache.getValidLeft() > x0 && 83 if (m_cache.getValidLeft() > x0 &&
84 m_cache.getValidRight() < x1) { 84 m_cache.getValidRight() < x1) {
89 } 89 }
90 90
91 bool rightToLeft = false; 91 bool rightToLeft = false;
92 92
93 if (!m_cache.isValid() && timeConstrained) { 93 if (!m_cache.isValid() && timeConstrained) {
94 // When rendering the whole thing in a context where we 94 // When rendering the whole area, in a context where we might
95 // might not be able to complete the work, start from 95 // not be able to complete the work, start from somewhere near
96 // somewhere near the middle so that the region of 96 // the middle so that the region of interest appears first
97 // interest appears first
98 97
99 //!!! (perhaps we should avoid doing this if past repaints 98 //!!! (perhaps we should avoid doing this if past repaints
100 //!!! have been fast enough to do the whole in one shot) 99 //!!! have been fast enough to do the whole in one shot)
101 if (x0 == 0 && x1 == v->getPaintWidth()) { 100 if (x0 == 0 && x1 == v->getPaintWidth()) {
102 x0 = int(x1 * 0.3); 101 x0 = int(x1 * 0.3);