diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-10-30 01:29:41 +0000 |
|---|---|---|
| committer | Jabiertxof <jtx@jtx.marker.es> | 2013-10-30 01:29:41 +0000 |
| commit | 69fdb9c26ab5c065e3e892a77982413f34dac7fe (patch) | |
| tree | 4d6052268d7a9a0d6eedc159256a0bcffe69ff78 /src/display | |
| parent | Update to trunk (diff) | |
| parent | suppress uninitialized variables (x and y) warning, don't ask why... g++'s wa... (diff) | |
| download | inkscape-69fdb9c26ab5c065e3e892a77982413f34dac7fe.tar.gz inkscape-69fdb9c26ab5c065e3e892a77982413f34dac7fe.zip | |
Update to trunk
(bzr r11950.1.191)
Diffstat (limited to 'src/display')
| -rw-r--r-- | src/display/nr-filter-gaussian.cpp | 6 | ||||
| -rw-r--r-- | src/display/nr-filter-morphology.cpp | 1 | ||||
| -rw-r--r-- | src/display/nr-filter-primitive.cpp | 67 |
3 files changed, 37 insertions, 37 deletions
diff --git a/src/display/nr-filter-gaussian.cpp b/src/display/nr-filter-gaussian.cpp index 9d7c32585..b96e24cbc 100644 --- a/src/display/nr-filter-gaussian.cpp +++ b/src/display/nr-filter-gaussian.cpp @@ -304,10 +304,9 @@ filter2D_IIR(PT *const dest, int const dstr1, int const dstr2, #define PREMUL_ALPHA_LOOP for(unsigned int c=1; c<PC; ++c) #endif +INK_UNUSED(num_threads); // to suppress unused argument compiler warning #if HAVE_OPENMP #pragma omp parallel for num_threads(num_threads) -#else - INK_UNUSED(num_threads); #endif // HAVE_OPENMP for ( int c2 = 0 ; c2 < n2 ; c2++ ) { #if HAVE_OPENMP @@ -375,10 +374,9 @@ filter2D_FIR(PT *const dst, int const dstr1, int const dstr2, // Past pixels seen (to enable in-place operation) PT history[scr_len+1][PC]; +INK_UNUSED(num_threads); // suppresses unused argument compiler warning #if HAVE_OPENMP #pragma omp parallel for num_threads(num_threads) private(history) -#else - INK_UNUSED(num_threads); #endif // HAVE_OPENMP for ( int c2 = 0 ; c2 < n2 ; c2++ ) { diff --git a/src/display/nr-filter-morphology.cpp b/src/display/nr-filter-morphology.cpp index b058307cf..b6e5052e1 100644 --- a/src/display/nr-filter-morphology.cpp +++ b/src/display/nr-filter-morphology.cpp @@ -69,6 +69,7 @@ void morphologicalFilter1D(cairo_surface_t * const input, cairo_surface_t * cons int limit = w * h; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int numOfThreads = prefs->getIntLimited("/options/threading/numthreads", omp_get_num_procs(), 1, 256); + (void) numOfThreads; // suppress unused variable warning #pragma omp parallel for if(limit > OPENMP_THRESHOLD) num_threads(numOfThreads) #endif // HAVE_OPENMP for (int i = 0; i < h; ++i) { diff --git a/src/display/nr-filter-primitive.cpp b/src/display/nr-filter-primitive.cpp index fca82c810..95d5d4b09 100644 --- a/src/display/nr-filter-primitive.cpp +++ b/src/display/nr-filter-primitive.cpp @@ -110,8 +110,16 @@ void FilterPrimitive::set_subregion(SVGLength const &x, SVGLength const &y, Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units) { - Geom::OptRect bb = units.get_item_bbox(); - Geom::OptRect fa = units.get_filter_area(); + Geom::OptRect const bb_opt = units.get_item_bbox(); + Geom::OptRect const fa_opt = units.get_filter_area(); + Geom::Rect bb; + Geom::Rect fa; + if (!bb_opt || !fa_opt) { + return Geom::Rect (Geom::Point(0.,0.), Geom::Point(0.,0.)); + } else { + bb = *bb_opt; + fa = *fa_opt; + } // This is definitely a hack... but what else to do? // Current viewport might not be document viewport... but how to find? @@ -127,8 +135,8 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units) /* Update computed values for ex, em, %. For %, assumes primitive unit is objectBoundingBox. */ /* TODO: fetch somehow the object ex and em lengths; 12, 6 are just dummy values. */ - double len_x = bb->width(); - double len_y = bb->height(); + double len_x = bb.width(); + double len_y = bb.height(); _subregion_x.update(12, 6, len_x); _subregion_y.update(12, 6, len_y); _subregion_width.update(12, 6, len_x); @@ -143,44 +151,37 @@ Geom::Rect FilterPrimitive::filter_primitive_area(FilterUnits const &units) double height = 0; // If subregion not set, by special case use filter region. - if( !_subregion_x._set ) x = fa->min()[X]; - if( !_subregion_y._set ) y = fa->min()[Y]; - if( !_subregion_width._set ) width = fa->width(); - if( !_subregion_height._set ) height = fa->height(); + if( !_subregion_x._set ) x = fa.min()[X]; + if( !_subregion_y._set ) y = fa.min()[Y]; + if( !_subregion_width._set ) width = fa.width(); + if( !_subregion_height._set ) height = fa.height(); if( units.get_primitive_units() == SP_FILTER_UNITS_OBJECTBOUNDINGBOX ) { // Values are in terms of fraction of bounding box. - if( _subregion_x._set && _subregion_x.unit != SVGLength::PERCENT ) x = bb->min()[X] + bb->width() * _subregion_x.value; - if( _subregion_y._set && _subregion_y.unit != SVGLength::PERCENT ) y = bb->min()[Y] + bb->height() * _subregion_y.value; - if( _subregion_width._set && _subregion_width.unit != SVGLength::PERCENT ) width = bb->width() * _subregion_width.value; - if( _subregion_height._set && _subregion_height.unit != SVGLength::PERCENT ) height = bb->height() * _subregion_height.value; - // Values are in terms of percent - if( _subregion_x._set && _subregion_x.unit == SVGLength::PERCENT ) x = bb->min()[X] + _subregion_x.computed; - if( _subregion_y._set && _subregion_y.unit == SVGLength::PERCENT ) y = bb->min()[Y] + _subregion_y.computed; - if( _subregion_width._set && _subregion_width.unit == SVGLength::PERCENT ) width = _subregion_width.computed; - if( _subregion_height._set && _subregion_height.unit == SVGLength::PERCENT ) height = _subregion_height.computed; + if( _subregion_x._set && (_subregion_x.unit != SVGLength::PERCENT) ) x = bb.min()[X] + bb.width() * _subregion_x.value; + if( _subregion_y._set && (_subregion_y.unit != SVGLength::PERCENT) ) y = bb.min()[Y] + bb.height() * _subregion_y.value; + if( _subregion_width._set && (_subregion_width.unit != SVGLength::PERCENT) ) width = bb.width() * _subregion_width.value; + if( _subregion_height._set && (_subregion_height.unit != SVGLength::PERCENT) ) height = bb.height() * _subregion_height.value; + // Values are in terms of percent + if( _subregion_x._set && (_subregion_x.unit == SVGLength::PERCENT) ) x = bb.min()[X] + _subregion_x.computed; + if( _subregion_y._set && (_subregion_y.unit == SVGLength::PERCENT) ) y = bb.min()[Y] + _subregion_y.computed; + if( _subregion_width._set && (_subregion_width.unit == SVGLength::PERCENT) ) width = _subregion_width.computed; + if( _subregion_height._set && (_subregion_height.unit == SVGLength::PERCENT) ) height = _subregion_height.computed; } else { // Values are in terms of user space coordinates or percent of viewbox (yuck!), // which is usually the size of SVG drawing. Default. - if( _subregion_x._set && _subregion_x.unit != SVGLength::PERCENT ) x = _subregion_x.computed; - if( _subregion_y._set && _subregion_y.unit != SVGLength::PERCENT ) y = _subregion_y.computed; - if( _subregion_width._set && _subregion_width.unit != SVGLength::PERCENT ) width = _subregion_width.computed; - if( _subregion_height._set && _subregion_height.unit != SVGLength::PERCENT ) height = _subregion_height.computed; + if( _subregion_x._set && (_subregion_x.unit != SVGLength::PERCENT) ) x = _subregion_x.computed; + if( _subregion_y._set && (_subregion_y.unit != SVGLength::PERCENT) ) y = _subregion_y.computed; + if( _subregion_width._set && (_subregion_width.unit != SVGLength::PERCENT) ) width = _subregion_width.computed; + if( _subregion_height._set && (_subregion_height.unit != SVGLength::PERCENT) ) height = _subregion_height.computed; // Percent of viewport - if( _subregion_x._set && _subregion_x.unit == SVGLength::PERCENT ) x = _subregion_x.value * viewport.width(); - if( _subregion_y._set && _subregion_y.unit == SVGLength::PERCENT ) y = _subregion_y.value * viewport.height(); - if( _subregion_width._set && _subregion_width.unit == SVGLength::PERCENT ) width = _subregion_width.value * viewport.width(); - if( _subregion_height._set && _subregion_height.unit == SVGLength::PERCENT ) height = _subregion_height.value * viewport.height(); + if( _subregion_x._set && (_subregion_x.unit == SVGLength::PERCENT) ) x = _subregion_x.value * viewport.width(); + if( _subregion_y._set && (_subregion_y.unit == SVGLength::PERCENT) ) y = _subregion_y.value * viewport.height(); + if( _subregion_width._set && (_subregion_width.unit == SVGLength::PERCENT) ) width = _subregion_width.value * viewport.width(); + if( _subregion_height._set && (_subregion_height.unit == SVGLength::PERCENT) ) height = _subregion_height.value * viewport.height(); } - Geom::Point minp, maxp; - minp[X] = x; - minp[Y] = y; - maxp[X] = x + width; - maxp[Y] = y + height; - - Geom::Rect area(minp, maxp); - return area; + return Geom::Rect (Geom::Point(x,y), Geom::Point(x + width, y + height)); } void FilterPrimitive::setStyle(SPStyle *style) |
