Code

patch by Dennis Lin: optionally for debugging paint the rect-to-redraw yellow
[inkscape.git] / src / display / nr-arena-item.cpp
index a4fdcf5bc93fcc4fee527fde396240b7c030d324..ddde4102e60eea8f309dae65048e6d69c6127ed4 100644 (file)
@@ -414,12 +414,16 @@ 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;
+        if (item->filter) {
+              item->filter->area_enlarge (ipb.visible_area, item->ctm);
+        }
+
         unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (ct, item, &carea, &ipb, flags);
         if (state & NR_ARENA_ITEM_STATE_INVALID) {
             /* Clean up and return error */
@@ -540,9 +544,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 +553,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);
@@ -827,6 +830,15 @@ nr_arena_item_set_order (NRArenaItem *item, int order)
     nr_arena_item_set_child_position (item->parent, item, ref);
 }
 
+void
+nr_arena_item_set_item_bbox (NRArenaItem *item, NR::Maybe<NR::Rect> &bbox)
+{
+    nr_return_if_fail(item != NULL);
+    nr_return_if_fail(NR_IS_ARENA_ITEM(item));
+
+    item->item_bbox = bbox;
+}
+
 /** Returns a background image for use with filter effects. */
 NRPixBlock *
 nr_arena_item_get_background (NRArenaItem const *item, int depth)