summaryrefslogtreecommitdiffstats
path: root/src/sp-pattern.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-08-06 12:18:32 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-08-06 12:18:32 +0000
commit4dd33aa4d5c57706c7f64f63391174954160a308 (patch)
treeb9d4ea1278348836a718c5e6aaeaff9f82c790bf /src/sp-pattern.cpp
parentPer-item render cache. (diff)
downloadinkscape-4dd33aa4d5c57706c7f64f63391174954160a308.tar.gz
inkscape-4dd33aa4d5c57706c7f64f63391174954160a308.zip
Rewrite NRArenaItem hierarchy into C++
(bzr r10347.1.21)
Diffstat (limited to 'src/sp-pattern.cpp')
-rw-r--r--src/sp-pattern.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index 3a3d01ebd..805a93267 100644
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -25,10 +25,11 @@
#include "display/drawing-context.h"
#include "display/drawing-surface.h"
#include "display/nr-arena.h"
-#include "display/nr-arena-group.h"
+#include "display/drawing-group.h"
#include "attributes.h"
#include "document-private.h"
#include "uri.h"
+#include "style.h"
#include "sp-pattern.h"
#include "xml/repr.h"
#include "display/grayscale.h"
@@ -632,15 +633,15 @@ sp_pattern_create_pattern(SPPaintServer *ps,
/* Create arena */
NRArena *arena = NRArena::create();
unsigned int dkey = SPItem::display_key_new (1);
- NRArenaGroup *root = NRArenaGroup::create(arena);
+ Inkscape::DrawingGroup *root = new Inkscape::DrawingGroup(arena);
for (SPObject *child = shown->firstChild(); child != NULL; child = child->getNext() ) {
if (SP_IS_ITEM (child)) {
// for each item in pattern, show it on our arena, add to the group,
// and connect to the release signal in case the item gets deleted
- NRArenaItem *cai;
+ Inkscape::DrawingItem *cai;
cai = SP_ITEM(child)->invoke_show (arena, dkey, SP_ITEM_SHOW_DISPLAY);
- nr_arena_item_append_child (root, cai);
+ root->appendChild(cai);
}
}
@@ -689,17 +690,17 @@ sp_pattern_create_pattern(SPPaintServer *ps,
}
// TODO: make sure there are no leaks.
- NRGC gc(NULL);
- gc.transform = vb2ps;
- nr_arena_item_invoke_update (root, Geom::IntRect::infinite(), &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_ALL);
- nr_arena_item_invoke_render (ct, root, one_tile, 0);
+ Inkscape::UpdateContext ctx;
+ ctx.ctm = vb2ps;
+ root->update(Geom::IntRect::infinite(), ctx, Inkscape::DrawingItem::STATE_ALL, 0);
+ root->render(ct, one_tile, 0);
for (SPObject *child = shown->firstChild() ; child != NULL; child = child->getNext() ) {
if (SP_IS_ITEM (child)) {
SP_ITEM(child)->invoke_hide(dkey);
}
}
- nr_object_unref(root);
nr_object_unref(arena);
+ delete root;
if (needs_opacity) {
ct.popGroupToSource(); // pop raw pattern