From: buliabyak Date: Thu, 1 Mar 2007 06:19:16 +0000 (+0000) Subject: API change: render methods now take a cairo_t (not yet used) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=db1ea68b1534424e75ea5d9cfc4246e4a134dc67;p=inkscape.git API change: render methods now take a cairo_t (not yet used) --- diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 3e01a7498..5cd5df143 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -798,7 +798,7 @@ clonetiler_trace_pick (NR::Rect box) nr_pixblock_setup_extern( &pb, NR_PIXBLOCK_MODE_R8G8B8A8N, ibox.x0, ibox.y0, ibox.x1, ibox.y1, px, 4 * width, FALSE, FALSE ); - nr_arena_item_invoke_render( trace_root, &ibox, &pb, + nr_arena_item_invoke_render(NULL, trace_root, &ibox, &pb, NR_ARENA_ITEM_RENDER_NO_CACHE ); double R = 0, G = 0, B = 0, A = 0; diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index 863d86f7c..00203024c 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -287,14 +287,14 @@ streamline rendering. #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); @@ -458,6 +458,6 @@ sp_canvas_arena_render_pixblock (SPCanvasArena *ca, NRPixBlock *pb) 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); } diff --git a/src/display/nr-arena-glyphs.cpp b/src/display/nr-arena-glyphs.cpp index a29c44ee1..b061e9acd 100644 --- a/src/display/nr-arena-glyphs.cpp +++ b/src/display/nr-arena-glyphs.cpp @@ -313,7 +313,7 @@ static void nr_arena_glyphs_group_init(NRArenaGlyphsGroup *group); static void nr_arena_glyphs_group_finalize(NRObject *object); static guint nr_arena_glyphs_group_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, guint reset); -static unsigned int nr_arena_glyphs_group_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); +static unsigned int nr_arena_glyphs_group_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); static unsigned int nr_arena_glyphs_group_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb); static NRArenaItem *nr_arena_glyphs_group_pick(NRArenaItem *item, NR::Point p, gdouble delta, unsigned int sticky); @@ -430,7 +430,7 @@ nr_arena_glyphs_group_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint s static unsigned int -nr_arena_glyphs_group_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) +nr_arena_glyphs_group_render(cairo_t *ctt, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) { NRArenaItem *child; diff --git a/src/display/nr-arena-group.cpp b/src/display/nr-arena-group.cpp index b1319822d..9c790eb97 100644 --- a/src/display/nr-arena-group.cpp +++ b/src/display/nr-arena-group.cpp @@ -30,7 +30,7 @@ static void nr_arena_group_remove_child (NRArenaItem *item, NRArenaItem *child); static void nr_arena_group_set_child_position (NRArenaItem *item, NRArenaItem *child, NRArenaItem *ref); static unsigned int nr_arena_group_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset); -static unsigned int nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); +static unsigned int nr_arena_group_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); static unsigned int nr_arena_group_clip (NRArenaItem *item, NRRectL *area, NRPixBlock *pb); static NRArenaItem *nr_arena_group_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky); @@ -235,7 +235,7 @@ void nr_arena_group_set_style (NRArenaGroup *group, SPStyle *style) } static unsigned int -nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) +nr_arena_group_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) { NRArenaGroup *group = NR_ARENA_GROUP (item); @@ -243,7 +243,7 @@ nr_arena_group_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigne /* Just compose children into parent buffer */ for (NRArenaItem *child = group->children; child != NULL; child = child->next) { - ret = nr_arena_item_invoke_render (child, area, pb, flags); + ret = nr_arena_item_invoke_render (ct, child, area, pb, flags); if (ret & NR_ARENA_ITEM_STATE_INVALID) break; } diff --git a/src/display/nr-arena-image.cpp b/src/display/nr-arena-image.cpp index c4140481b..e187c331f 100644 --- a/src/display/nr-arena-image.cpp +++ b/src/display/nr-arena-image.cpp @@ -41,7 +41,7 @@ static void nr_arena_image_init (NRArenaImage *image); static void nr_arena_image_finalize (NRObject *object); static unsigned int nr_arena_image_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int state, unsigned int reset); -static unsigned int nr_arena_image_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); +static unsigned int nr_arena_image_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); static NRArenaItem *nr_arena_image_pick (NRArenaItem *item, NR::Point p, double delta, unsigned int sticky); static NRArenaItemClass *parent_class; @@ -172,7 +172,7 @@ nr_arena_image_update (NRArenaItem *item, NRRectL *area, NRGC *gc, unsigned int #define b2i (image->grid2px) static unsigned int -nr_arena_image_render (NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) +nr_arena_image_render (cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) { nr_arena_image_x_sample = prefs_get_int_attribute ("options.bitmapoversample", "value", 1); nr_arena_image_y_sample = nr_arena_image_x_sample; diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp index 68e4d3c9e..f449acf4a 100644 --- a/src/display/nr-arena-item.cpp +++ b/src/display/nr-arena-item.cpp @@ -292,7 +292,7 @@ nr_arena_item_invoke_update (NRArenaItem *item, NRRectL *area, NRGC *gc, */ 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); @@ -389,7 +389,7 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area, 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); @@ -439,7 +439,7 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area, 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); @@ -516,7 +516,7 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area, // 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) @@ -529,12 +529,12 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area, // 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 @@ -549,7 +549,7 @@ nr_arena_item_invoke_render (NRArenaItem *item, NRRectL const *area, 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) diff --git a/src/display/nr-arena-item.h b/src/display/nr-arena-item.h index 16a7a0c12..103315c5e 100644 --- a/src/display/nr-arena-item.h +++ b/src/display/nr-arena-item.h @@ -59,6 +59,7 @@ #include "gc-soft-ptr.h" #include "nr-arena-forward.h" #include "display/nr-filter.h" +#include struct NRGC { NRGC(NRGC const *p) : parent(p) {} @@ -122,7 +123,7 @@ struct NRArenaItemClass : public NRObjectClass { 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); }; @@ -151,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); diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index d6b3bc73b..7b8a2c281 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -49,7 +49,7 @@ static void nr_arena_shape_remove_child(NRArenaItem *item, NRArenaItem *child); static void nr_arena_shape_set_child_position(NRArenaItem *item, NRArenaItem *child, NRArenaItem *ref); static guint nr_arena_shape_update(NRArenaItem *item, NRRectL *area, NRGC *gc, guint state, guint reset); -static unsigned int nr_arena_shape_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); +static unsigned int nr_arena_shape_render(cairo_t *ct, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags); static guint nr_arena_shape_clip(NRArenaItem *item, NRRectL *area, NRPixBlock *pb); static NRArenaItem *nr_arena_shape_pick(NRArenaItem *item, NR::Point p, double delta, unsigned int sticky); @@ -850,7 +850,7 @@ cairo_arena_shape_render_stroke(NRArenaItem *item, NRRectL *area, NRPixBlock *pb * Renders the item. Markers are just composed into the parent buffer. */ static unsigned int -nr_arena_shape_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) +nr_arena_shape_render(cairo_t *ctt, NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned int flags) { NRArenaShape *shape = NR_ARENA_SHAPE(item); @@ -980,7 +980,7 @@ nr_arena_shape_render(NRArenaItem *item, NRRectL *area, NRPixBlock *pb, unsigned /* Just compose children into parent buffer */ for (NRArenaItem *child = shape->markers; child != NULL; child = child->next) { unsigned int ret; - ret = nr_arena_item_invoke_render(child, area, pb, flags); + ret = nr_arena_item_invoke_render(ctt, child, area, pb, flags); if (ret & NR_ARENA_ITEM_STATE_INVALID) return ret; } diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index 5c455ffe4..a4eac8b67 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -556,7 +556,7 @@ PrintPS::finish(Inkscape::Extension::Print *mod) bbox.x0, bbox.y0, bbox.x1, bbox.y1, (guchar*)px, 4 * width, FALSE, FALSE); memset(px, 0xff, 4 * width * 64); - nr_arena_item_invoke_render(mod->root, &bbox, &pb, 0); + nr_arena_item_invoke_render(NULL, mod->root, &bbox, &pb, 0); /* Blitter goes here */ NRMatrix imgt; imgt.c[0] = (bbox.x1 - bbox.x0) / dots_per_pt; diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index 51dbd3a00..74635b2a6 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -344,7 +344,7 @@ PrintWin32::finish (Inkscape::Extension::Print *mod) memset (px, 0xff, 4 * num_rows * width); /* Render */ - nr_arena_item_invoke_render (mod->root, &bbox, &pb, 0); + nr_arena_item_invoke_render (NULL, mod->root, &bbox, &pb, 0); /* Swap red and blue channels; we use RGBA, whereas * the Win32 GDI uses BGRx. diff --git a/src/flood-context.cpp b/src/flood-context.cpp index da8f22513..02e398c45 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -425,7 +425,7 @@ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *even final_bbox.x0, final_bbox.y0, final_bbox.x1, final_bbox.y1, px, 4 * width, FALSE, FALSE ); - nr_arena_item_invoke_render( root, &final_bbox, &B, NR_ARENA_ITEM_RENDER_NO_CACHE ); + nr_arena_item_invoke_render(NULL, root, &final_bbox, &B, NR_ARENA_ITEM_RENDER_NO_CACHE ); nr_pixblock_release(&B); // Hide items diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index 6d9f58ee3..383e7c563 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -273,7 +273,7 @@ sp_export_get_rows(guchar const **rows, int row, int num_rows, void *data) } /* Render */ - nr_arena_item_invoke_render(ebp->root, &bbox, &pb, 0); + nr_arena_item_invoke_render(NULL, ebp->root, &bbox, &pb, 0); for (int r = 0; r < num_rows; r++) { rows[r] = NR_PIXBLOCK_PX(&pb) + r * pb.rs; diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index 3640a6768..c2fedff50 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -784,7 +784,7 @@ sp_pattern_painter_new (SPPaintServer *ps, NR::Matrix const &full_transform, NR: } nr_arena_item_invoke_update (pp->root, NULL, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_ALL); if ( pp->use_cached_tile ) { - nr_arena_item_invoke_render (pp->root, &pp->cached_bbox, &pp->cached_tile, 0); + nr_arena_item_invoke_render (NULL, pp->root, &pp->cached_bbox, &pp->cached_tile, 0); } else { // nothing to do now } @@ -971,7 +971,7 @@ sp_pat_fill (SPPainter *painter, NRPixBlock *pb) // fixme: (Lauris) nr_pixblock_setup_extern (&ppb, pb->mode, area.x0, area.y0, area.x1, area.y1, NR_PIXBLOCK_PX (pb), pb->rs, FALSE, FALSE); - nr_arena_item_invoke_render (pp->root, &area, &ppb, 0); + nr_arena_item_invoke_render (NULL, pp->root, &area, &ppb, 0); nr_pixblock_release (&ppb); } diff --git a/src/ui/cache/svg_preview_cache.cpp b/src/ui/cache/svg_preview_cache.cpp index cee1db715..82c56f2a4 100644 --- a/src/ui/cache/svg_preview_cache.cpp +++ b/src/ui/cache/svg_preview_cache.cpp @@ -83,7 +83,7 @@ GdkPixbuf* render_pixbuf(NRArenaItem* root, double scale_factor, const NR::Rect& px + 4 * psize * (ua.y0 - area.y0) + 4 * (ua.x0 - area.x0), 4 * psize, FALSE, FALSE ); - nr_arena_item_invoke_render( root, &ua, &B, + nr_arena_item_invoke_render(NULL, root, &ua, &B, NR_ARENA_ITEM_RENDER_NO_CACHE ); nr_pixblock_release(&B); diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index adf876949..4506a3c6a 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -718,7 +718,7 @@ sp_icon_doc_icon( SPDocument *doc, NRArenaItem *root, px + 4 * psize * (ua.y0 - area.y0) + 4 * (ua.x0 - area.x0), 4 * psize, FALSE, FALSE ); - nr_arena_item_invoke_render( root, &ua, &B, + nr_arena_item_invoke_render(NULL, root, &ua, &B, NR_ARENA_ITEM_RENDER_NO_CACHE ); nr_pixblock_release(&B);