r14307 by fschmid - Implemented the use of the new blendmode operators in Cairo-1.9.4 for image frames too.

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 18 12:45:19 CET 2009


Revision: 14307
Author: fschmid
Date: 2009-11-18T03:12:47.535362Z
Commit message: Implemented the use of the new blendmode operators in Cairo-1.9.4 for image frames too.

Changeset: 
M  /trunk/Scribus/scribus/scpainter.cpp

Diffs:
Index: scribus/scpainter.cpp
===================================================================
--- scribus/scpainter.cpp	(revision 14306)
+++ scribus/scpainter.cpp	(revision 14307)
@@ -1914,6 +1914,7 @@
 /* Code with Layers, crashes on cairo_push_group */
 //	cairo_scale(m_cr, m_zoomFactor, m_zoomFactor);
 	cairo_push_group(m_cr);
+	cairo_set_operator(m_cr, CAIRO_OPERATOR_OVER);
 	cairo_set_fill_rule(m_cr, cairo_get_fill_rule(m_cr));
 	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);
@@ -1922,6 +1923,9 @@
 	cairo_surface_destroy (image2);
 	cairo_surface_destroy (image3);
 	cairo_pop_group_to_source (m_cr);
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 4)
+	setRasterOp(m_blendModeFill);
+#endif
 	if (maskMode == 1)
 	{
 		cairo_pattern_t *patM = getMaskPattern();
@@ -1930,6 +1934,7 @@
 	}
 	else
 		cairo_paint_with_alpha (m_cr, fill_trans);
+	cairo_set_operator(m_cr, CAIRO_OPERATOR_OVER);
 #else
 /* Working code, sadly we need to create an additional mask image with the same size as the image to be painted */
 	cairo_surface_t *image3;




More information about the scribus-commit mailing list