r13942 by fschmid - Some more improvements for rendering patterns on screen.

scribus-commit scribus-commit at lists.scribus.net
Sat Aug 29 13:40:17 CEST 2009


Revision: 13942
Author: fschmid
Date: 2009-08-29T11:37:42.530096Z
Commit message: Some more improvements for rendering patterns on screen.

Changeset: 
M  /branches/Version135/Scribus/scribus/scpainter.cpp
M  /branches/Version135/Scribus/scribus/pageitem.cpp

Diffs:
Index: scribus/pageitem.cpp
===================================================================
--- scribus/pageitem.cpp	(revision 13941)
+++ scribus/pageitem.cpp	(revision 13942)
@@ -1600,7 +1600,8 @@
 //	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(1.0);
+	painter->setZoomFactor(qMax(qRound(gWidth) / gWidth, qRound(gHeight) / gHeight));
 	QStack<PageItem*> groupStack;
 	for (int em = 0; em < emG.count(); ++em)
 	{
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp	(revision 13941)
+++ scribus/scpainter.cpp	(revision 13942)
@@ -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




More information about the scribus-commit mailing list