comparison layer/WaveformLayer.cpp @ 915:f6d9f28f37cb osx-retina

Experiment with querying paint rect separately from view rect
author Chris Cannam
date Wed, 11 Mar 2015 15:35:20 +0000
parents 4a578a360011
children 94e4952a6774
comparison
equal deleted inserted replaced
914:59e51842cf39 915:f6d9f28f37cb
492 492
493 channels = getChannelArrangement(minChannel, maxChannel, 493 channels = getChannelArrangement(minChannel, maxChannel,
494 mergingChannels, mixingChannels); 494 mergingChannels, mixingChannels);
495 if (channels == 0) return; 495 if (channels == 0) return;
496 496
497 int w = v->width(); 497 int w = v->getPaintWidth();
498 int h = v->height(); 498 int h = v->getPaintHeight();
499 499
500 bool ready = m_model->isReady(); 500 bool ready = m_model->isReady();
501 QPainter *paint; 501 QPainter *paint;
502 502
503 if (m_aggressive) { 503 if (m_aggressive) {
557 x1 = rect.right(); 557 x1 = rect.right();
558 y0 = rect.top(); 558 y0 = rect.top();
559 y1 = rect.bottom(); 559 y1 = rect.bottom();
560 560
561 if (x0 > 0) --x0; 561 if (x0 > 0) --x0;
562 if (x1 < v->width()) ++x1; 562 if (x1 < w) ++x1;
563 563
564 // Our zoom level may differ from that at which the underlying 564 // Our zoom level may differ from that at which the underlying
565 // model has its blocks. 565 // model has its blocks.
566 566
567 // Each pixel within our visible range must always draw from 567 // Each pixel within our visible range must always draw from
937 paint->restore(); 937 paint->restore();
938 } 938 }
939 939
940 if (m_aggressive) { 940 if (m_aggressive) {
941 941
942 if (ready && rect == v->rect()) { 942 if (ready && rect == v->getPaintRect()) {
943 m_cacheValid = true; 943 m_cacheValid = true;
944 m_cacheZoomLevel = zoomLevel; 944 m_cacheZoomLevel = zoomLevel;
945 } 945 }
946 paint->end(); 946 paint->end();
947 delete paint; 947 delete paint;