summaryrefslogtreecommitdiff
path: root/qt/qt-2.3.7.patch/qte237-iconviewspeed.patch
Unidiff
Diffstat (limited to 'qt/qt-2.3.7.patch/qte237-iconviewspeed.patch') (more/less context) (ignore whitespace changes)
-rw-r--r--qt/qt-2.3.7.patch/qte237-iconviewspeed.patch142
1 files changed, 0 insertions, 142 deletions
diff --git a/qt/qt-2.3.7.patch/qte237-iconviewspeed.patch b/qt/qt-2.3.7.patch/qte237-iconviewspeed.patch
deleted file mode 100644
index 81064e1..0000000
--- a/qt/qt-2.3.7.patch/qte237-iconviewspeed.patch
+++ b/dev/null
@@ -1,142 +0,0 @@
1Speed up patches backported from
2
3http://robotics.dei.unipd.it/~koral/KDE/kflicker.html
4
5and
6
7http://lists.kde.org/?l=kde-optimize&m=105382164111363&w=2 (complete thread)
8
9
10
11
12diff -u qt-2.3.7_old/src/iconview/qiconview.cpp qt-2.3.7/src/iconview/qiconview.cpp
13 --- qt-2.3.7_old/src/iconview/qiconview.cpp2004-06-13 22:29:56.000000000 +0200
14 +++ qt-2.3.7/src/iconview/qiconview.cpp2004-06-13 22:33:32.000000000 +0200
15@@ -220,6 +220,7 @@
16 QIconView::SelectionMode selectionMode;
17 QIconViewItem *currentItem, *tmpCurrentItem, *highlightedItem, *startDragItem, *pressedItem, *selectAnchor;
18 QRect *rubber;
19+ QPixmap *backBuffer;
20 QTimer *scrollTimer, *adjustTimer, *updateTimer, *inputTimer,
21 *fullRedrawTimer;
22 int rastX, rastY, spacing;
23@@ -2263,6 +2264,7 @@
24 d->currentItem = 0;
25 d->highlightedItem = 0;
26 d->rubber = 0;
27+ d->backBuffer = 0;
28 d->scrollTimer = 0;
29 d->startDragItem = 0;
30 d->tmpCurrentItem = 0;
31@@ -2411,6 +2413,8 @@
32 delete item;
33 item = tmp;
34 }
35+ delete d->backBuffer;
36+ d->backBuffer = 0;
37 delete d->fm;
38 d->fm = 0;
39 #ifndef QT_NO_TOOLTIP
40@@ -2877,6 +2881,48 @@
41 }
42
43 /*!
44+ This function grabs all paintevents that otherwise would have been
45+ processed by the QScrollView::viewportPaintEvent(). Here we use a
46+ doublebuffer to reduce 'on-paint' flickering on QIconView
47+ (and of course its childs).
48+
49+ \sa QScrollView::viewportPaintEvent(), QIconView::drawContents()
50+*/
51+
52+void QIconView::bufferedPaintEvent( QPaintEvent* pe )
53+{
54+ QWidget* vp = viewport();
55+ QRect r = pe->rect() & vp->rect();
56+ int ex = r.x() + contentsX();
57+ int ey = r.y() + contentsY();
58+ int ew = r.width();
59+ int eh = r.height();
60+
61+ if ( !d->backBuffer )
62 +d->backBuffer = new QPixmap(vp->size());
63+ if ( d->backBuffer->size() != vp->size() ) {
64 +//Resize function (with hysteesis). Uses a good compromise between memory
65 +//consumption and speed (number) of resizes.
66+ float newWidth = (float)vp->width();
67 +float newHeight = (float)vp->height();
68 +if ( newWidth > d->backBuffer->width() || newHeight > d->backBuffer->height() )
69 +{
70 + newWidth *= 1.1892;
71 + newHeight *= 1.1892;
72 + d->backBuffer->resize( (int)newWidth, (int)newHeight );
73 +} else if ( 1.5*newWidth < d->backBuffer->width() || 1.5*newHeight < d->backBuffer->height() )
74 + d->backBuffer->resize( (int)newWidth, (int)newHeight );
75+ }
76+
77+ QPainter p;
78+ p.begin(d->backBuffer, vp);
79+ drawContentsOffset(&p, contentsX(), contentsY(), ex, ey, ew, eh);
80+ p.end();
81+ bitBlt(vp, r.x(), r.y(), d->backBuffer, r.x(), r.y(), ew, eh);
82+}
83+
84+/*!
85+
86 \reimp
87 */
88
89@@ -4855,7 +4901,7 @@
90 if ( !d->rubber )
91 drawDragShapes( d->oldDragPos );
92 }
93 - viewportPaintEvent( (QPaintEvent*)e );
94+ bufferedPaintEvent ((QPaintEvent*)e );
95 if ( d->dragging ) {
96 if ( !d->rubber )
97 drawDragShapes( d->oldDragPos );
98@@ -5286,11 +5332,19 @@
99 return;
100
101 if ( item->d->container1 && d->firstContainer ) {
102 -item->d->container1->items.removeRef( item );
103+ //Special-case checking of the last item, since this may be
104+ //called a few times for the same item.
105+ if (item->d->container1->items.last() == item)
106+ item->d->container1->items.removeLast();
107+ else
108+ item->d->container1->items.removeRef( item );
109 }
110 item->d->container1 = 0;
111 if ( item->d->container2 && d->firstContainer ) {
112 -item->d->container2->items.removeRef( item );
113+ if (item->d->container2->items.last() == item)
114+ item->d->container2->items.removeLast();
115+ else
116+ item->d->container2->items.removeRef( item );
117 }
118 item->d->container2 = 0;
119
120diff -u qt-2.3.7_old/src/iconview/qiconview.h qt-2.3.7/src/iconview/qiconview.h
121 --- qt-2.3.7_old/src/iconview/qiconview.h2004-06-13 22:29:56.000000000 +0200
122 +++ qt-2.3.7/src/iconview/qiconview.h2004-06-13 22:33:32.000000000 +0200
123@@ -444,6 +444,7 @@
124 virtual void contentsDropEvent( QDropEvent *e );
125 #endif
126
127+ void bufferedPaintEvent( QPaintEvent* );
128 virtual void resizeEvent( QResizeEvent* e );
129 virtual void keyPressEvent( QKeyEvent *e );
130 virtual void focusInEvent( QFocusEvent *e );
131 --- qt-2.3.7-old/src/widgets/qscrollview.cpp2004-07-23 15:22:56.000000000 +0200
132 +++ qt-2.3.7/src/widgets/qscrollview.cpp2004-07-23 19:23:10.000000000 +0200
133@@ -1266,6 +1277,9 @@
134 case QEvent::LayoutHint:
135 d->autoResizeHint(this);
136 break;
137 +case QEvent::WindowActivate:
138 +case QEvent::WindowDeactivate:
139 + return TRUE;
140 default:
141 break;
142 }