summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpaintengine_raster.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-09-28 13:25:37 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-09-28 14:52:52 (GMT)
commit8ac7817f7a294428f4eda3c10f519e14fe9d71a0 (patch)
tree00bb41b8e907028788ccd1f3f7ae0568a3fbce07 /src/gui/painting/qpaintengine_raster.cpp
parent464d895c9997d35c223899165586f1d3a276f054 (diff)
downloadQt-8ac7817f7a294428f4eda3c10f519e14fe9d71a0.zip
Qt-8ac7817f7a294428f4eda3c10f519e14fe9d71a0.tar.gz
Qt-8ac7817f7a294428f4eda3c10f519e14fe9d71a0.tar.bz2
Fixed antialiased rasterization bug in raster engine.
When rasterization in the gray raster fails due to out of memory there might already have been a number of spans flushed. To avoid flushing these spans multiple times and thus getting overdraw artifacts we need to keep track of how many spans to skip when we redo the rasterization. This fixes the rendering error in arthur test paths_aa.qps Reviewed-by: Yoann Lopes
Diffstat (limited to 'src/gui/painting/qpaintengine_raster.cpp')
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 09a87aa..36e1082 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -4148,6 +4148,10 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
rasterize(outline, callback, (void *)spanData, rasterBuffer);
}
+extern "C" {
+ int q_gray_rendered_spans(QT_FT_Raster raster);
+}
+
void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
ProcessSpans callback,
void *userData, QRasterBuffer *)
@@ -4212,10 +4216,13 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
bool done = false;
int error;
+ int rendered_spans = 0;
+
while (!done) {
rasterParams.flags |= (QT_FT_RASTER_FLAG_AA | QT_FT_RASTER_FLAG_DIRECT);
rasterParams.gray_spans = callback;
+ rasterParams.skip_spans = rendered_spans;
error = qt_ft_grays_raster.raster_render(*grayRaster.data(), &rasterParams);
// Out of memory, reallocate some more and try again...
@@ -4244,6 +4251,8 @@ void QRasterPaintEnginePrivate::rasterize(QT_FT_Outline *outline,
#endif
Q_CHECK_PTR(rasterPoolBase); // note: we just freed the old rasterPoolBase. I hope it's not fatal.
+ rendered_spans += q_gray_rendered_spans(*grayRaster.data());
+
qt_ft_grays_raster.raster_done(*grayRaster.data());
qt_ft_grays_raster.raster_new(grayRaster.data());
qt_ft_grays_raster.raster_reset(*grayRaster.data(), rasterPoolBase, rasterPoolSize);