index 0657144eddbacdc17ceb4274e9d8c6d56c580eaa..f449acf4a741e2ac44cc9e07d22b6cc92c01a09e 100644 (file)
/* Clipping */
if (item->clip) {
- unsigned int newstate = nr_arena_item_invoke_update (item->clip, area, &childgc, state, reset);
+ // FIXME: since here we only need bbox, consider passing
+ // ((state & !(NR_ARENA_ITEM_STATE_RENDER)) | NR_ARENA_ITEM_STATE_BBOX)
+ // instead of state, so it does not have to create rendering structures in nr_arena_shape_update
+ unsigned int newstate = nr_arena_item_invoke_update (item->clip, area, &childgc, state, reset);
if (newstate & NR_ARENA_ITEM_STATE_INVALID) {
item->state |= NR_ARENA_ITEM_STATE_INVALID;
return item->state;
*/
unsigned int
-nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area,
+nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area,
NRPixBlock *pb, unsigned int flags)
{
bool outline = (item->arena->rendermode == RENDERMODE_OUTLINE);
TRUE);
// if memory allocation failed, abort render
- if (ipb.data.px == NULL) {
+ if (ipb.size != NR_PIXBLOCK_SIZE_TINY && ipb.data.px == NULL) {
nr_pixblock_release (&ipb);
return (item->state);
}
item->background_pb = &ipb;
}
ipb.visible_area = pb->visible_area;
- unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (item, &carea, &ipb, flags);
+ 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 */
nr_pixblock_release (&ipb);
if (tpb.data.px != NULL) { // if memory allocation was successful
tpb.visible_area = pb->visible_area;
- unsigned int state = NR_ARENA_ITEM_VIRTUAL (item->mask, render) (item->mask, &carea, &tpb, flags);
+ unsigned int state = NR_ARENA_ITEM_VIRTUAL (item->mask, render) (ct, item->mask, &carea, &tpb, flags);
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
nr_pixblock_release (&tpb);
// Render clipped or masked object in outline mode:
// First, render the object itself
- unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (item, &carea, dpb, flags);
+ unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (ct, item, &carea, dpb, flags);
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
if (dpb != pb)
// render clippath as an object, using a different color
if (item->clip) {
item->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "clips", 0x00ff00ff); // green clips
- NR_ARENA_ITEM_VIRTUAL (item->clip, render) (item->clip, &carea, dpb, flags);
+ NR_ARENA_ITEM_VIRTUAL (item->clip, render) (ct, item->clip, &carea, dpb, flags);
}
// render mask as an object, using a different color
if (item->mask) {
item->arena->outlinecolor = prefs_get_int_attribute("options.wireframecolors", "masks", 0x0000ffff); // blue masks
- NR_ARENA_ITEM_VIRTUAL (item->mask, render) (item->mask, &carea, dpb, flags);
+ NR_ARENA_ITEM_VIRTUAL (item->mask, render) (ct, item->mask, &carea, dpb, flags);
}
item->arena->outlinecolor = saved_rgba; // restore outline color
dpb->empty = FALSE;
} else {
/* Just render */
- unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (item, &carea, dpb, flags);
+ unsigned int state = NR_ARENA_ITEM_VIRTUAL (item, render) (ct, item, &carea, dpb, flags);
if (state & NR_ARENA_ITEM_STATE_INVALID) {
/* Clean up and return error */
if (dpb != pb)
item->background_pb->area.y0,
item->background_pb->area.x1,
item->background_pb->area.y1, true);
- if (pb->data.px == NULL) // allocation failed
+ if (pb->size != NR_PIXBLOCK_SIZE_TINY && pb->data.px == NULL) // allocation failed
return NULL;
} else if (item->parent) {
pb = nr_arena_item_get_background (item->parent, depth + 1);