Do not clip or rasterize paths completely outside the device rect

The controlPointRect is a conservative area that is guaranteed to
contain the path, if that does not intersect with the painter's device
rect, the path must be fully outside the painted area, and can be
ignored.

Change-Id: If14d7dbaf916aa284b941d01e773da3365dce5bf
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
This commit is contained in:
Allan Sandfeld Jensen 2016-04-08 14:09:21 +02:00
parent 5f39a0ef8d
commit 307825ca63

View File

@ -1693,8 +1693,12 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush)
// ### Optimize for non transformed ellipses and rectangles...
QRectF cpRect = path.controlPointRect();
const QRect deviceRect = s->matrix.mapRect(cpRect).toRect();
ProcessSpans blend = d->getBrushFunc(deviceRect, &s->brushData);
const QRect pathDeviceRect = s->matrix.mapRect(cpRect).toRect();
// Skip paths that by conservative estimates are completely outside the paint device.
if (!pathDeviceRect.intersects(d->deviceRect))
return;
ProcessSpans blend = d->getBrushFunc(pathDeviceRect, &s->brushData);
// ### Falcon
// const bool do_clip = (deviceRect.left() < -QT_RASTER_COORD_LIMIT