summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNiko Kiirala <niko@kiirala.com>2007-06-07 17:52:46 +0000
committerkiirala <kiirala@users.sourceforge.net>2007-06-07 17:52:46 +0000
commit5218177333e18e96af6695ac1e6a658b311b5f05 (patch)
tree436e12913a82eb7c327e0d47c8bd9b8c00d4c1a9 /src
parentFirst version of feOffset support. Contains some rendering glitches. (diff)
downloadinkscape-5218177333e18e96af6695ac1e6a658b311b5f05.tar.gz
inkscape-5218177333e18e96af6695ac1e6a658b311b5f05.zip
Fixed background access problems introduced in previous revision
(bzr r3056)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-arena-item.cpp10
-rw-r--r--src/display/nr-filter-slot.cpp14
2 files changed, 16 insertions, 8 deletions
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index a4fdcf5bc..d98bbaf3a 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -414,10 +414,9 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
/* If background access is used, save the pixblock address.
* This address is set to NULL at the end of this block */
- if (item->background_new) {
+ if (item->background_new ||
+ (item->parent && item->parent->background_pb)) {
item->background_pb = &ipb;
- } else if (item->parent && item->parent->background_pb) {
- item->background_pb = item->parent->background_pb;
}
ipb.visible_area = pb->visible_area;
unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (ct, item, &carea, &ipb, flags);
@@ -540,9 +539,6 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
nr_blit_pixblock_pixblock_mask (dpb, &ipb, &mpb);
}
nr_pixblock_release (&mpb);
- /* This pointer wouldn't be valid outside this block, so clear it */
- item->background_pb = NULL;
-
} else {
if (item->render_opacity) { // opacity was already rendered in, just copy to dpb here
nr_blit_pixblock_pixblock(dpb, &ipb);
@@ -552,6 +548,8 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
}
nr_pixblock_release (&ipb);
dpb->empty = FALSE;
+ /* This pointer wouldn't be valid outside this block, so clear it */
+ item->background_pb = NULL;
} else {
/* Just render */
unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (ct, item, &carea, dpb, flags);
diff --git a/src/display/nr-filter-slot.cpp b/src/display/nr-filter-slot.cpp
index 250aee10b..32fc00f99 100644
--- a/src/display/nr-filter-slot.cpp
+++ b/src/display/nr-filter-slot.cpp
@@ -16,9 +16,10 @@
#include <assert.h>
#include "display/nr-arena-item.h"
-#include "libnr/nr-pixblock.h"
#include "display/nr-filter-types.h"
#include "display/nr-filter-slot.h"
+#include "libnr/nr-pixblock.h"
+#include "libnr/nr-blit.h"
namespace NR {
@@ -71,7 +72,16 @@ NRPixBlock *FilterSlot::get(int slot_nr)
NRPixBlock *pb;
pb = nr_arena_item_get_background(_arena_item);
if (pb) {
- this->set(NR_FILTER_BACKGROUNDIMAGE, pb);
+ NRPixBlock *bg = new NRPixBlock;
+ nr_pixblock_setup_fast(bg, pb->mode,
+ pb->area.x0, pb->area.y0,
+ pb->area.x1, pb->area.y1, true);
+ bool empty = pb->empty;
+ pb->empty = false;
+ nr_blit_pixblock_pixblock(bg, pb);
+ pb->empty = empty;
+ bg->empty = false;
+ this->set(NR_FILTER_BACKGROUNDIMAGE, bg);
} else {
NRPixBlock *source = this->get(NR_FILTER_SOURCEGRAPHIC);
pb = new NRPixBlock();