[lasem] svg_view: avoid a possible push_filter from primitive_element.



commit 8bb0879885242bfb16ae7d7aec60c119b693ced3
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Sun Oct 14 12:40:55 2012 +0200

    svg_view: avoid a possible push_filter from primitive_element.

 src/lsmsvgfilterprimitive.c |    4 ++++
 src/lsmsvgview.c            |   29 +++++++++++++++++++++++------
 src/lsmsvgview.h            |    4 ++++
 3 files changed, 31 insertions(+), 6 deletions(-)
---
diff --git a/src/lsmsvgfilterprimitive.c b/src/lsmsvgfilterprimitive.c
index 536bc6e..77f41ef 100644
--- a/src/lsmsvgfilterprimitive.c
+++ b/src/lsmsvgfilterprimitive.c
@@ -60,9 +60,13 @@ lsm_svg_filter_primitive_apply  (LsmSvgFilterPrimitive *self, LsmSvgView *view)
 	parent_style = lsm_svg_view_get_current_style (view);
 	style = lsm_svg_style_new_inherited (parent_style, &(LSM_SVG_ELEMENT (self))->property_bag);
 
+	lsm_svg_view_push_style_only (view, style);
+
 	if (primitive_class->apply != NULL)
 		primitive_class->apply (self, view, self->in.value, self->result.value, x, y, w, h);
 
+	lsm_svg_view_pop_style_only (view);
+
 	lsm_svg_style_unref (style);
 }
 
diff --git a/src/lsmsvgview.c b/src/lsmsvgview.c
index 8457a95..e01836f 100644
--- a/src/lsmsvgview.c
+++ b/src/lsmsvgview.c
@@ -2167,7 +2167,7 @@ lsm_svg_view_circular_reference_check (LsmSvgView *view, LsmSvgElement *element)
 }
 
 void
-lsm_svg_view_push_style	(LsmSvgView *view, LsmSvgStyle *style)
+lsm_svg_view_push_style_only (LsmSvgView *view, LsmSvgStyle *style)
 {
 	g_return_if_fail (LSM_IS_SVG_VIEW (view));
 	g_return_if_fail (style != NULL);
@@ -2203,6 +2203,16 @@ lsm_svg_view_push_style	(LsmSvgView *view, LsmSvgStyle *style)
 	view->style_stack = g_slist_prepend (view->style_stack, (void *) style);
 	view->style = style;
 
+}
+
+void
+lsm_svg_view_push_style	(LsmSvgView *view, LsmSvgStyle *style)
+{
+	g_return_if_fail (LSM_IS_SVG_VIEW (view));
+	g_return_if_fail (style != NULL);
+
+	lsm_svg_view_push_style_only (view, style);
+
 	if (g_strcmp0 (style->filter->value, "none") != 0) {
 		lsm_debug_render ("[LsmSvgView::push_style] Start filter '%s'", style->filter->value);
 		lsm_svg_view_push_filter (view);
@@ -2219,11 +2229,21 @@ lsm_svg_view_push_style	(LsmSvgView *view, LsmSvgStyle *style)
 	}
 }
 
-void lsm_svg_view_pop_style (LsmSvgView *view)
+void lsm_svg_view_pop_style_only (LsmSvgView *view)
 {
 	g_return_if_fail (LSM_IS_SVG_VIEW (view));
 	g_return_if_fail (view->style_stack != NULL);
 
+	view->style_stack = g_slist_delete_link (view->style_stack, view->style_stack);
+	view->style = view->style_stack != NULL ? view->style_stack->data : NULL;
+
+	lsm_log_render ("[SvgView::pop_style]");
+}
+
+void lsm_svg_view_pop_style (LsmSvgView *view)
+{
+	g_return_if_fail (LSM_IS_SVG_VIEW (view));
+
 	if (g_strcmp0 (view->style->mask->value, "none") != 0)
 		lsm_svg_view_pop_mask (view);
 
@@ -2234,10 +2254,7 @@ void lsm_svg_view_pop_style (LsmSvgView *view)
 		lsm_svg_view_pop_filter (view);
 	}
 
-	view->style_stack = g_slist_delete_link (view->style_stack, view->style_stack);
-	view->style = view->style_stack != NULL ? view->style_stack->data : NULL;
-
-	lsm_log_render ("[SvgView::pop_style]");
+	lsm_svg_view_pop_style_only (view);
 }
 
 LsmSvgStyle *
diff --git a/src/lsmsvgview.h b/src/lsmsvgview.h
index b247050..cde1146 100644
--- a/src/lsmsvgview.h
+++ b/src/lsmsvgview.h
@@ -147,11 +147,15 @@ void		lsm_svg_view_pop_element		(LsmSvgView *view);
 void 		lsm_svg_view_push_group_opacity 	(LsmSvgView *view);
 void 		lsm_svg_view_pop_group_opacity 		(LsmSvgView *view);
 
+void		lsm_svg_view_push_style_only		(LsmSvgView *view, LsmSvgStyle *style);
+void		lsm_svg_view_pop_style_only		(LsmSvgView *view);
 void		lsm_svg_view_push_style			(LsmSvgView *view, LsmSvgStyle *style);
 void		lsm_svg_view_pop_style			(LsmSvgView *view);
 
 LsmSvgStyle *	lsm_svg_view_get_current_style	(LsmSvgView *view);
 
+void 		lsm_svg_view_apply_flood 		(LsmSvgView *view, const char *output,
+							 double x, double y, double w, double h);
 void		lsm_svg_view_apply_gaussian_blur 	(LsmSvgView *view, const char *input, const char *output,
 							 double x, double y, double w, double h,
 							 double std_x, double std_y);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]