From 4f67ec0fc7d69223893fb12aae365998e14744f7 Mon Sep 17 00:00:00 2001 From: artemp Date: Mon, 29 Sep 2014 12:25:34 +0100 Subject: [PATCH] update cairo and grid renderers to use new vertex_converters --- src/cairo/process_line_pattern_symbolizer.cpp | 13 +++++-------- src/cairo/process_line_symbolizer.cpp | 14 +++++++------- src/cairo/process_polygon_pattern_symbolizer.cpp | 3 +-- src/cairo/process_polygon_symbolizer.cpp | 4 +--- src/grid/process_line_pattern_symbolizer.cpp | 9 +++++---- src/grid/process_line_symbolizer.cpp | 8 ++++---- src/grid/process_polygon_pattern_symbolizer.cpp | 3 +-- src/grid/process_polygon_symbolizer.cpp | 3 +-- 8 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/cairo/process_line_pattern_symbolizer.cpp b/src/cairo/process_line_pattern_symbolizer.cpp index 1dfb0682d..c51c56f9c 100644 --- a/src/cairo/process_line_pattern_symbolizer.cpp +++ b/src/cairo/process_line_pattern_symbolizer.cpp @@ -41,13 +41,6 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - - using conv_types = boost::mpl::vector; - std::string filename = get(sym, keys::file, feature, common_.vars_); composite_mode_e comp_op = get(sym, keys::comp_op, feature, common_.vars_, src_over); bool clip = get(sym, keys::clip, feature, common_.vars_, false); @@ -111,7 +104,11 @@ void cairo_renderer::process(line_pattern_symbolizer const& sym, using rasterizer_type = line_pattern_rasterizer; rasterizer_type ras(context_, *pattern, width, height); - vertex_converter + vertex_converter converter(clipping_extent, ras, sym, common_.t_, prj_trans, tr, feature, common_.vars_, common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) diff --git a/src/cairo/process_line_symbolizer.cpp b/src/cairo/process_line_symbolizer.cpp index 18d01729c..5a18e81ca 100644 --- a/src/cairo/process_line_symbolizer.cpp +++ b/src/cairo/process_line_symbolizer.cpp @@ -36,12 +36,6 @@ void cairo_renderer::process(line_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using conv_types = boost::mpl::vector; - composite_mode_e comp_op = get(sym, keys::comp_op, feature, common_.vars_, src_over); bool clip = get(sym, keys::clip, feature, common_.vars_, false); double offset = get(sym, keys::offset, feature, common_.vars_, 0.0); @@ -84,7 +78,13 @@ void cairo_renderer::process(line_symbolizer const& sym, padding *= common_.scale_factor_; clipping_extent.pad(padding); } - vertex_converter + vertex_converter converter(clipping_extent,context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) diff --git a/src/cairo/process_polygon_pattern_symbolizer.cpp b/src/cairo/process_polygon_pattern_symbolizer.cpp index 25274373c..4911a40b3 100644 --- a/src/cairo/process_polygon_pattern_symbolizer.cpp +++ b/src/cairo/process_polygon_pattern_symbolizer.cpp @@ -102,8 +102,7 @@ void cairo_renderer::process(polygon_pattern_symbolizer const& sym, auto geom_transform = get_optional(sym, keys::geometry_transform); if (geom_transform) { evaluate_transform(tr, feature, common_.vars_, *geom_transform, common_.scale_factor_); } - using conv_types = boost::mpl::vector; - vertex_converter + vertex_converter converter(clip_box, context_,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) diff --git a/src/cairo/process_polygon_symbolizer.cpp b/src/cairo/process_polygon_symbolizer.cpp index 70b89490f..190b87e34 100644 --- a/src/cairo/process_polygon_symbolizer.cpp +++ b/src/cairo/process_polygon_symbolizer.cpp @@ -38,9 +38,7 @@ void cairo_renderer::process(polygon_symbolizer const& sym, mapnik::feature_impl & feature, proj_transform const& prj_trans) { - using conv_types = boost::mpl::vector; - using vertex_converter_type = vertex_converter; - + using vertex_converter_type = vertex_converter; cairo_save_restore guard(context_); composite_mode_e comp_op = get(sym, keys::comp_op, feature, common_.vars_, src_over); context_.set_operator(comp_op); diff --git a/src/grid/process_line_pattern_symbolizer.cpp b/src/grid/process_line_pattern_symbolizer.cpp index d0ed58dde..64d3e70e9 100644 --- a/src/grid/process_line_pattern_symbolizer.cpp +++ b/src/grid/process_line_pattern_symbolizer.cpp @@ -73,9 +73,7 @@ void grid_renderer::process(line_pattern_symbolizer const& sym, using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; using renderer_type = agg::renderer_scanline_bin_solid; - using conv_types = boost::mpl::vector; + agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_); @@ -119,7 +117,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)); - vertex_converter + vertex_converter converter(clipping_extent,*ras_ptr,line,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform diff --git a/src/grid/process_line_symbolizer.cpp b/src/grid/process_line_symbolizer.cpp index 2b2ffc947..904322870 100644 --- a/src/grid/process_line_symbolizer.cpp +++ b/src/grid/process_line_symbolizer.cpp @@ -50,9 +50,7 @@ void grid_renderer::process(line_symbolizer const& sym, using pixfmt_type = typename grid_renderer_base_type::pixfmt_type; using color_type = typename grid_renderer_base_type::pixfmt_type::color_type; using renderer_type = agg::renderer_scanline_bin_solid; - using conv_types = boost::mpl::vector; + agg::scanline_bin sl; grid_rendering_buffer buf(pixmap_.raw_data(), common_.width_, common_.height_, common_.width_); @@ -91,7 +89,9 @@ void grid_renderer::process(line_symbolizer const& sym, clipping_extent.pad(padding); } - vertex_converter + vertex_converter converter(clipping_extent,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (clip) converter.set(); // optional clip (default: true) converter.set(); // always transform diff --git a/src/grid/process_polygon_pattern_symbolizer.cpp b/src/grid/process_polygon_pattern_symbolizer.cpp index ccb0a1560..45492c1ec 100644 --- a/src/grid/process_polygon_pattern_symbolizer.cpp +++ b/src/grid/process_polygon_pattern_symbolizer.cpp @@ -77,8 +77,7 @@ void grid_renderer::process(polygon_pattern_symbolizer const& sym, evaluate_transform(tr, feature, common_.vars_, *transform, common_.scale_factor_); } - using conv_types = boost::mpl::vector; - vertex_converter + vertex_converter converter(common_.query_extent_,*ras_ptr,sym,common_.t_,prj_trans,tr,feature,common_.vars_,common_.scale_factor_); if (prj_trans.equal() && clip) converter.set(); //optional clip (default: true) diff --git a/src/grid/process_polygon_symbolizer.cpp b/src/grid/process_polygon_symbolizer.cpp index 08b50fddd..f06893e96 100644 --- a/src/grid/process_polygon_symbolizer.cpp +++ b/src/grid/process_polygon_symbolizer.cpp @@ -53,8 +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 conv_types = boost::mpl::vector; - using vertex_converter_type = vertex_converter; + using vertex_converter_type = vertex_converter; ras_ptr->reset();