r18116 by fschmid - Fix painting of very small (eg. 3x3) pixmaps on the canvas

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 27 16:22:58 UTC 2013


Author: fschmid
Date: Sun Jan 27 16:22:58 2013
New Revision: 18116

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18116
Log:
Fix painting of very small (eg. 3x3) pixmaps on the canvas

Modified:
    trunk/Scribus/scribus/scpainter.cpp

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18116&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sun Jan 27 16:22:58 2013
@@ -1904,6 +1904,7 @@
 
 void ScPainter::drawImage( QImage *image)
 {
+	cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_NONE);
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 2, 6)
 /*
 	cairo_surface_t *image3 = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_ARGB32, image->width(), image->height(), image->width()*4);
@@ -1919,16 +1920,19 @@
 	cairo_surface_t *image2  = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_RGB24, image->width(), image->height(), image->width()*4);
 	cairo_surface_t *image3 = cairo_image_surface_create_for_data ((uchar*)image->bits(), CAIRO_FORMAT_ARGB32, image->width(), image->height(), image->width()*4);
 	cairo_set_source_surface (m_cr, image2, 0, 0);
+	cairo_pattern_set_filter(cairo_get_source(m_cr), CAIRO_FILTER_FAST);
     cairo_mask_surface (m_cr, image3, 0, 0);
 	cairo_surface_destroy (image2);
 	cairo_surface_destroy (image3);
 	cairo_pop_group_to_source (m_cr);
+	cairo_pattern_set_filter(cairo_get_source(m_cr), CAIRO_FILTER_FAST);
 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 4)
 	setRasterOp(m_blendModeFill);
 #endif
 	if (maskMode > 0)
 	{
 		cairo_pattern_t *patM = getMaskPattern();
+		cairo_pattern_set_filter(patM, CAIRO_FILTER_FAST);
 		cairo_mask(m_cr, patM);
 		if ((maskMode == 2) || (maskMode == 4) || (maskMode == 5) || (maskMode == 6))
 			cairo_surface_destroy(imageMask);
@@ -1969,6 +1973,7 @@
 	cairo_surface_destroy (image2);
 	cairo_surface_destroy (image3);
 #endif
+	cairo_set_antialias(m_cr, CAIRO_ANTIALIAS_DEFAULT);
 }
 
 void ScPainter::setupPolygon(FPointArray *points, bool closed)




More information about the scribus-commit mailing list