Details
-
Suggestion
-
Resolution: Out of scope
-
P2: Important
-
4.3.1
-
None
Description
Drawing lines into a QBitmap is significantly slower on Mac than on Linux.
When comparing Linux and Mac it seems to be a factor of 6 slower on Mac than on Linux.
This seems to be only related to drawing to a QBitmap, drawing to a QImage instead has much more similar performance on the different platforms.
It would be nice if it was possible to increase the performance of drawing to a QBitmap on Mac.
Reproducible with the following code,
#include <qapplication.h>
#include <qbitmap.h>
#include <qpainter.h>
#include <qpen.h>
#include <qdatetime.h>
#include <stdio.h>
QTime Time;
#define TIME(s) if (s) fprintf(stderr, "%4d %s\n", Time.restart(), s); else Time.start();
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QBitmap bitmap(1200, 1000);
TIME(NULL);
bitmap.clear();
QPainter painter(&bitmap);
painter.setPen(QPen(Qt::color1));
for (int i = 0; i < 250000; i++)
TIME("draw");
return 0;
}
Attachments
Issue Links
- depends on
-
QTBUG-349 Handle printing of QBitmap more efficently
-
- Closed
-