From 62d31275d48feeac9615611451ff4c9b724465e0 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Fri, 20 Oct 2006 06:59:40 +0000 Subject: [PATCH] handle the case of no filter primitives --- src/display/nr-filter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/display/nr-filter.cpp b/src/display/nr-filter.cpp index 328b5c12a..592623c49 100644 --- a/src/display/nr-filter.cpp +++ b/src/display/nr-filter.cpp @@ -85,6 +85,10 @@ Filter::~Filter() int Filter::render(NRArenaItem const *item, NRPixBlock *pb) { + if(!_primitive[0]) { // if there are no primitives, do nothing + return 0; + } + Matrix trans = *item->ctm; FilterSlot slot(_slot_count, item); NRPixBlock *in = new NRPixBlock; @@ -134,10 +138,8 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb) slot.set(NR_FILTER_SOURCEGRAPHIC, in); in = NULL; // in is now handled by FilterSlot, we should not touch it - // TODO: loop through the primitives and render them one at a time - if(_primitive[0]) - _primitive[0]->render(slot, trans); - + // TODO: loop through ALL the primitives and render them one at a time + _primitive[0]->render(slot, trans); NRPixBlock *out = slot.get(_output_slot); // Clear the pixblock, where the output will be put -- 2.30.2