QPicturePaintEngine: Avoid slow QPainter::clipRegion

QPainter::clipRegion() is expensive especially for certain clip paths.
QPainter::clipBoundingRect() does not promise to return an exact (tight)
bound but delivers the desired result quickly. In addition, this avoids
discretization.

Change-Id: Ib35406edc12fb8206ca978bc140a7c5e21279ca2
Task-number: QTBUG-46578
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
Kai Pastor 2015-06-12 06:08:45 +02:00
parent 56d62345ad
commit c2ea62dd34

View File

@ -342,7 +342,7 @@ void QPicturePaintEngine::writeCmdLength(int pos, const QRectF &r, bool corr)
}
br = painter()->transform().mapRect(br);
if (painter()->hasClipping()) {
QRect cr = painter()->clipRegion().boundingRect();
QRectF cr = painter()->clipBoundingRect();
br &= cr;
}