summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-13 21:09:35 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-13 21:09:35 +0000
commit7a6b02a54a5516ff17662352903a928f5f5f7afb (patch)
tree5daeebaf57a6037c6cab829504664b146d650428
parentCompute different bounding boxes in outline mode to fix partial (diff)
downloadinkscape-7a6b02a54a5516ff17662352903a928f5f5f7afb.tar.gz
inkscape-7a6b02a54a5516ff17662352903a928f5f5f7afb.zip
Fix crashes during offscreen rendering, part 1
(bzr r10347.1.12)
-rw-r--r--src/display/nr-arena-item.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index 7e19b9f52..9ca5a7463 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -496,7 +496,15 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
// 4. Apply filter.
if (item->filter && filter) {
- NRRectL bgarea(item->arena->canvasarena->cache_area);
+ // HACK: SPCanvasArena doesn't exist when this is called for offscreen rendering
+ // Proper fix: call this function with a drawing context class
+ // that contains information about the surface's bounds
+ NRRectL bgarea;
+ if (flags & NR_ARENA_ITEM_RENDER_NO_CACHE || !item->arena->canvasarena) {
+ bgarea = carea;
+ } else {
+ bgarea = NRRectL(item->arena->canvasarena->cache_area);
+ }
item->filter->render(item, ct, &bgarea, ict, &carea);
// Note that because the object was rendered to a group,
// the internals of the filter need to use cairo_get_group_target()