r13943 by fschmid - Some more improvements for rendering patterns on screen.
scribus-commit
scribus-commit at lists.scribus.net
Sat Aug 29 13:40:31 CEST 2009
Revision: 13943
Author: fschmid
Date: 2009-08-29T11:38:24.733827Z
Commit message: Some more improvements for rendering patterns on screen.
Changeset:
M /trunk/Scribus/scribus/scpainter.cpp
M /trunk/Scribus/scribus/pageitem.cpp
Diffs:
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp (revision 13942)
+++ scribus/scpainter.cpp (revision 13943)
@@ -984,6 +984,7 @@
}
else if (fillMode == 3)
{
+ cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_NONE);
cairo_surface_t *image2 = cairo_image_surface_create_for_data ((uchar*)m_pattern->getPattern()->bits(), CAIRO_FORMAT_ARGB32, m_pattern->getPattern()->width(), m_pattern->getPattern()->height(), m_pattern->getPattern()->width()*4);
cairo_pattern_t *m_pat = cairo_pattern_create_for_surface(image2);
cairo_pattern_set_extend(m_pat, CAIRO_EXTEND_REPEAT);
@@ -1003,6 +1004,7 @@
cairo_paint_with_alpha (m_cr, fill_trans);
cairo_pattern_destroy (m_pat);
cairo_surface_destroy (image2);
+ cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_DEFAULT);
}
}
else
@@ -1086,6 +1088,8 @@
}
else if (fillMode == 3)
{
+ painter.setRenderHint(QPainter::Antialiasing, false);
+ painter.setRenderHint(QPainter::SmoothPixmapTransform, false);
QMatrix qmatrix;
qmatrix.translate(patternOffsetX, patternOffsetY);
qmatrix.rotate(patternRotation);
@@ -1096,6 +1100,8 @@
painter.rotate(0.0001); // hack to get Qt-4's strange pattern rendering working
painter.setOpacity(fill_trans);
painter.fillPath(m_path, brush);
+ painter.setRenderHint(QPainter::Antialiasing, true);
+ painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
}
}
else
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp (revision 13942)
+++ scribus/pageitem.cpp (revision 13943)
@@ -1601,7 +1601,7 @@
// retImg.fill( qRgba(255, 255, 255, 0) );
retImg.fill( qRgba(0, 0, 0, 0) );
ScPainter *painter = new ScPainter(&retImg, retImg.width(), retImg.height(), 1, 0);
- painter->setZoomFactor(1.0);
+ painter->setZoomFactor(qMax(qRound(gWidth) / gWidth, qRound(gHeight) / gHeight));
QStack<PageItem*> groupStack;
for (int em = 0; em < emG.count(); ++em)
{
More information about the scribus-commit
mailing list