index 84ed621dbebe904b54a8b7d60a62faee29df16a4..00203024cebf1459dbbeff5709d7428230dc439a 100644 (file)
arena->root = NRArenaGroup::create(arena->arena);
nr_arena_group_set_transparent (NR_ARENA_GROUP (arena->root), TRUE);
-#ifdef arena_item_tile_cache
- arena->root->skipCaching=true;
-#endif
-
arena->active = NULL;
nr_active_object_add_listener ((NRActiveObject *) arena->arena, (NRObjectEventVector *) &carenaev, sizeof (carenaev), arena);
@@ -186,10 +182,6 @@ sp_canvas_arena_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned i
}
}
-#ifdef arena_item_tile_cache
-extern void age_cache(void);
-#endif
-
static void
sp_canvas_arena_render (SPCanvasItem *item, SPCanvasBuf *buf)
{
sp_canvas_prepare_buffer(buf);
-#ifdef arena_item_tile_cache
- age_cache();
-#endif
bw = buf->rect.x1 - buf->rect.x0;
bh = buf->rect.y1 - buf->rect.y0;
if ((bw < 1) || (bh < 1)) return;
+ // FIXME: currently this function is a huge waste. It receives a buffer but creates a new one and loops
+ // within the large one, doing arena painting in several blocks. This just makes no sense because the
+ // buf that we are given is already only a strip of the screen, created by one iteration of a loop in
+ // sp_canvas_paint_rect_internal. With the current numbers, this function's buffer is always 1/4
+ // smaller than the one we get, because they both are the same number of bytes but
+ // buf uses 3 bytes per pixel (24bpp, packed) while the pixblock created here uses 4 bytes (32bpp).
+ // Eventually I want to switch buf to using 4 bytes (see comment in canvas.cpp) and then remove
+ // from here the sw/sh calculation, the loop, and creating the intermediate buffer, allowing arena
+ // just render into buf in one go.
+
if (arena->arena->rendermode != RENDERMODE_OUTLINE) { // use 256K as a compromise to not slow down gradients
/* 256K is the cached buffer and we need 4 channels */
if (bw * bh < 65536) { // 256K/4
}
}
-/* fixme: RGB transformed bitmap blit is not implemented (Lauris) */
-/* And even if it would be, unless it uses MMX there is little reason to go RGB */
+/*
+This define chooses between two modes: When on, arena renders into a temporary
+32bpp buffer, and the result is then squished into the SPCanvasBuf. When off, arena
+renders directly to SPCanvasBuf. However currently this gives no speed advantage,
+perhaps because the lack of squishing is offset by the need for arena items to render
+to the inconvenient (and probably slower) 24bpp buffer. When SPCanvasBuf is
+switched to 32bpp and cairo drawing, however, this define should be removed to
+streamline rendering.
+*/
#define STRICT_RGBA
for (y = buf->rect.y0; y < buf->rect.y1; y += sh) {
pb.empty = FALSE;
#endif
+// CAIRO FIXME: switch this to R8G8B8A8P and 4 * ...
nr_pixblock_setup_extern (&cb, NR_PIXBLOCK_MODE_R8G8B8, area.x0, area.y0, area.x1, area.y1,
buf->buf + (y - buf->rect.y0) * buf->buf_rowstride + 3 * (x - buf->rect.x0),
buf->buf_rowstride,
#ifdef STRICT_RGBA
pb.visible_area = buf->visible_rect;
if (pb.data.px != NULL) {
- nr_arena_item_invoke_render (arena->root, &area, &pb, 0);
+ nr_arena_item_invoke_render (NULL, arena->root, &area, &pb, 0);
+ // this does the 32->24 squishing, using an assembler routine:
nr_blit_pixblock_pixblock (&cb, &pb);
}
nr_pixblock_release (&pb);
#else
- cb.visible_area = buf->visible_rect;
- nr_arena_item_invoke_render (arena->root, &area, &cb, 0);
+ cb.visible_area = buf->visible_rect;
+ nr_arena_item_invoke_render (NULL, arena->root, &area, &cb, 0);
#endif
nr_pixblock_release (&cb);
area.x1 = pb->area.x1;
area.y1 = pb->area.y1;
- nr_arena_item_invoke_render (ca->root, &area, pb, 0);
+ nr_arena_item_invoke_render (NULL, ca->root, &area, pb, 0);
}