r16297 by fschmid - Added support for the new cairo 1.11.2 snapshot

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 23 22:27:30 CET 2011


Author: fschmid
Date: Sun Jan 23 21:27:29 2011
New Revision: 16297

URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16297
Log:
Added support for the new cairo 1.11.2 snapshot

Modified:
    trunk/Scribus/scribus/scpainter.cpp
    trunk/Scribus/scribus/third_party/cairo/cairo-pattern.c
    trunk/Scribus/scribus/third_party/cairo/cairo.h

Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16297&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sun Jan 23 21:27:29 2011
@@ -937,12 +937,14 @@
 			cairo_pattern_t *pat = NULL;
 			cairo_surface_t *img = NULL;
 			cairo_t *cr = NULL;
-#ifdef HAVE_PRIVATE_CAIRO
+// #ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)  || HAVE_PRIVATE_CAIRO)
 			cairo_pattern_t *mpat = NULL;
 #endif
 			if (fill_gradient.type() == VGradient::fourcolor)
 			{
-#ifdef HAVE_PRIVATE_CAIRO
+//#ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2) || HAVE_PRIVATE_CAIRO)
 				double p1x = gradPatchP1.x();
 				double p1y = gradPatchP1.y();
 				double p2x = gradPatchP2.x();
@@ -958,25 +960,25 @@
 				cairo_set_tolerance(cr, 0.5 );
 				double r, g, b, a;
 				mpat = cairo_pattern_create_mesh();
-				cairo_pattern_begin_patch(mpat);
-				cairo_pattern_move_to(mpat, p1x, p1y);
-				cairo_pattern_line_to(mpat, p2x, p2y);
-				cairo_pattern_line_to(mpat, p3x, p3y);
-				cairo_pattern_line_to(mpat, p4x, p4y);
-				cairo_pattern_line_to(mpat, p1x, p1y);
-				cairo_pattern_set_control_point(mpat, 0, gradControlP1.x(),  gradControlP1.y());
-				cairo_pattern_set_control_point(mpat, 1, gradControlP2.x(),  gradControlP2.y());
-				cairo_pattern_set_control_point(mpat, 2, gradControlP3.x(),  gradControlP3.y());
-				cairo_pattern_set_control_point(mpat, 3, gradControlP4.x(),  gradControlP4.y());
+				cairo_pattern_mesh_begin_patch(mpat);
+				cairo_pattern_mesh_move_to(mpat, p1x, p1y);
+				cairo_pattern_mesh_line_to(mpat, p2x, p2y);
+				cairo_pattern_mesh_line_to(mpat, p3x, p3y);
+				cairo_pattern_mesh_line_to(mpat, p4x, p4y);
+				cairo_pattern_mesh_line_to(mpat, p1x, p1y);
+				cairo_pattern_mesh_set_control_point(mpat, 0, gradControlP1.x(),  gradControlP1.y());
+				cairo_pattern_mesh_set_control_point(mpat, 1, gradControlP2.x(),  gradControlP2.y());
+				cairo_pattern_mesh_set_control_point(mpat, 2, gradControlP3.x(),  gradControlP3.y());
+				cairo_pattern_mesh_set_control_point(mpat, 3, gradControlP4.x(),  gradControlP4.y());
 				gradPatchColor1.getRgbF(&r, &g, &b, &a);
-				cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+				cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 				gradPatchColor2.getRgbF(&r, &g, &b, &a);
-				cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
+				cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
 				gradPatchColor3.getRgbF(&r, &g, &b, &a);
-				cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+				cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 				gradPatchColor4.getRgbF(&r, &g, &b, &a);
-				cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-				cairo_pattern_end_patch(mpat);
+				cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+				cairo_pattern_mesh_end_patch(mpat);
 				cairo_pattern_set_filter(mpat, CAIRO_FILTER_GOOD);
 				cairo_set_source(cr, mpat);
 				cairo_paint_with_alpha(cr, 1.0);
@@ -1014,7 +1016,8 @@
 			}
 			else if (fill_gradient.type() == VGradient::diamond)
 			{
-#ifdef HAVE_PRIVATE_CAIRO
+// #ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2) || HAVE_PRIVATE_CAIRO)
 				double p1x = gradControlP1.x();
 				double p1y = gradControlP1.y();
 				double p2x = gradControlP2.x();
@@ -1087,109 +1090,113 @@
 					e4s.setLength(edge4.length() * colorStops[ offset - 1 ]->rampPoint);
 					if (offset == 1)
 					{
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, centerP.x(), centerP.y());
-						cairo_pattern_line_to(mpat, e1.x2(), e1.y2());
-						cairo_pattern_line_to(mpat, e2.x2(), e2.y2());
-						cairo_pattern_line_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_line_to(mpat, e1.x2(), e1.y2());
+						cairo_pattern_mesh_line_to(mpat, e2.x2(), e2.y2());
+#ifdef HAVE_PRIVATE_CAIRO
+						cairo_pattern_mesh_line_to(mpat, centerP.x(), centerP.y());
+#endif
 						qStopColors[0].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, centerP.x(), centerP.y());
-						cairo_pattern_line_to(mpat, e2.x2(), e2.y2());
-						cairo_pattern_line_to(mpat, e3.x2(), e3.y2());
-						cairo_pattern_line_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_line_to(mpat, e2.x2(), e2.y2());
+						cairo_pattern_mesh_line_to(mpat, e3.x2(), e3.y2());
+#ifdef HAVE_PRIVATE_CAIRO
+						cairo_pattern_mesh_line_to(mpat, centerP.x(), centerP.y());
+#endif
 						qStopColors[0].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, centerP.x(), centerP.y());
-						cairo_pattern_line_to(mpat, e3.x2(), e3.y2());
-						cairo_pattern_line_to(mpat, e4.x2(), e4.y2());
-						cairo_pattern_line_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_line_to(mpat, e3.x2(), e3.y2());
+						cairo_pattern_mesh_line_to(mpat, e4.x2(), e4.y2());
+#ifdef HAVE_PRIVATE_CAIRO
+						cairo_pattern_mesh_line_to(mpat, centerP.x(), centerP.y());
+#endif
 						qStopColors[0].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, centerP.x(), centerP.y());
-						cairo_pattern_line_to(mpat, e4.x2(), e4.y2());
-						cairo_pattern_line_to(mpat, e1.x2(), e1.y2());
-						cairo_pattern_line_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, centerP.x(), centerP.y());
+						cairo_pattern_mesh_line_to(mpat, e4.x2(), e4.y2());
+						cairo_pattern_mesh_line_to(mpat, e1.x2(), e1.y2());
+#ifdef HAVE_PRIVATE_CAIRO
+						cairo_pattern_mesh_line_to(mpat, centerP.x(), centerP.y());
+#endif
 						qStopColors[0].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
 					}
 					else
 					{
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, e1s.x2(), e1s.y2());
-						cairo_pattern_line_to(mpat, e1.x2(), e1.y2());
-						cairo_pattern_line_to(mpat, e2.x2(), e2.y2());
-						cairo_pattern_line_to(mpat, e2s.x2(), e2s.y2());
-						cairo_pattern_move_to(mpat, e1s.x2(), e1s.y2());
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, e1s.x2(), e1s.y2());
+						cairo_pattern_mesh_line_to(mpat, e1.x2(), e1.y2());
+						cairo_pattern_mesh_line_to(mpat, e2.x2(), e2.y2());
+						cairo_pattern_mesh_line_to(mpat, e2s.x2(), e2s.y2());
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[offset].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, e2s.x2(), e2s.y2());
-						cairo_pattern_line_to(mpat, e2.x2(), e2.y2());
-						cairo_pattern_line_to(mpat, e3.x2(), e3.y2());
-						cairo_pattern_line_to(mpat, e3s.x2(), e3s.y2());
-						cairo_pattern_move_to(mpat, e2s.x2(), e2s.y2());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, e2s.x2(), e2s.y2());
+						cairo_pattern_mesh_line_to(mpat, e2.x2(), e2.y2());
+						cairo_pattern_mesh_line_to(mpat, e3.x2(), e3.y2());
+						cairo_pattern_mesh_line_to(mpat, e3s.x2(), e3s.y2());
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[offset].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, e3s.x2(), e3s.y2());
-						cairo_pattern_line_to(mpat, e3.x2(), e3.y2());
-						cairo_pattern_line_to(mpat, e4.x2(), e4.y2());
-						cairo_pattern_line_to(mpat, e4s.x2(), e4s.y2());
-						cairo_pattern_move_to(mpat, e3s.x2(), e3s.y2());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, e3s.x2(), e3s.y2());
+						cairo_pattern_mesh_line_to(mpat, e3.x2(), e3.y2());
+						cairo_pattern_mesh_line_to(mpat, e4.x2(), e4.y2());
+						cairo_pattern_mesh_line_to(mpat, e4s.x2(), e4s.y2());
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[offset].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, e4s.x2(), e4s.y2());
-						cairo_pattern_line_to(mpat, e4.x2(), e4.y2());
-						cairo_pattern_line_to(mpat, e1.x2(), e1.y2());
-						cairo_pattern_line_to(mpat, e1s.x2(), e1s.y2());
-						cairo_pattern_move_to(mpat, e4s.x2(), e4s.y2());
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, e4s.x2(), e4s.y2());
+						cairo_pattern_mesh_line_to(mpat, e4.x2(), e4.y2());
+						cairo_pattern_mesh_line_to(mpat, e1.x2(), e1.y2());
+						cairo_pattern_mesh_line_to(mpat, e1s.x2(), e1s.y2());
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						qStopColors[offset].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 						qStopColors[offset-1].getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
 					}
 				}
 				cairo_pattern_set_filter(mpat, CAIRO_FILTER_GOOD);
@@ -1206,7 +1213,8 @@
 			}
 			else if (fill_gradient.type() == VGradient::mesh)
 			{
-#ifdef HAVE_PRIVATE_CAIRO
+// #ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2) || HAVE_PRIVATE_CAIRO)
 				double p3x = gradPatchP3.x();
 				double p3y = gradPatchP3.y();
 				img = cairo_surface_create_similar(cairo_get_target(m_cr), CAIRO_CONTENT_COLOR_ALPHA, p3x, p3y);
@@ -1224,21 +1232,21 @@
 						meshPoint mp2 = meshGradientArray[grow][gcol+1];
 						meshPoint mp3 = meshGradientArray[grow+1][gcol+1];
 						meshPoint mp4 = meshGradientArray[grow+1][gcol];
-						cairo_pattern_begin_patch(mpat);
-						cairo_pattern_move_to(mpat, mp1.gridPoint.x(), mp1.gridPoint.y());
-						cairo_pattern_curve_to(mpat, mp1.controlRight.x(), mp1.controlRight.y(), mp2.controlLeft.x(), mp2.controlLeft.y(), mp2.gridPoint.x(), mp2.gridPoint.y());
-						cairo_pattern_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
-						cairo_pattern_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
-						cairo_pattern_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
+						cairo_pattern_mesh_begin_patch(mpat);
+						cairo_pattern_mesh_move_to(mpat, mp1.gridPoint.x(), mp1.gridPoint.y());
+						cairo_pattern_mesh_curve_to(mpat, mp1.controlRight.x(), mp1.controlRight.y(), mp2.controlLeft.x(), mp2.controlLeft.y(), mp2.gridPoint.x(), mp2.gridPoint.y());
+						cairo_pattern_mesh_curve_to(mpat, mp2.controlBottom.x(), mp2.controlBottom.y(), mp3.controlTop.x(), mp3.controlTop.y(), mp3.gridPoint.x(), mp3.gridPoint.y());
+						cairo_pattern_mesh_curve_to(mpat, mp3.controlLeft.x(), mp3.controlLeft.y(), mp4.controlRight.x(), mp4.controlRight.y(), mp4.gridPoint.x(), mp4.gridPoint.y());
+						cairo_pattern_mesh_curve_to(mpat, mp4.controlTop.x(), mp4.controlTop.y(), mp1.controlBottom.x(), mp1.controlBottom.y(), mp1.gridPoint.x(), mp1.gridPoint.y());
 						mp1.color.getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 0, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 0, r, g, b, a);
 						mp2.color.getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 1, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 1, r, g, b, a);
 						mp3.color.getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 2, r, g, b, a);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 2, r, g, b, a);
 						mp4.color.getRgbF(&r, &g, &b, &a);
-						cairo_pattern_set_corner_color_rgba(mpat, 3, r, g, b, a);
-						cairo_pattern_end_patch(mpat);
+						cairo_pattern_mesh_set_corner_color_rgba(mpat, 3, r, g, b, a);
+						cairo_pattern_mesh_end_patch(mpat);
 					}
 				}
 				cairo_pattern_set_filter(mpat, CAIRO_FILTER_BEST);
@@ -1384,7 +1392,8 @@
 				cairo_paint_with_alpha (m_cr, fill_trans);
 			}
 			cairo_pattern_destroy (pat);
-#ifdef HAVE_PRIVATE_CAIRO
+// #ifdef HAVE_PRIVATE_CAIRO
+#if (CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)  || HAVE_PRIVATE_CAIRO)
 			if ((fill_gradient.type() == VGradient::fourcolor) || (fill_gradient.type() == VGradient::diamond) || (fill_gradient.type() == VGradient::mesh))
 			{
 				cairo_surface_destroy(img);

Modified: trunk/Scribus/scribus/third_party/cairo/cairo-pattern.c
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16297&path=/trunk/Scribus/scribus/third_party/cairo/cairo-pattern.c
==============================================================================
--- trunk/Scribus/scribus/third_party/cairo/cairo-pattern.c (original)
+++ trunk/Scribus/scribus/third_party/cairo/cairo-pattern.c Sun Jan 23 21:27:29 2011
@@ -1157,7 +1157,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_begin_patch (cairo_pattern_t *pattern)
+cairo_pattern_mesh_begin_patch (cairo_pattern_t *pattern)
 {
     cairo_mesh_pattern_t *mesh;
     cairo_status_t status;
@@ -1258,7 +1258,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_end_patch (cairo_pattern_t *pattern)
+cairo_pattern_mesh_end_patch (cairo_pattern_t *pattern)
 {
     cairo_mesh_pattern_t *mesh;
     int i;
@@ -1279,7 +1279,7 @@
 	return;
 
     while (mesh->current_side  < 3) {
-	cairo_pattern_line_to (pattern,
+	cairo_pattern_mesh_line_to (pattern,
 			       mesh->current_patch->points[0][0][0],
 			       mesh->current_patch->points[0][0][1]);
 	mesh->current_patch->colors[mesh->current_side] = mesh->current_patch->colors[0];
@@ -1315,7 +1315,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_curve_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_curve_to (cairo_pattern_t *pattern,
 			double x1,
 			double y1,
 			double x2,
@@ -1392,7 +1392,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_line_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_line_to (cairo_pattern_t *pattern,
 		       double x,
 		       double y)
 {
@@ -1459,7 +1459,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_move_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_move_to (cairo_pattern_t *pattern,
 		       double x,
 		       double y)
 {
@@ -1496,7 +1496,7 @@
  * Since: XXX
  **/
 cairo_public void
-cairo_pattern_set_control_point (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_control_point (cairo_pattern_t *pattern,
 				 int              point_num,
 				 double           x,
 				 double           y)
@@ -1624,7 +1624,7 @@
  * %CAIRO_STATUS_PATTERN_TYPE_MISMATCH.
  **/
 void
-cairo_pattern_set_corner_color_rgb (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_corner_color_rgb (cairo_pattern_t *pattern,
 				    int              corner_num,
 				    double red, double green, double blue)
 {
@@ -1665,7 +1665,7 @@
  * %CAIRO_STATUS_PATTERN_TYPE_MISMATCH.
  **/
 void
-cairo_pattern_set_corner_color_rgba (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_corner_color_rgba (cairo_pattern_t *pattern,
 				     int              corner_num,
 				     double red, double green, double blue,
 				     double alpha)

Modified: trunk/Scribus/scribus/third_party/cairo/cairo.h
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16297&path=/trunk/Scribus/scribus/third_party/cairo/cairo.h
==============================================================================
--- trunk/Scribus/scribus/third_party/cairo/cairo.h (original)
+++ trunk/Scribus/scribus/third_party/cairo/cairo.h Sun Jan 23 21:27:29 2011
@@ -2298,13 +2298,13 @@
 cairo_pattern_get_type (cairo_pattern_t *pattern);
 
 cairo_public void
-cairo_pattern_begin_patch (cairo_pattern_t *pattern);
-
-cairo_public void
-cairo_pattern_end_patch (cairo_pattern_t *pattern);
-
-cairo_public void
-cairo_pattern_curve_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_begin_patch (cairo_pattern_t *pattern);
+
+cairo_public void
+cairo_pattern_mesh_end_patch (cairo_pattern_t *pattern);
+
+cairo_public void
+cairo_pattern_mesh_curve_to (cairo_pattern_t *pattern,
 			double x1,
 			double y1,
 			double x2,
@@ -2313,28 +2313,28 @@
 			double y3);
 
 cairo_public void
-cairo_pattern_line_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_line_to (cairo_pattern_t *pattern,
 		       double x,
 		       double y);
 
 cairo_public void
-cairo_pattern_move_to (cairo_pattern_t *pattern,
+cairo_pattern_mesh_move_to (cairo_pattern_t *pattern,
 		       double x,
 		       double y);
 
 cairo_public void
-cairo_pattern_set_control_point (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_control_point (cairo_pattern_t *pattern,
 				 int point_num,
 				 double x,
 				 double y);
 
 cairo_public void
-cairo_pattern_set_corner_color_rgb (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_corner_color_rgb (cairo_pattern_t *pattern,
 				    int point_num,
 				    double red, double green, double blue);
 
 cairo_public void
-cairo_pattern_set_corner_color_rgba (cairo_pattern_t *pattern,
+cairo_pattern_mesh_set_corner_color_rgba (cairo_pattern_t *pattern,
 				     int point_num,
 				     double red, double green, double blue,
 				     double alpha);




More information about the scribus-commit mailing list