summaryrefslogtreecommitdiffstats
path: root/src/helper/pixbuf-ops.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2011-07-22 02:09:27 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2011-07-22 02:09:27 +0000
commit328fad57dbfb65e3bd31062021d5cc3081e68515 (patch)
tree55b02cfb325a87d994fefb0e4ea88311812e9444 /src/helper/pixbuf-ops.cpp
parentClean up some commented-out code (diff)
downloadinkscape-328fad57dbfb65e3bd31062021d5cc3081e68515.tar.gz
inkscape-328fad57dbfb65e3bd31062021d5cc3081e68515.zip
Replace direct use of Cairo contexts and surfaces in the rendering tree
with wrappers which keep some extra information about the surface, amd NRRect and NRRectL use with Geom::Rect and Geom::IntRect. Should simplify implementing filter primitive subregions. (bzr r10347.1.17)
Diffstat (limited to 'src/helper/pixbuf-ops.cpp')
-rw-r--r--src/helper/pixbuf-ops.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp
index e1ced31b4..df0a40858 100644
--- a/src/helper/pixbuf-ops.cpp
+++ b/src/helper/pixbuf-ops.cpp
@@ -23,6 +23,7 @@
#include "interface.h"
#include "helper/png-write.h"
#include "display/cairo-utils.h"
+#include "display/drawing-context.h"
#include "display/nr-arena-item.h"
#include "display/nr-arena.h"
#include "document.h"
@@ -144,27 +145,17 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/,
hide_other_items_recursively(doc->getRoot(), items_only, dkey);
}
- NRRectL final_bbox;
- final_bbox.x0 = 0;
- final_bbox.y0 = 0;//row;
- final_bbox.x1 = width;
- final_bbox.y1 = height;//row + num_rows;
+ Geom::IntRect final_bbox = Geom::IntRect::from_xywh(0, 0, width, height);
- nr_arena_item_invoke_update(root, &final_bbox, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);
+ nr_arena_item_invoke_update(root, final_bbox, &gc, NR_ARENA_ITEM_STATE_ALL, NR_ARENA_ITEM_STATE_NONE);
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
if (cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS) {
- cairo_t *ct = cairo_create(surface);
-
- // clear to background
- ink_cairo_set_source_rgba32(ct, bgcolor);
- cairo_set_operator(ct, CAIRO_OPERATOR_SOURCE);
- cairo_paint(ct);
- cairo_set_operator(ct, CAIRO_OPERATOR_OVER);
+ Inkscape::DrawingContext ct(surface, Geom::Point(0,0));
// render items
- nr_arena_item_invoke_render(ct, root, &final_bbox, NULL, NR_ARENA_ITEM_RENDER_NO_CACHE );
+ nr_arena_item_invoke_render(ct, root, final_bbox, NR_ARENA_ITEM_RENDER_NO_CACHE );
pixbuf = gdk_pixbuf_new_from_data(cairo_image_surface_get_data(surface),
GDK_COLORSPACE_RGB, TRUE,