diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-20 16:30:01 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-20 16:30:01 (GMT) |
commit | 4708acb70e1e71bf22e85f7335dcaf1401aba3bb (patch) | |
tree | 36043e3def5d50dde51846dea44e376e902524ac /src/gui/painting/qpaintengine_raster.cpp | |
parent | 556216129bf5738c6ad92807ece1dac233b8b96f (diff) | |
parent | 07703ade86edcd6565c373f63e34306209d1a90a (diff) | |
download | Qt-4708acb70e1e71bf22e85f7335dcaf1401aba3bb.zip Qt-4708acb70e1e71bf22e85f7335dcaf1401aba3bb.tar.gz Qt-4708acb70e1e71bf22e85f7335dcaf1401aba3bb.tar.bz2 |
Merge branch '4.5'
Conflicts:
tests/auto/qaction/tst_qaction.cpp
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 8e3d822..d2b1ed7 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1144,6 +1144,33 @@ void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBru } } +// #define QT_CLIPPING_RATIOS + +#ifdef QT_CLIPPING_RATIOS +int rectClips; +int regionClips; +int totalClips; + +static void checkClipRatios(QRasterPaintEnginePrivate *d) +{ + if (d->clip()->hasRectClip) + rectClips++; + if (d->clip()->hasRegionClip) + regionClips++; + totalClips++; + + if ((totalClips % 5000) == 0) { + printf("Clipping ratio: rectangular=%f%%, region=%f%%, complex=%f%%\n", + rectClips * 100.0 / (qreal) totalClips, + regionClips * 100.0 / (qreal) totalClips, + (totalClips - rectClips - regionClips) * 100.0 / (qreal) totalClips); + totalClips = 0; + rectClips = 0; + regionClips = 0; + } + +} +#endif /*! \internal @@ -1245,6 +1272,10 @@ void QRasterPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) d->solid_color_filler.clip = d->clip(); d->solid_color_filler.adjustSpanMethods(); + +#ifdef QT_CLIPPING_RATIOS + checkClipRatios(d); +#endif } @@ -1319,6 +1350,11 @@ void QRasterPaintEngine::clip(const QRect &rect, Qt::ClipOperation op) d->solid_color_filler.clip = d->clip(); d->solid_color_filler.adjustSpanMethods(); + + +#ifdef QT_CLIPPING_RATIOS + checkClipRatios(d); +#endif } /*! |