From b9cac2d195a58d3f9d9067b74f9fcadd0fb3cf39 Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sat, 11 Aug 2007 20:54:03 +0000 Subject: [PATCH] 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 --- src/display/nr-arena-item.cpp | 5 +++++ src/helper/png-write.cpp | 14 +++++++------- 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); } -- 2.30.2