-void GlowEffect::add_self_to_effect_chain(EffectChain *chain, const std::vector<Effect *> &inputs) {
- assert(inputs.size() == 1);
- blur->add_self_to_effect_chain(chain, inputs);
+void GlowEffect::rewrite_graph(EffectChain *graph, Node *self)
+{
+ assert(self->incoming_links.size() == 1);
+ Node *input = self->incoming_links[0];
+
+ Node *blur_node = graph->add_node(blur);
+ Node *mix_node = graph->add_node(mix);
+ Node *cutoff_node = graph->add_node(cutoff);
+ graph->replace_receiver(self, mix_node);
+ graph->connect_nodes(input, cutoff_node);
+ graph->connect_nodes(cutoff_node, blur_node);
+ graph->connect_nodes(blur_node, mix_node);
+ graph->replace_sender(self, mix_node);