comparison view/View.h @ 1357:93eaff6f206d

Rework cacheing logic to reduce the number of reallocations and be more correct about the repaint areas. I don't expect the difference to be really noticeable but in theory performance should be a little better...
author Chris Cannam
date Thu, 11 Oct 2018 14:59:34 +0100
parents 40b9a495a0e0
children 694004228ab7
comparison
equal deleted inserted replaced
1356:dddfd28e4f02 1357:93eaff6f206d
438 int m_id; 438 int m_id;
439 439
440 virtual void paintEvent(QPaintEvent *e); 440 virtual void paintEvent(QPaintEvent *e);
441 virtual void drawSelections(QPainter &); 441 virtual void drawSelections(QPainter &);
442 virtual bool shouldLabelSelections() const { return true; } 442 virtual bool shouldLabelSelections() const { return true; }
443 virtual void drawPlayPointer(QPainter &);
443 virtual bool render(QPainter &paint, int x0, sv_frame_t f0, sv_frame_t f1); 444 virtual bool render(QPainter &paint, int x0, sv_frame_t f0, sv_frame_t f1);
444 virtual void setPaintFont(QPainter &paint); 445 virtual void setPaintFont(QPainter &paint);
445 446
446 QSize scaledSize(const QSize &s, int factor) { 447 QSize scaledSize(const QSize &s, int factor) {
447 return QSize(s.width() * factor, s.height() * factor); 448 return QSize(s.width() * factor, s.height() * factor);
497 bool m_lightBackground; 498 bool m_lightBackground;
498 bool m_showProgress; 499 bool m_showProgress;
499 500
500 QPixmap *m_cache; // I own this 501 QPixmap *m_cache; // I own this
501 QPixmap *m_buffer; // I own this 502 QPixmap *m_buffer; // I own this
503 bool m_cacheValid;
502 sv_frame_t m_cacheCentreFrame; 504 sv_frame_t m_cacheCentreFrame;
503 ZoomLevel m_cacheZoomLevel; 505 ZoomLevel m_cacheZoomLevel;
504 bool m_selectionCached; 506 bool m_selectionCached;
505 507
506 bool m_deleting; 508 bool m_deleting;