Author: Nikita Kitaev <[email protected]>
Date: Sun Apr 10 15:02:59 2011 -0700
Add a fallback when CAIRO_OPERATOR_DIFFERENCE is not supported
---
.../src/gui/workarearenderer/renderer_bbox.cpp | 9 +++++++--
.../src/gui/workarearenderer/renderer_ducks.cpp | 11 +++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
b/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
index 95d6325..6a0c29c 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_bbox.cpp
@@ -104,9 +104,14 @@ Renderer_BBox::render_vfunc(
cr->set_line_width(1.0);
cr->set_source_rgb(1.0,1.0,1.0);
- // OPERATOR_DIFFERENCE does not currently have a C++ wrapper
- //cr->set_operator(Cairo::OPERATOR_DIFFERENCE);
+ // Operator difference was added in Cairo 1.9.4
+ // It currently isn't supported by Cairomm
+#if CAIRO_VERSION >= 10904
cairo_set_operator(cr->cobj(), CAIRO_OPERATOR_DIFFERENCE);
+#else
+ // Fallback: set color to black
+ cr->set_source_rgb(0,0,0);
+#endif
cr->rectangle(
tl[0],
diff --git a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
index 9ed5ec0..788ca81 100644
--- a/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
+++ b/synfig-studio/src/gui/workarearenderer/renderer_ducks.cpp
@@ -406,9 +406,16 @@ Renderer_Ducks::render_vfunc(
else
{
cr->set_source_rgb(1.0,1.0,1.0);
- // OPERATOR_DIFFERENCE does not currently have
a C++ wrapper
- //cr->set_operator(Cairo::OPERATOR_DIFFERENCE);
+
+ // Operator difference was added in Cairo 1.9.4
+ // It currently isn't supported by Cairomm
+#if CAIRO_VERSION >= 10904
cairo_set_operator(cr->cobj(),
CAIRO_OPERATOR_DIFFERENCE);
+#else
+ // Fallback: set color to black
+ cr->set_source_rgb(0,0,0);
+#endif
+
}
cr->set_line_width(1.0);
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl