comparison view/View.cpp @ 951:53e039d99b5d osx-retina

Painting off-cache means we shouldn't use proxy (we aren't scaling.. yet)
author Chris Cannam
date Mon, 20 Apr 2015 15:59:03 +0100
parents 43888f891733
children b1aa74ce697e
comparison
equal deleted inserted replaced
950:43888f891733 951:53e039d99b5d
43 #include <cassert> 43 #include <cassert>
44 #include <cmath> 44 #include <cmath>
45 45
46 #include <unistd.h> 46 #include <unistd.h>
47 47
48 //#define DEBUG_VIEW 1 48 #define DEBUG_VIEW 1
49 //#define DEBUG_VIEW_WIDGET_PAINT 1 49 #define DEBUG_VIEW_WIDGET_PAINT 1
50 50
51 51
52 View::View(QWidget *w, bool showProgress) : 52 View::View(QWidget *w, bool showProgress) :
53 QFrame(w), 53 QFrame(w),
54 m_centreFrame(0), 54 m_centreFrame(0),
1028 #endif 1028 #endif
1029 1029
1030 f = getAlignedPlaybackFrame(); 1030 f = getAlignedPlaybackFrame();
1031 1031
1032 #ifdef DEBUG_VIEW 1032 #ifdef DEBUG_VIEW
1033 cerr << " -> aligned frame = " << af << endl; 1033 cerr << " -> aligned frame = " << f << endl;
1034 #endif 1034 #endif
1035 1035
1036 movePlayPointer(f); 1036 movePlayPointer(f);
1037 } 1037 }
1038 1038
1865 paint.setBrush(Qt::NoBrush); 1865 paint.setBrush(Qt::NoBrush);
1866 1866
1867 for (LayerList::iterator i = scrollables.begin(); i != scrollables.end(); ++i) { 1867 for (LayerList::iterator i = scrollables.begin(); i != scrollables.end(); ++i) {
1868 paint.setRenderHint(QPainter::Antialiasing, false); 1868 paint.setRenderHint(QPainter::Antialiasing, false);
1869 paint.save(); 1869 paint.save();
1870 #ifdef DEBUG_VIEW_WIDGET_PAINT
1871 cerr << "Painting scrollable layer " << *i << " using proxy with repaintCache = " << repaintCache << ", dpratio = " << dpratio << ", rectToPaint = " << rectToPaint.x() << "," << rectToPaint.y() << " " << rectToPaint.width() << "x" << rectToPaint.height() << endl;
1872 #endif
1870 (*i)->paint(&proxy, paint, rectToPaint); 1873 (*i)->paint(&proxy, paint, rectToPaint);
1871 paint.restore(); 1874 paint.restore();
1872 } 1875 }
1873 1876
1874 if (haveSelections && selectionCacheable) { 1877 if (haveSelections && selectionCacheable) {
1904 paint.setPen(getForeground()); 1907 paint.setPen(getForeground());
1905 paint.setBrush(Qt::NoBrush); 1908 paint.setBrush(Qt::NoBrush);
1906 1909
1907 for (LayerList::iterator i = nonScrollables.begin(); i != nonScrollables.end(); ++i) { 1910 for (LayerList::iterator i = nonScrollables.begin(); i != nonScrollables.end(); ++i) {
1908 // Profiler profiler2("View::paintEvent non-cacheable"); 1911 // Profiler profiler2("View::paintEvent non-cacheable");
1909 (*i)->paint(&proxy, paint, nonCacheRect); 1912 #ifdef DEBUG_VIEW_WIDGET_PAINT
1913 cerr << "Painting non-scrollable layer " << *i << " without proxy with repaintCache = " << repaintCache << ", dpratio = " << dpratio << ", rectToPaint = " << nonCacheRect.x() << "," << nonCacheRect.y() << " " << nonCacheRect.width() << "x" << nonCacheRect.height() << endl;
1914 #endif
1915 (*i)->paint(this, paint, nonCacheRect);
1910 } 1916 }
1911 1917
1912 paint.end(); 1918 paint.end();
1913 1919
1914 paint.begin(this); 1920 paint.begin(this);