[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kexi/formeditor
From: Adam Pigg <adam () piggz ! co ! uk>
Date: 2009-10-21 20:05:24
Message-ID: 1256155524.589464.10080.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1038776 by piggz:
speed up grid drawing about 2000x
M +11 -6 container.cpp
--- trunk/koffice/kexi/formeditor/container.cpp #1038775:1038776
@@ -513,15 +513,17 @@
startCol = qMax(startCol, 1);
int endCol = r.right() / gridX;
endCol = qMin(endCol, cols);
+ QVector<QPoint> gridpoints;
for (int rowcursor = startRow; rowcursor <= endRow; ++rowcursor) {
for (int colcursor = startCol; colcursor <= endCol; ++colcursor) {
- const int x = colcursor * gridX - 1;
- const int y = rowcursor * gridY - 1;
- p.setPen(pen1);
- p.drawPoint(x, y);
+// const int x = colcursor * gridX - 1;
+// const int y = rowcursor * gridY - 1;
+// p.setPen(pen1);
+// p.drawPoint(x, y);
// p.drawPoint(x, y+1);
- p.setPen(pen2);
- p.drawPoint(x, y);
+// p.setPen(pen2);
+ gridpoints << QPoint(colcursor * gridX - 1,rowcursor * gridY - 1);
+// p.drawPoint(x, y);
// p.drawPoint(x, y+1);
// p.drawPoint(x+1, y);
// p.drawPoint(x+1, y+1);
@@ -530,6 +532,9 @@
#endif
}
}
+ p.setRenderHint(QPainter::Antialiasing, false);
+ p.setPen(QColor(10, 10, 10));
+ p.drawPoints(gridpoints);
#ifdef DEBUG_PAINTER
kDebug() << "millisecs:" << t.elapsed() << "points:" << points;
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic