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:
parent
56d62345ad
commit
c2ea62dd34
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user