comparison view/View.cpp @ 548:265898470c53

* Make NO_PIXMAP_COPY_TO_SELF the default
author Chris Cannam
date Wed, 23 Sep 2009 11:22:13 +0000
parents be5c35d3f409
children 3f698e237585
comparison
equal deleted inserted replaced
547:0ce7566717b2 548:265898470c53
1601 long dx = 1601 long dx =
1602 getXForFrame(m_cacheCentreFrame) - 1602 getXForFrame(m_cacheCentreFrame) -
1603 getXForFrame(m_centreFrame); 1603 getXForFrame(m_centreFrame);
1604 1604
1605 if (dx > -width() && dx < width()) { 1605 if (dx > -width() && dx < width()) {
1606 #if defined(Q_WS_WIN32) || defined(Q_WS_MAC) || defined(NO_PIXMAP_COPY_TO_SELF) 1606 #ifdef PIXMAP_COPY_TO_SELF
1607 // Copying a pixmap to itself doesn't work properly on Windows 1607 // This is not normally defined. Copying a pixmap to
1608 // or Mac (it only works when moving in one direction) 1608 // itself doesn't work properly on Windows, Mac, or
1609 // X11 with the raster backend (it only works when
1610 // moving in one direction and then presumably only by
1611 // accident). It does actually seem to be fine on X11
1612 // with the native backend, but we prefer not to use
1613 // that anyway
1614 paint.begin(m_cache);
1615 paint.drawPixmap(dx, 0, *m_cache);
1616 paint.end();
1617 #else
1609 static QPixmap *tmpPixmap = 0; 1618 static QPixmap *tmpPixmap = 0;
1610 if (!tmpPixmap || 1619 if (!tmpPixmap ||
1611 tmpPixmap->width() != width() || 1620 tmpPixmap->width() != width() ||
1612 tmpPixmap->height() != height()) { 1621 tmpPixmap->height() != height()) {
1613 delete tmpPixmap; 1622 delete tmpPixmap;
1616 paint.begin(tmpPixmap); 1625 paint.begin(tmpPixmap);
1617 paint.drawPixmap(0, 0, *m_cache); 1626 paint.drawPixmap(0, 0, *m_cache);
1618 paint.end(); 1627 paint.end();
1619 paint.begin(m_cache); 1628 paint.begin(m_cache);
1620 paint.drawPixmap(dx, 0, *tmpPixmap); 1629 paint.drawPixmap(dx, 0, *tmpPixmap);
1621 paint.end();
1622 #else
1623 // But it seems to be fine on X11
1624 paint.begin(m_cache);
1625 paint.drawPixmap(dx, 0, *m_cache);
1626 paint.end(); 1630 paint.end();
1627 #endif 1631 #endif
1628 if (dx < 0) { 1632 if (dx < 0) {
1629 cacheRect = QRect(width() + dx, 0, -dx, height()); 1633 cacheRect = QRect(width() + dx, 0, -dx, height());
1630 } else { 1634 } else {