index d38e44929269d10ee78d139052b68e363b4f7c49..103315c5eadd2ca4f316cc6c1e53b4938259dfa2 100644 (file)
#include "gc-soft-ptr.h"
#include "nr-arena-forward.h"
#include "display/nr-filter.h"
-
-// My testing shows that disabling cache reduces the amount
-// of leaked memory when many documents are loaded one from the other,
-// while there's no noticeable change in speed
-//#define arena_item_tile_cache
+#include <cairo.h>
struct NRGC {
NRGC(NRGC const *p) : parent(p) {}
/* Key for secondary rendering */
unsigned int key;
-#ifdef arena_item_tile_cache
- bool skipCaching;
- double activity;
-#endif
-
/* BBox in grid coordinates */
NRRectL bbox;
/* Our affine */
/* Current Transformation Matrix */
NR::Matrix ctm;
+ /* These hold background buffer state for filter rendering */
+ NRPixBlock *background_pb;
+ bool background_new;
+
void init(NRArena *arena) {
this->arena = arena;
}
void (* set_child_position) (NRArenaItem *item, NRArenaItem *child, NRArenaItem *ref);
unsigned int (* update) (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
- unsigned int (* render) (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
+ unsigned int (* render) (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags);
unsigned int (* clip) (NRArenaItem *item, NRRectL *area, NRPixBlock *pb);
NRArenaItem * (* pick) (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky);
};
@@ -157,7 +152,7 @@ void nr_arena_item_set_child_position (NRArenaItem *item, NRArenaItem *child, NR
unsigned int nr_arena_item_invoke_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset);
-unsigned int nr_arena_item_invoke_render(NRArenaItem *item, NRRectL const *area, NRPixBlock *pb, unsigned int flags);
+unsigned int nr_arena_item_invoke_render(cairo_t *ct, NRArenaItem *item, NRRectL const *area, NRPixBlock *pb, unsigned int flags);
unsigned int nr_arena_item_invoke_clip (NRArenaItem *item, NRRectL *area, NRPixBlock *pb);
NRArenaItem *nr_arena_item_invoke_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky);
void nr_arena_item_set_mask (NRArenaItem *item, NRArenaItem *mask);
void nr_arena_item_set_order (NRArenaItem *item, int order);
+NRPixBlock *nr_arena_item_get_background (NRArenaItem const *item, int depth = 0);
+
/* Helpers */
NRArenaItem *nr_arena_item_attach (NRArenaItem *parent, NRArenaItem *child, NRArenaItem *prev, NRArenaItem *next);