diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-05-07 06:15:37 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-05-07 06:15:37 (GMT) |
commit | 4976130171033abdd8323a19229dcbfc5b008cfe (patch) | |
tree | 06fb286c8831e943941a9dabf081fe704fcfda88 /src/gui/painting/qrasterizer.cpp | |
parent | 65d04843759d14f15f559c78df94626568bc0cb8 (diff) | |
download | Qt-4976130171033abdd8323a19229dcbfc5b008cfe.zip Qt-4976130171033abdd8323a19229dcbfc5b008cfe.tar.gz Qt-4976130171033abdd8323a19229dcbfc5b008cfe.tar.bz2 |
Avoid many unnecessary allocations, so so that paint engines attached to pixmaps
do not consume excessive amounts of memory, and so can still be reasonably kept
cached with the pixmap.
Saves 8K for every pixmaps drawn to on raster paint engine. Saves about 2K for other graphicssystems.
Task-number: QTBUG-10215
Reviewed-by: Gunnar
Diffstat (limited to 'src/gui/painting/qrasterizer.cpp')
-rw-r--r-- | src/gui/painting/qrasterizer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/painting/qrasterizer.cpp b/src/gui/painting/qrasterizer.cpp index 51d01c9..f8f8afb 100644 --- a/src/gui/painting/qrasterizer.cpp +++ b/src/gui/painting/qrasterizer.cpp @@ -198,9 +198,11 @@ public: }; QScanConverter::QScanConverter() - : m_alloc(0) + : m_lines(0) + , m_alloc(0) , m_size(0) , m_intersections(0) + , m_active(0) { } @@ -310,6 +312,10 @@ struct QBoolToType template <typename T> void qScanConvert(QScanConverter &d, T allVertical) { + if (!d.m_lines.size()) { + d.m_active.reset(); + return; + } qSort(d.m_lines.data(), d.m_lines.data() + d.m_lines.size(), QT_PREPEND_NAMESPACE(topOrder)); int line = 0; for (int y = d.m_lines.first().top; y <= d.m_bottom; ++y) { |