Code

optimize cairo paths by not drawing segments that are outside of view (for stroke...
[inkscape.git] / src / display / nr-filter.cpp
index f00a1ef6b3c922183250b0d911be3f33388a40f5..07c2649289b128fa9b9657ab3cd171ce4b390251 100644 (file)
 #include "libnr/nr-scale.h"
 #include "svg/svg-length.h"
 #include "sp-filter-units.h"
+#if defined (SOLARIS_2_8)
+#include "round.h"
+using Inkscape::round;
+#endif 
 
 //#include "display/nr-arena-shape.h"
 
@@ -161,7 +165,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         nr_pixblock_setup_fast(in, pb->mode,
                                min_x, min_y,
                                max_x, max_y, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         transform_nearest(in, pb, itrans);
     } else if (_x_pixels >= 0) {
@@ -191,7 +195,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         }
         if (y_len < 1) y_len = 1;
         nr_pixblock_setup_fast(in, pb->mode, 0, 0, x_len, y_len, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         scale_bicubic(in, pb);
         scale res_scaling(x_len / (double)(pb->area.x1 - pb->area.x0),
@@ -202,7 +206,7 @@ int Filter::render(NRArenaItem const *item, NRPixBlock *pb)
         nr_pixblock_setup_fast(in, pb->mode,
                                pb->area.x0, pb->area.y0,
                                pb->area.x1, pb->area.y1, true);
-        if (in->data.px == NULL) // memory allocation failed
+        if (in->size != NR_PIXBLOCK_SIZE_TINY && in->data.px == NULL) // memory allocation failed
             return 0;
         nr_blit_pixblock_pixblock(in, pb);
     }