From: jucablues Date: Sat, 23 Feb 2008 04:27:03 +0000 (+0000) Subject: partial fix sent by jfb for bug #188814 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e04817c5fdf1e5673ae1ccc97cdc913fb3734054;p=inkscape.git partial fix sent by jfb for bug #188814 --- diff --git a/src/display/pixblock-scaler.cpp b/src/display/pixblock-scaler.cpp index ddb4c4ee2..5bf3c2762 100644 --- a/src/display/pixblock-scaler.cpp +++ b/src/display/pixblock-scaler.cpp @@ -17,6 +17,7 @@ using std::floor; #include "display/nr-filter-utils.h" #include "libnr/nr-pixblock.h" +#include "libnr/nr-blit.h" namespace NR { @@ -95,6 +96,13 @@ static void scale_bicubic_rgba(NRPixBlock *to, NRPixBlock *from) return; } + if (from->mode != to->mode){ + NRPixBlock *o_from = from; + from = new NRPixBlock; + nr_pixblock_setup_fast(from, to->mode, o_from->area.x0, o_from->area.y0, o_from->area.x1, o_from->area.y1, false); + nr_blit_pixblock_pixblock(from, o_from); + } + // Precalculate sizes of source and destination pixblocks int from_width = from->area.x1 - from->area.x0; int from_height = from->area.y1 - from->area.y0; diff --git a/src/display/pixblock-transform.cpp b/src/display/pixblock-transform.cpp index ab9d2e68b..abe0f90c0 100644 --- a/src/display/pixblock-transform.cpp +++ b/src/display/pixblock-transform.cpp @@ -21,6 +21,7 @@ using std::floor; #include "display/nr-filter-utils.h" +#include "libnr/nr-blit.h" #include "libnr/nr-pixblock.h" #include "libnr/nr-matrix.h" @@ -148,6 +149,13 @@ void transform_bicubic(NRPixBlock *to, NRPixBlock *from, Matrix &trans) return; } + if (from->mode != to->mode){ + NRPixBlock *o_from = from; + from = new NRPixBlock; + nr_pixblock_setup_fast(from, to->mode, o_from->area.x0, o_from->area.y0, o_from->area.x1, o_from->area.y1, false); + nr_blit_pixblock_pixblock(from, o_from); + } + // Precalculate sizes of source and destination pixblocks int from_width = from->area.x1 - from->area.x0; int from_height = from->area.y1 - from->area.y0;