summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-08 14:09:21 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-09 11:22:41 +0000
commit307825ca6380594f48baf61fbe11f4d8c54b649e (patch)
tree491cb56a4bd427a88396a4162270b9623079c11d
parent5f39a0ef8d037ed8d1fa19d5514308ed4a2ca161 (diff)
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>
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 348ccfffda..d3b4acbbcd 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -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