Merge branch 'master' into large_csv

This commit is contained in:
artemp 2015-06-08 17:21:25 +01:00
commit 82a8735ef8
10 changed files with 51 additions and 29 deletions

View file

@ -24,12 +24,11 @@
#define MAPNIK_MARKER_HELPERS_HPP #define MAPNIK_MARKER_HELPERS_HPP
#include <mapnik/feature.hpp> #include <mapnik/feature.hpp>
#include <mapnik/color.hpp>
#include <mapnik/geometry.hpp> #include <mapnik/geometry.hpp>
#include <mapnik/geometry_type.hpp> #include <mapnik/geometry_type.hpp>
#include <mapnik/geometry_centroid.hpp> #include <mapnik/geometry_centroid.hpp>
#include <mapnik/symbolizer.hpp> #include <mapnik/symbolizer.hpp>
#include <mapnik/svg/svg_converter.hpp> #include <mapnik/svg/svg_path_attributes.hpp>
#include <mapnik/marker.hpp> // for svg_storage_type #include <mapnik/marker.hpp> // for svg_storage_type
#include <mapnik/markers_placement.hpp> #include <mapnik/markers_placement.hpp>
#include <mapnik/attribute.hpp> #include <mapnik/attribute.hpp>
@ -47,8 +46,6 @@ namespace mapnik {
struct clip_poly_tag; struct clip_poly_tag;
namespace svg { struct path_attributes; }
using svg_attribute_type = agg::pod_bvector<svg::path_attributes>; using svg_attribute_type = agg::pod_bvector<svg::path_attributes>;
template <typename Detector> template <typename Detector>

View file

@ -47,8 +47,6 @@
namespace mapnik { namespace mapnik {
class proj_transform;
struct glyph_info;
class text_symbolizer_helper; class text_symbolizer_helper;
using svg::svg_path_adapter; 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 // This should allow us to re-use as much as possible of the
// existing symbolizer layout and rendering code while still // existing symbolizer layout and rendering code while still
// being able to interpose our own decisions about whether // 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 // Thunk for rendering a particular instance of a point - this
// stores all the arguments necessary to re-render this point // 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, composite_mode_e comp_op,
bool snap_to_pixels); bool snap_to_pixels);
vector_marker_render_thunk(vector_marker_render_thunk && rhs) 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_)) {}
}; };
struct raster_marker_render_thunk : util::noncopyable struct raster_marker_render_thunk : util::noncopyable
@ -140,12 +132,7 @@ struct raster_marker_render_thunk : util::noncopyable
composite_mode_e comp_op, composite_mode_e comp_op,
bool snap_to_pixels); bool snap_to_pixels);
raster_marker_render_thunk(raster_marker_render_thunk && rhs) 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_)) {}
}; };
using helper_ptr = std::unique_ptr<text_symbolizer_helper>; using helper_ptr = std::unique_ptr<text_symbolizer_helper>;
@ -164,12 +151,7 @@ struct text_render_thunk : util::noncopyable
double opacity, composite_mode_e comp_op, double opacity, composite_mode_e comp_op,
halo_rasterizer_enum halo_rasterizer); halo_rasterizer_enum halo_rasterizer);
text_render_thunk(text_render_thunk && rhs) 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_)) {}
}; };
@ -395,7 +377,7 @@ void render_group_symbolizer(group_symbolizer const& sym,
rpt_key_expr = get<expression_ptr>(sym, keys::repeat_key); rpt_key_expr = get<expression_ptr>(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) if (rpt_key_expr)
{ {
rpt_key_value = util::apply_visitor(evaluate<Feature,value_type,attributes>(*match_feature,common.vars_), rpt_key_value = util::apply_visitor(evaluate<Feature,value_type,attributes>(*match_feature,common.vars_),

View file

@ -22,6 +22,7 @@
// mapnik // mapnik
#include <mapnik/marker_helpers.hpp> #include <mapnik/marker_helpers.hpp>
#include <mapnik/svg/svg_converter.hpp>
#include "agg_ellipse.h" #include "agg_ellipse.h"
#include "agg_color_rgba.h" #include "agg_color_rgba.h"

View file

@ -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) 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, raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src,
agg::trans_affine const& marker_trans, agg::trans_affine const& marker_trans,
double opacity, double opacity,
@ -46,6 +55,14 @@ raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src,
snap_to_pixels_(snap_to_pixels) 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, text_render_thunk::text_render_thunk(helper_ptr && helper,
double opacity, composite_mode_e comp_op, double opacity, composite_mode_e comp_op,
halo_rasterizer_enum halo_rasterizer) halo_rasterizer_enum halo_rasterizer)
@ -56,6 +73,13 @@ text_render_thunk::text_render_thunk(helper_ptr && helper,
halo_rasterizer_(halo_rasterizer) 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 { namespace detail {
template <typename Detector, typename RendererContext> template <typename Detector, typename RendererContext>

@ -1 +1 @@
Subproject commit 1bcc3238531761998109f8ee7951c2cd411b746a Subproject commit 9a61f97dacf47f33538078a50b52122947d31caf

View file

@ -2,7 +2,10 @@
#include "catch.hpp" #include "catch.hpp"
#include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser() #include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser()
#if defined(HAVE_CAIRO)
#include <cairo.h> #include <cairo.h>
#endif
#include <unicode/uclean.h> #include <unicode/uclean.h>
#ifdef MAPNIK_USE_PROJ4 #ifdef MAPNIK_USE_PROJ4
@ -17,8 +20,10 @@ int main (int argc, char* const argv[])
// http://xmlsoft.org/xmlmem.html // http://xmlsoft.org/xmlmem.html
xmlCleanupParser(); xmlCleanupParser();
#if defined(HAVE_CAIRO)
// http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data
cairo_debug_reset_static_data(); cairo_debug_reset_static_data();
#endif
// http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920
u_cleanup(); u_cleanup();

View file

@ -33,7 +33,9 @@
// mapnik // mapnik
#include <mapnik/map.hpp> #include <mapnik/map.hpp>
#include <mapnik/agg_renderer.hpp> #include <mapnik/agg_renderer.hpp>
#if defined(GRID_RENDERER)
#include <mapnik/grid/grid_renderer.hpp> #include <mapnik/grid/grid_renderer.hpp>
#endif
#if defined(HAVE_CAIRO) #if defined(HAVE_CAIRO)
#include <mapnik/cairo/cairo_renderer.hpp> #include <mapnik/cairo/cairo_renderer.hpp>
#include <mapnik/cairo/cairo_image_util.hpp> #include <mapnik/cairo/cairo_image_util.hpp>
@ -140,6 +142,7 @@ struct svg_renderer : renderer_base<std::string>
}; };
#endif #endif
#if defined(GRID_RENDERER)
struct grid_renderer : renderer_base<mapnik::image_rgba8> struct grid_renderer : renderer_base<mapnik::image_rgba8>
{ {
static constexpr const char * name = "grid"; static constexpr const char * name = "grid";
@ -186,6 +189,7 @@ struct grid_renderer : renderer_base<mapnik::image_rgba8>
return image; return image;
} }
}; };
#endif
template <typename Renderer> template <typename Renderer>
class renderer class renderer

View file

@ -30,7 +30,9 @@
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
#include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser() #include <libxml/parser.h> // for xmlInitParser(), xmlCleanupParser()
#if defined(HAVE_CAIRO)
#include <cairo.h> #include <cairo.h>
#endif
#include <unicode/uclean.h> #include <unicode/uclean.h>
#ifdef MAPNIK_USE_PROJ4 #ifdef MAPNIK_USE_PROJ4
@ -116,8 +118,10 @@ int main(int argc, char** argv)
// http://xmlsoft.org/xmlmem.html // http://xmlsoft.org/xmlmem.html
xmlCleanupParser(); xmlCleanupParser();
#if defined(HAVE_CAIRO)
// http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data // http://cairographics.org/manual/cairo-Error-handling.html#cairo-debug-reset-static-data
cairo_debug_reset_static_data(); cairo_debug_reset_static_data();
#endif
// http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920 // http://icu-project.org/apiref/icu4c/uclean_8h.html#a93f27d0ddc7c196a1da864763f2d8920
u_cleanup(); u_cleanup();

View file

@ -67,7 +67,9 @@ runner::runner(runner::path_type const & styles_dir,
#if defined(SVG_RENDERER) #if defined(SVG_RENDERER)
,renderer<svg_renderer>(output_dir_, reference_dir_, overwrite) ,renderer<svg_renderer>(output_dir_, reference_dir_, overwrite)
#endif #endif
#if defined(GRID_RENDERER)
,renderer<grid_renderer>(output_dir_, reference_dir_, overwrite) ,renderer<grid_renderer>(output_dir_, reference_dir_, overwrite)
#endif
} }
{ {
} }

View file

@ -42,7 +42,10 @@ class runner
#if defined(SVG_RENDERER) #if defined(SVG_RENDERER)
,renderer<svg_renderer> ,renderer<svg_renderer>
#endif #endif
,renderer<grid_renderer>>; #if defined(GRID_RENDERER)
,renderer<grid_renderer>
#endif
>;
using path_type = boost::filesystem::path; using path_type = boost::filesystem::path;
using files_iterator = std::vector<path_type>::const_iterator; using files_iterator = std::vector<path_type>::const_iterator;