index b4cc3930b1a5ad4807ee79bf040065c976801a35..912992a6e38bc88633a32e13d13d5f4b9138b7d0 100644 (file)
#include "display/nr-arena-group.h"
#include "display/nr-filter.h"
#include "display/nr-arena-group.h"
#include "display/nr-filter.h"
+#include "display/nr-filter-gaussian.h"
+#include "display/nr-filter-types.h"
#include "style.h"
#include "style.h"
+#include "sp-filter.h"
+#include "sp-filter-reference.h"
+#include "sp-gaussian-blur.h"
+#include "sp-feblend.h"
+#include "display/nr-filter-blend.h"
static void nr_arena_group_class_init (NRArenaGroupClass *klass);
static void nr_arena_group_init (NRArenaGroup *group);
static void nr_arena_group_class_init (NRArenaGroupClass *klass);
static void nr_arena_group_init (NRArenaGroup *group);
static void nr_arena_group_set_child_position (NRArenaItem *item, NRArenaItem *child, NRArenaItem *ref);
static unsigned int nr_arena_group_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
static void nr_arena_group_set_child_position (NRArenaItem *item, NRArenaItem *child, NRArenaItem *ref);
static unsigned int nr_arena_group_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
-static unsigned int nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
+static unsigned int nr_arena_group_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
static unsigned int nr_arena_group_clip (NRArenaItem *item, NRRectL *area, NRPixBlock *pb);
static NRArenaItem *nr_arena_group_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky);
static unsigned int nr_arena_group_clip (NRArenaItem *item, NRRectL *area, NRPixBlock *pb);
static NRArenaItem *nr_arena_group_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky);
group->last = NULL;
group->style = NULL;
nr_matrix_set_identity (&group->child_transform);
group->last = NULL;
group->style = NULL;
nr_matrix_set_identity (&group->child_transform);
-
-#ifdef arena_item_tile_cache
- group->skipCaching=true;
-#endif
-
}
static NRArenaItem *
}
static NRArenaItem *
@@ -186,25 +188,34 @@ nr_arena_group_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int
void nr_arena_group_set_style (NRArenaGroup *group, SPStyle *style)
{
void nr_arena_group_set_style (NRArenaGroup *group, SPStyle *style)
{
- g_return_if_fail(group != NULL);
- g_return_if_fail(NR_IS_ARENA_GROUP(group));
-
- if (style) sp_style_ref(style);
- if (group->style) sp_style_unref(group->style);
- group->style = style;
-
- if (style && style->filter.set && style->filter.filter) {
- group->filter = new NR::Filter();
- }
-
- if (style && style->enable_background.set
- && style->enable_background.value == SP_CSS_BACKGROUND_NEW) {
- group->background_new = true;
- }
+ g_return_if_fail(group != NULL);
+ g_return_if_fail(NR_IS_ARENA_GROUP(group));
+
+ if (style) sp_style_ref(style);
+ if (group->style) sp_style_unref(group->style);
+ group->style = style;
+
+ //if group has a filter
+ if (style->filter.set && style->getFilter()) {
+ if (!group->filter) {
+ int primitives = sp_filter_primitive_count(SP_FILTER(style->getFilter()));
+ group->filter = new NR::Filter(primitives);
+ }
+ sp_filter_build_renderer(SP_FILTER(style->getFilter()), group->filter);
+ } else {
+ //no filter set for this group
+ delete group->filter;
+ group->filter = NULL;
+ }
+
+ if (style && style->enable_background.set
+ && style->enable_background.value == SP_CSS_BACKGROUND_NEW) {
+ group->background_new = true;
+ }
}
static unsigned int
}
static unsigned int
-nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags)
+nr_arena_group_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags)
{
NRArenaGroup *group = NR_ARENA_GROUP (item);
{
NRArenaGroup *group = NR_ARENA_GROUP (item);
@@ -212,7 +223,7 @@ nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigne
/* Just compose children into parent buffer */
for (NRArenaItem *child = group->children; child != NULL; child = child->next) {
/* Just compose children into parent buffer */
for (NRArenaItem *child = group->children; child != NULL; child = child->next) {
- ret = nr_arena_item_invoke_render (child, area, pb, flags);
+ ret = nr_arena_item_invoke_render (ct, child, area, pb, flags);
if (ret & NR_ARENA_ITEM_STATE_INVALID) break;
}
if (ret & NR_ARENA_ITEM_STATE_INVALID) break;
}
@@ -275,4 +286,13 @@ void nr_arena_group_set_child_transform(NRArenaGroup *group, NRMatrix const *t)
}
}
}
}
-
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :