From 29c9e97d7658c289721a6cddad660b19f2732a47 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 6 Jun 2015 08:09:06 -0700 Subject: [PATCH 1/4] minor code cleanup in process_group_symbolizer --- .../process_group_symbolizer.hpp | 28 ++++--------------- .../process_group_symbolizer.cpp | 24 ++++++++++++++++ test/data-visual | 2 +- 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/include/mapnik/renderer_common/process_group_symbolizer.hpp b/include/mapnik/renderer_common/process_group_symbolizer.hpp index c072ca5db..07adf5408 100644 --- a/include/mapnik/renderer_common/process_group_symbolizer.hpp +++ b/include/mapnik/renderer_common/process_group_symbolizer.hpp @@ -47,8 +47,6 @@ namespace mapnik { -class proj_transform; -struct glyph_info; class text_symbolizer_helper; using svg::svg_path_adapter; @@ -95,7 +93,7 @@ struct virtual_renderer_common : private util::noncopyable // This should allow us to re-use as much as possible of the // existing symbolizer layout and rendering code while still // being able to interpose our own decisions about whether -// a collision has occured or not. +// a collision has occurred or not. // Thunk for rendering a particular instance of a point - this // stores all the arguments necessary to re-render this point @@ -117,13 +115,7 @@ struct vector_marker_render_thunk : util::noncopyable composite_mode_e comp_op, bool snap_to_pixels); - vector_marker_render_thunk(vector_marker_render_thunk && rhs) - : src_(std::move(rhs.src_)), - attrs_(std::move(rhs.attrs_)), - tr_(std::move(rhs.tr_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + vector_marker_render_thunk(vector_marker_render_thunk && rhs); }; struct raster_marker_render_thunk : util::noncopyable @@ -140,12 +132,7 @@ struct raster_marker_render_thunk : util::noncopyable composite_mode_e comp_op, bool snap_to_pixels); - raster_marker_render_thunk(raster_marker_render_thunk && rhs) - : src_(rhs.src_), - tr_(std::move(rhs.tr_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + raster_marker_render_thunk(raster_marker_render_thunk && rhs); }; using helper_ptr = std::unique_ptr; @@ -164,12 +151,7 @@ struct text_render_thunk : util::noncopyable double opacity, composite_mode_e comp_op, halo_rasterizer_enum halo_rasterizer); - text_render_thunk(text_render_thunk && rhs) - : helper_(std::move(rhs.helper_)), - placements_(std::move(rhs.placements_)), - opacity_(std::move(rhs.opacity_)), - comp_op_(std::move(rhs.comp_op_)), - halo_rasterizer_(std::move(rhs.halo_rasterizer_)) {} + text_render_thunk(text_render_thunk && rhs); }; @@ -395,7 +377,7 @@ void render_group_symbolizer(group_symbolizer const& sym, rpt_key_expr = get(sym, keys::repeat_key); } - // evalute the repeat key with the matched sub feature if we have one + // evaluate the repeat key with the matched sub feature if we have one if (rpt_key_expr) { rpt_key_value = util::apply_visitor(evaluate(*match_feature,common.vars_), diff --git a/src/renderer_common/process_group_symbolizer.cpp b/src/renderer_common/process_group_symbolizer.cpp index bac2631df..33a8c2ba9 100644 --- a/src/renderer_common/process_group_symbolizer.cpp +++ b/src/renderer_common/process_group_symbolizer.cpp @@ -37,6 +37,15 @@ vector_marker_render_thunk::vector_marker_render_thunk(svg_path_ptr const& src, comp_op_(comp_op), snap_to_pixels_(snap_to_pixels) {} +vector_marker_render_thunk::vector_marker_render_thunk(vector_marker_render_thunk && rhs) + : src_(std::move(rhs.src_)), + attrs_(std::move(rhs.attrs_)), + tr_(std::move(rhs.tr_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + + raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src, agg::trans_affine const& marker_trans, double opacity, @@ -46,6 +55,14 @@ raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src, snap_to_pixels_(snap_to_pixels) {} +raster_marker_render_thunk::raster_marker_render_thunk(raster_marker_render_thunk && rhs) + : src_(rhs.src_), + tr_(std::move(rhs.tr_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {} + + text_render_thunk::text_render_thunk(helper_ptr && helper, double opacity, composite_mode_e comp_op, halo_rasterizer_enum halo_rasterizer) @@ -56,6 +73,13 @@ text_render_thunk::text_render_thunk(helper_ptr && helper, halo_rasterizer_(halo_rasterizer) {} +text_render_thunk::text_render_thunk(text_render_thunk && rhs) + : helper_(std::move(rhs.helper_)), + placements_(std::move(rhs.placements_)), + opacity_(std::move(rhs.opacity_)), + comp_op_(std::move(rhs.comp_op_)), + halo_rasterizer_(std::move(rhs.halo_rasterizer_)) {} + namespace detail { template diff --git a/test/data-visual b/test/data-visual index 1bcc32385..9a61f97da 160000 --- a/test/data-visual +++ b/test/data-visual @@ -1 +1 @@ -Subproject commit 1bcc3238531761998109f8ee7951c2cd411b746a +Subproject commit 9a61f97dacf47f33538078a50b52122947d31caf From d7bffd51f2ab30c29d04465119976594d4d94b6d Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 6 Jun 2015 08:19:54 -0700 Subject: [PATCH 2/4] shuffle marker_helpers includes --- include/mapnik/marker_helpers.hpp | 5 +---- src/marker_helpers.cpp | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/mapnik/marker_helpers.hpp b/include/mapnik/marker_helpers.hpp index 15dca626d..0c3a91040 100644 --- a/include/mapnik/marker_helpers.hpp +++ b/include/mapnik/marker_helpers.hpp @@ -24,12 +24,11 @@ #define MAPNIK_MARKER_HELPERS_HPP #include -#include #include #include #include #include -#include +#include #include // for svg_storage_type #include #include @@ -47,8 +46,6 @@ namespace mapnik { struct clip_poly_tag; -namespace svg { struct path_attributes; } - using svg_attribute_type = agg::pod_bvector; template diff --git a/src/marker_helpers.cpp b/src/marker_helpers.cpp index bdc70fab0..57c32705a 100644 --- a/src/marker_helpers.cpp +++ b/src/marker_helpers.cpp @@ -22,6 +22,7 @@ // mapnik #include +#include #include "agg_ellipse.h" #include "agg_color_rgba.h" From 583fbaec1465f9204220cd6ea4c0ab02f2996853 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 6 Jun 2015 12:30:56 -0700 Subject: [PATCH 3/4] fix test compile if cairo is disabled --- test/unit/run.cpp | 5 +++++ test/visual/run.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/test/unit/run.cpp b/test/unit/run.cpp index 74b071550..59d6f2812 100644 --- a/test/unit/run.cpp +++ b/test/unit/run.cpp @@ -2,7 +2,10 @@ #include "catch.hpp" #include // for xmlInitParser(), xmlCleanupParser() + +#if defined(HAVE_CAIRO) #include +#endif #include #ifdef MAPNIK_USE_PROJ4 @@ -17,8 +20,10 @@ int main (int argc, char* const argv[]) // http://xmlsoft.org/xmlmem.html xmlCleanupParser(); +#if defined(HAVE_CAIRO) // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data cairo_debug_reset_static_data(); +#endif // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 u_cleanup(); diff --git a/test/visual/run.cpp b/test/visual/run.cpp index 89e7b0a67..6a80327c0 100644 --- a/test/visual/run.cpp +++ b/test/visual/run.cpp @@ -30,7 +30,9 @@ #include #include // for xmlInitParser(), xmlCleanupParser() +#if defined(HAVE_CAIRO) #include +#endif #include #ifdef MAPNIK_USE_PROJ4 @@ -116,8 +118,10 @@ int main(int argc, char** argv) // http://xmlsoft.org/xmlmem.html xmlCleanupParser(); +#if defined(HAVE_CAIRO) // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data cairo_debug_reset_static_data(); +#endif // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 u_cleanup(); From fad969421f44d6cd5f132b150509a592c213a427 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sat, 6 Jun 2015 12:42:00 -0700 Subject: [PATCH 4/4] ensure visual tests compile if GRID_RENDERER is disabled --- test/visual/renderer.hpp | 4 ++++ test/visual/runner.cpp | 2 ++ test/visual/runner.hpp | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test/visual/renderer.hpp b/test/visual/renderer.hpp index 6d99c3a74..7dbfb0412 100644 --- a/test/visual/renderer.hpp +++ b/test/visual/renderer.hpp @@ -33,7 +33,9 @@ // mapnik #include #include +#if defined(GRID_RENDERER) #include +#endif #if defined(HAVE_CAIRO) #include #include @@ -140,6 +142,7 @@ struct svg_renderer : renderer_base }; #endif +#if defined(GRID_RENDERER) struct grid_renderer : renderer_base { static constexpr const char * name = "grid"; @@ -186,6 +189,7 @@ struct grid_renderer : renderer_base return image; } }; +#endif template class renderer diff --git a/test/visual/runner.cpp b/test/visual/runner.cpp index 317c7cf62..f2562c197 100644 --- a/test/visual/runner.cpp +++ b/test/visual/runner.cpp @@ -67,7 +67,9 @@ runner::runner(runner::path_type const & styles_dir, #if defined(SVG_RENDERER) ,renderer(output_dir_, reference_dir_, overwrite) #endif +#if defined(GRID_RENDERER) ,renderer(output_dir_, reference_dir_, overwrite) +#endif } { } diff --git a/test/visual/runner.hpp b/test/visual/runner.hpp index 5a4fd39a4..77949e46e 100644 --- a/test/visual/runner.hpp +++ b/test/visual/runner.hpp @@ -42,7 +42,10 @@ class runner #if defined(SVG_RENDERER) ,renderer #endif - ,renderer>; +#if defined(GRID_RENDERER) + ,renderer +#endif + >; using path_type = boost::filesystem::path; using files_iterator = std::vector::const_iterator;