From c64dc3672a2bc8def5ddcf1c5d3fc612f63c46ab Mon Sep 17 00:00:00 2001 From: artemp Date: Tue, 28 Apr 2015 14:18:33 +0200 Subject: [PATCH] vertex_converter - refactor to pass `Processor` to apply function (while it allows to instantiate vertex_converter object only using converter tags, it doesn't reduce object code) make offset_converter 'non-switchable' relying on be able to shortcut in `vertex(*x, *y)` when offset is 0.0 -> results in reduced binary size --- include/mapnik/marker_helpers.hpp | 14 +++--- .../apply_vertex_converter.hpp | 9 ++-- .../process_markers_symbolizer.hpp | 48 +++++++------------ .../process_polygon_symbolizer.hpp | 6 +-- include/mapnik/text/symbolizer_helpers.hpp | 2 +- include/mapnik/vertex_converters.hpp | 19 ++++---- src/agg/process_line_pattern_symbolizer.cpp | 16 +++---- src/agg/process_line_symbolizer.cpp | 16 +++---- .../process_polygon_pattern_symbolizer.cpp | 18 ++++--- src/agg/process_polygon_symbolizer.cpp | 2 +- src/cairo/process_line_pattern_symbolizer.cpp | 8 ++-- src/cairo/process_line_symbolizer.cpp | 9 ++-- .../process_polygon_pattern_symbolizer.cpp | 8 ++-- src/cairo/process_polygon_symbolizer.cpp | 2 +- src/grid/process_line_pattern_symbolizer.cpp | 9 ++-- src/grid/process_line_symbolizer.cpp | 8 ++-- .../process_polygon_pattern_symbolizer.cpp | 8 ++-- src/grid/process_polygon_symbolizer.cpp | 2 +- src/text/symbolizer_helpers.cpp | 6 +-- 19 files changed, 98 insertions(+), 112 deletions(-) diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index 7e8e687a8..1457cdcf9 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -193,11 +193,11 @@ void setup_transform_scaling(agg::trans_affine & tr, symbolizer_base const& sym); // Apply markers to a feature with multiple geometries -template -void apply_markers_multi(feature_impl const& feature, attributes const& vars, Converter & converter, symbolizer_base const& sym) +template +void apply_markers_multi(feature_impl const& feature, attributes const& vars, Converter & converter, Processor & proc, symbolizer_base const& sym) { using vertex_converter_type = Converter; - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; auto const& geom = feature.get_geometry(); @@ -207,7 +207,7 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co || type == geometry::geometry_types::LineString || type == geometry::geometry_types::Polygon) { - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, proc); mapnik::util::apply_visitor(vertex_processor_type(apply), geom); } else @@ -226,7 +226,7 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co // unset any clipping since we're now dealing with a point converter.template unset(); geometry::point_vertex_adapter va(pt); - converter.apply(va); + converter.apply(va, proc); } } else if ((placement == MARKER_POINT_PLACEMENT || placement == MARKER_INTERIOR_PLACEMENT) && @@ -253,7 +253,7 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co if (largest) { geometry::polygon_vertex_adapter va(*largest); - converter.apply(va); + converter.apply(va, proc); } } else @@ -267,7 +267,7 @@ void apply_markers_multi(feature_impl const& feature, attributes const& vars, Co { MAPNIK_LOG_WARN(marker_symbolizer) << "marker_multi_policy != 'each' has no effect with marker_placement != 'point'"; } - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, proc); mapnik::util::apply_visitor(vertex_processor_type(apply), geom); } } diff --git a/include/mapnik/renderer_common/apply_vertex_converter.hpp b/include/mapnik/renderer_common/apply_vertex_converter.hpp index 85966d36e..de239c95b 100644 --- a/include/mapnik/renderer_common/apply_vertex_converter.hpp +++ b/include/mapnik/renderer_common/apply_vertex_converter.hpp @@ -25,17 +25,18 @@ namespace mapnik { namespace detail { -template +template struct apply_vertex_converter { - apply_vertex_converter(VertexConverter & converter) - : converter_(converter) {} + apply_vertex_converter(VertexConverter & converter, Processor & proc) + : converter_(converter), proc_(proc) {} template void operator() (Adapter const& adapter) const { - converter_.apply(adapter); + converter_.apply(adapter, proc_); } VertexConverter & converter_; + Processor & proc_; }; }} diff --git a/include/mapnik/renderer_common/process_markers_symbolizer.hpp b/include/mapnik/renderer_common/process_markers_symbolizer.hpp index 14660fdd3..ac9359fbc 100644 --- a/include/mapnik/renderer_common/process_markers_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_markers_symbolizer.hpp @@ -40,6 +40,14 @@ struct render_marker_symbolizer_visitor using raster_dispatch_type = RD; using buffer_type = typename std::tuple_element<0,ContextType>::type; + using vertex_converter_type = vertex_converter; + render_marker_symbolizer_visitor(std::string const& filename, markers_symbolizer const& sym, mapnik::feature_impl & feature, @@ -100,14 +108,7 @@ struct render_marker_symbolizer_visitor snap_to_pixels, renderer_context_); - using vertex_converter_type = vertex_converter; vertex_converter_type converter(clip_box_, - rasterizer_dispatch, sym_, common_.t_, prj_trans_, @@ -129,7 +130,7 @@ struct render_marker_symbolizer_visitor converter.template set(); // optional affine transform if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature_, common_.vars_, converter, sym_); + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); } else { @@ -153,14 +154,7 @@ struct render_marker_symbolizer_visitor snap_to_pixels, renderer_context_); - using vertex_converter_type = vertex_converter; vertex_converter_type converter(clip_box_, - rasterizer_dispatch, sym_, common_.t_, prj_trans_, @@ -182,7 +176,7 @@ struct render_marker_symbolizer_visitor converter.template set(); // optional affine transform if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature_, common_.vars_, converter, sym_); + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); } } @@ -217,14 +211,8 @@ struct render_marker_symbolizer_visitor common_.vars_, renderer_context_); - using vertex_converter_type = vertex_converter; + vertex_converter_type converter(clip_box_, - rasterizer_dispatch, sym_, common_.t_, prj_trans_, @@ -246,7 +234,7 @@ struct render_marker_symbolizer_visitor converter.template set(); // optional affine transform if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - apply_markers_multi(feature_, common_.vars_, converter, sym_); + apply_markers_multi(feature_, common_.vars_, converter, rasterizer_dispatch, sym_); } private: @@ -273,12 +261,12 @@ void render_markers_symbolizer(markers_symbolizer const& sym, { mapnik::marker const& mark = mapnik::marker_cache::instance().find(filename, true); render_marker_symbolizer_visitor visitor(filename, - sym, - feature, - prj_trans, - common, - clip_box, - renderer_context); + sym, + feature, + prj_trans, + common, + clip_box, + renderer_context); util::apply_visitor(visitor, mark); } } diff --git a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp index f63250bb1..60c781047 100644 --- a/include/mapnik/renderer_common/process_polygon_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_polygon_symbolizer.hpp @@ -51,7 +51,7 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, value_double smooth = get(sym, feature, common.vars_); value_double opacity = get(sym, feature, common.vars_); - vertex_converter_type converter(clip_box, ras, sym, common.t_, prj_trans, tr, + vertex_converter_type converter(clip_box, sym, common.t_, prj_trans, tr, feature,common.vars_,common.scale_factor_); if (prj_trans.equal() && clip) converter.template set(); //optional clip (default: true) @@ -60,9 +60,9 @@ void render_polygon_symbolizer(polygon_symbolizer const &sym, if (simplify_tolerance > 0.0) converter.template set(); // optional simplify converter if (smooth > 0.0) converter.template set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, ras); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); color const& fill = get(sym, feature, common.vars_); diff --git a/include/mapnik/text/symbolizer_helpers.hpp b/include/mapnik/text/symbolizer_helpers.hpp index 33525c012..c7e23a37e 100644 --- a/include/mapnik/text/symbolizer_helpers.hpp +++ b/include/mapnik/text/symbolizer_helpers.hpp @@ -56,7 +56,7 @@ struct placement_finder_adapter }; -using vertex_converter_type = vertex_converter,clip_line_tag , transform_tag, affine_transform_tag, simplify_tag, smooth_tag>; +using vertex_converter_type = vertex_converter; class base_symbolizer_helper { diff --git a/include/mapnik/vertex_converters.hpp b/include/mapnik/vertex_converters.hpp index 3903cd591..5ae733ce8 100644 --- a/include/mapnik/vertex_converters.hpp +++ b/include/mapnik/vertex_converters.hpp @@ -271,6 +271,11 @@ struct is_switchable static constexpr bool value = false; }; +template +struct is_switchable +{ + static constexpr bool value = false; +}; template @@ -377,11 +382,10 @@ struct arguments : util::noncopyable } -template +template struct vertex_converter : private util::noncopyable { using bbox_type = box2d; - using processor_type = Processor; using symbolizer_type = symbolizer_base; using trans_type = view_transform; using proj_trans_type = proj_transform; @@ -391,7 +395,6 @@ struct vertex_converter : private util::noncopyable using dispatcher_type = detail::dispatcher; vertex_converter(bbox_type const& bbox, - processor_type & proc, symbolizer_type const& sym, trans_type const& tr, proj_trans_type const& prj_trans, @@ -399,13 +402,12 @@ struct vertex_converter : private util::noncopyable feature_type const& feature, attributes const& vars, double scale_factor) - : disp_(bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor), - proc_(proc) {} + : disp_(bbox,sym,tr,prj_trans,affine_trans,feature,vars,scale_factor) {} - template - void apply(VertexAdapter & geom) + template + void apply(VertexAdapter & geom, Processor & proc) { - detail::converters_helper:: template forward(disp_, geom, proc_); + detail::converters_helper:: template forward(disp_, geom, proc); } template @@ -421,7 +423,6 @@ struct vertex_converter : private util::noncopyable } dispatcher_type disp_; - Processor & proc_; }; } diff --git a/src/agg/process_line_pattern_symbolizer.cpp b/src/agg/process_line_pattern_symbolizer.cpp index 41adf387e..d5c695131 100644 --- a/src/agg/process_line_pattern_symbolizer.cpp +++ b/src/agg/process_line_pattern_symbolizer.cpp @@ -127,12 +127,12 @@ struct agg_renderer_process_visitor_l padding *= common_.scale_factor_; clip_box.pad(padding); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,ras,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); if (clip) converter.set(); //optional clip (default: true) converter.set(); //always transform @@ -141,9 +141,9 @@ struct agg_renderer_process_visitor_l converter.set(); // optional affine transform if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, ras); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); } @@ -196,12 +196,12 @@ struct agg_renderer_process_visitor_l padding *= common_.scale_factor_; clip_box.pad(padding); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,ras,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); if (clip) converter.set(); //optional clip (default: true) converter.set(); //always transform @@ -210,9 +210,9 @@ struct agg_renderer_process_visitor_l converter.set(); // optional affine transform if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, ras); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); } diff --git a/src/agg/process_line_symbolizer.cpp b/src/agg/process_line_symbolizer.cpp index aa76f22e1..393299a86 100644 --- a/src/agg/process_line_symbolizer.cpp +++ b/src/agg/process_line_symbolizer.cpp @@ -164,13 +164,13 @@ void agg_renderer::process(line_symbolizer const& sym, rasterizer_type ras(ren); set_join_caps_aa(sym, ras, feature, common_.vars_); - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,ras,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -178,19 +178,19 @@ void agg_renderer::process(line_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, ras); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); } else { - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box, sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -202,9 +202,9 @@ void agg_renderer::process(line_symbolizer const& sym, converter.set(); converter.set(); //always stroke - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); using renderer_type = agg::renderer_scanline_aa_solid; diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index 473531d29..098fc2e7a 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -156,14 +156,13 @@ struct agg_renderer_process_visitor_p agg::trans_affine tr; auto transform = get_optional(sym_, keys::geometry_transform); if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,*ras_ptr_,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); if (prj_trans_.equal() && clip) converter.set(); //optional clip (default: true) @@ -172,9 +171,9 @@ struct agg_renderer_process_visitor_p if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr_); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); agg::scanline_u8 sl; ras_ptr_->filling_rule(agg::fill_even_odd); @@ -257,14 +256,13 @@ struct agg_renderer_process_visitor_p agg::trans_affine tr; auto transform = get_optional(sym_, keys::geometry_transform); if (transform) evaluate_transform(tr, feature_, common_.vars_, *transform, common_.scale_factor_); - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box,*ras_ptr_,sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box, sym_,common_.t_,prj_trans_,tr,feature_,common_.vars_,common_.scale_factor_); if (prj_trans_.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform @@ -272,9 +270,9 @@ struct agg_renderer_process_visitor_p if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr_); mapnik::util::apply_visitor(vertex_processor_type(apply),feature_.get_geometry()); agg::scanline_u8 sl; ras_ptr_->filling_rule(agg::fill_even_odd); diff --git a/src/agg/process_polygon_symbolizer.cpp b/src/agg/process_polygon_symbolizer.cpp index af53dff06..a31178a8c 100644 --- a/src/agg/process_polygon_symbolizer.cpp +++ b/src/agg/process_polygon_symbolizer.cpp @@ -48,7 +48,7 @@ void agg_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; ras_ptr->reset(); double gamma = get(sym, keys::gamma, feature, common_.vars_, 1.0); diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index 3ab203f08..76f868871 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -143,13 +143,13 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, using rasterizer_type = line_pattern_rasterizer; rasterizer_type ras(context_, *pattern, width, height); - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); + vertex_converter_type converter(clipping_extent,sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -158,9 +158,9 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, ras); mapnik::util::apply_visitor(vertex_processor_type(apply), feature.get_geometry()); } diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index 70bc0c7f4..584e34ef0 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -81,15 +81,14 @@ void cairo_renderer::process(line_symbolizer const& sym, padding *= common_.scale_factor_; clipping_extent.pad(padding); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clipping_extent,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform @@ -98,9 +97,9 @@ void cairo_renderer::process(line_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, context_); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // stroke context_.set_fill_rule(CAIRO_FILL_RULE_WINDING); diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 523eb0e09..a31041df7 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -124,23 +124,23 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, agg::trans_affine tr; auto geom_transform = get_optional(sym, keys::geometry_transform); if (geom_transform) { evaluate_transform(tr, feature, common_.vars_, *geom_transform, common_.scale_factor_); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clip_box, context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clip_box,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform converter.set(); if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, context_); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // fill polygon context_.set_fill_rule(CAIRO_FILL_RULE_EVEN_ODD); diff --git a/src/cairo/process_polygon_symbolizer.cpp b/src/cairo/process_polygon_symbolizer.cpp index bbc48e11a..90ca5c96a 100644 --- a/src/cairo/process_polygon_symbolizer.cpp +++ b/src/cairo/process_polygon_symbolizer.cpp @@ -38,7 +38,7 @@ void cairo_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; cairo_save_restore guard(context_); composite_mode_e comp_op = get(sym, feature, common_.vars_); context_.set_operator(comp_op); diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index 12bb9ba3c..b48960282 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -115,11 +115,10 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, put(line, keys::simplify_tolerance, value_double(simplify_tolerance)); put(line, keys::smooth, value_double(smooth)); - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clipping_extent,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -127,9 +126,9 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter converter.set(); //always stroke - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // render id diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index 81f2880a4..f40439cc0 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -89,11 +89,11 @@ void grid_renderer::process(line_symbolizer const& sym, padding *= common_.scale_factor_; clipping_extent.pad(padding); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + vertex_converter_type converter(clipping_extent,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform if (std::fabs(offset) > 0.0) converter.set(); // parallel offset @@ -103,9 +103,9 @@ void grid_renderer::process(line_symbolizer const& sym, if (has_dash) converter.set(); converter.set(); //always stroke - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); // render id diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index f153674a8..30113eee3 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -76,8 +76,8 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_); } - using vertex_converter_type = vertex_converter; - vertex_converter_type converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); + using vertex_converter_type = vertex_converter; + vertex_converter_type converter(common_.query_extent_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) converter.set(); //always transform @@ -85,9 +85,9 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, if (simplify_tolerance > 0.0) converter.set(); // optional simplify converter if (smooth > 0.0) converter.set(); // optional smooth converter - using apply_vertex_converter_type = detail::apply_vertex_converter; + using apply_vertex_converter_type = detail::apply_vertex_converter; using vertex_processor_type = geometry::vertex_processor; - apply_vertex_converter_type apply(converter); + apply_vertex_converter_type apply(converter, *ras_ptr); mapnik::util::apply_visitor(vertex_processor_type(apply),feature.get_geometry()); using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index b659dc0cd..30f072f53 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -53,7 +53,7 @@ void grid_renderer::process(polygon_symbolizer const& sym, using renderer_type = agg::renderer_scanline_bin_solid; using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; ras_ptr->reset(); diff --git a/src/text/symbolizer_helpers.cpp b/src/text/symbolizer_helpers.cpp index 634ce9f36..5a90cc0c7 100644 --- a/src/text/symbolizer_helpers.cpp +++ b/src/text/symbolizer_helpers.cpp @@ -288,7 +288,7 @@ text_symbolizer_helper::text_symbolizer_helper( : base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent), finder_(feature, vars, detector, dims_, *info_ptr_, font_manager, scale_factor), adapter_(finder_,false), - converter_(query_extent_, adapter_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) + converter_(query_extent_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) { // setup vertex converter @@ -335,7 +335,7 @@ bool text_symbolizer_helper::next_line_placement() const { auto const& line = util::get const>(*geo_itr_); geometry::line_string_vertex_adapter va(line); - converter_.apply(va); + //converter_.apply(va, adapter_); if (adapter_.status()) { //Found a placement @@ -385,7 +385,7 @@ text_symbolizer_helper::text_symbolizer_helper( : base_symbolizer_helper(sym, feature, vars, prj_trans, width, height, scale_factor, t, query_extent), finder_(feature, vars, detector, dims_, *info_ptr_, font_manager, scale_factor), adapter_(finder_,true), - converter_(query_extent_, adapter_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) + converter_(query_extent_, sym_, t, prj_trans, affine_trans, feature, vars, scale_factor) { // setup vertex converter value_bool clip = mapnik::get(sym_, feature_, vars_);