summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2007-08-11 20:54:03 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2007-08-11 20:54:03 +0000
commit9f0449b7cd03ba36f44f02f2aa0d73e6a1649317 (patch)
tree7a0aa93955a1aa6a02e93da8059000e76e3f8455 /src
parentr16217@tres: ted | 2007-08-10 10:36:27 -0700 (diff)
downloadinkscape-9f0449b7cd03ba36f44f02f2aa0d73e6a1649317.tar.gz
inkscape-9f0449b7cd03ba36f44f02f2aa0d73e6a1649317.zip
revert jasper's way overzealous fix in png-write.cpp rev 13700; new fix in item_render prevents banding on export and scroll and is a lot less expensive
(bzr r3451)
Diffstat (limited to 'src')
-rw-r--r--src/display/nr-arena-item.cpp5
-rw-r--r--src/helper/png-write.cpp14
2 files changed, 12 insertions, 7 deletions
diff --git a/src/display/nr-arena-item.cpp b/src/display/nr-arena-item.cpp
index d98bbaf3a..5ebd94a9b 100644
--- a/src/display/nr-arena-item.cpp
+++ b/src/display/nr-arena-item.cpp
@@ -418,7 +418,12 @@ nr_arena_item_invoke_render (cairo_t *ct, NRArenaItem *item, NRRectL const *area
(item->parent && item->parent->background_pb)) {
item->background_pb = &ipb;
}
+
ipb.visible_area = pb->visible_area;
+ if (item->filter) {
+ item->filter->area_enlarge (ipb.visible_area, item->ctm);
+ }
+
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 */
diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp
index 19cf0ad5a..14c1ec325 100644
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
@@ -225,9 +225,9 @@ sp_export_get_rows(guchar const **rows, int row, int num_rows, void *data)
// off, but that's less noticeable).
NRRectL bbox;
bbox.x0 = 0;
- bbox.y0 = 0;//row;
+ bbox.y0 = row;
bbox.x1 = ebp->width;
- bbox.y1 = ebp->height;//row + num_rows;
+ bbox.y1 = row + num_rows;
/* Update to renderable state */
NRGC gc(NULL);
nr_matrix_set_identity(&gc.transform);
@@ -237,7 +237,7 @@ sp_export_get_rows(guchar const **rows, int row, int num_rows, void *data)
NRPixBlock pb;
nr_pixblock_setup_extern(&pb, NR_PIXBLOCK_MODE_R8G8B8A8N,
- bbox.x0, row/*bbox.y0*/, bbox.x1, row + num_rows/*bbox.y1*/,
+ bbox.x0, bbox.y0, bbox.x1, bbox.y1,
ebp->px, 4 * ebp->width, FALSE, FALSE);
for (int r = 0; r < num_rows; r++) {
@@ -370,14 +370,14 @@ sp_export_png_file(SPDocument *doc, gchar const *filename,
ebp.data = data;
bool write_status;
- if (width * height < 65536 / 4) {
+ if ((width < 256) || ((width * height) < 32768)) {
ebp.px = nr_pixelstore_64K_new(FALSE, 0);
- ebp.sheight = height;
+ ebp.sheight = 65536 / (4 * width);
write_status = sp_png_write_rgba_striped(filename, width, height, xdpi, ydpi, sp_export_get_rows, &ebp);
nr_pixelstore_64K_free(ebp.px);
} else {
- ebp.sheight = MAX(1,MIN(MAX_STRIPE_SIZE / (4 * width),height));
- ebp.px = g_new(guchar, 4 * width * ebp.sheight);
+ ebp.px = g_new(guchar, 4 * 64 * width);
+ ebp.sheight = 64;
write_status = sp_png_write_rgba_striped(filename, width, height, xdpi, ydpi, sp_export_get_rows, &ebp);
g_free(ebp.px);
}