Merge branch 'master' into clipper

Conflicts:
	include/mapnik/vertex_converters.hpp
This commit is contained in:
artemp 2013-02-19 09:08:17 +00:00
commit 90b0e65841
2 changed files with 16 additions and 3 deletions

View file

@ -356,7 +356,7 @@ struct test7
} }
void operator()() void operator()()
{ {
for (int i=0;i<iter_;++i) { for (unsigned i=0;i<iter_;++i) {
mapnik::expression_ptr expr = mapnik::parse_expression(expr_,"utf-8"); mapnik::expression_ptr expr = mapnik::parse_expression(expr_,"utf-8");
} }
} }
@ -386,7 +386,7 @@ struct test8
void operator()() void operator()()
{ {
mapnik::expression_grammar<std::string::const_iterator> expr_grammar(transcoder("utf-8")); mapnik::expression_grammar<std::string::const_iterator> expr_grammar(transcoder("utf-8"));
for (int i=0;i<iter_;++i) { for (unsigned i=0;i<iter_;++i) {
mapnik::expression_ptr expr = mapnik::parse_expression(expr_,expr_grammar); mapnik::expression_ptr expr = mapnik::parse_expression(expr_,expr_grammar);
} }
} }

View file

@ -55,6 +55,7 @@
// agg // agg
#include "agg_conv_clip_polygon.h" #include "agg_conv_clip_polygon.h"
#include "agg_conv_clip_polyline.h" #include "agg_conv_clip_polyline.h"
#include "agg_conv_close_polygon.h"
#include "agg_conv_smooth_poly1.h" #include "agg_conv_smooth_poly1.h"
#include "agg_conv_stroke.h" #include "agg_conv_stroke.h"
#include "agg_conv_dash.h" #include "agg_conv_dash.h"
@ -68,6 +69,7 @@ struct transform_tag {};
struct clip_line_tag {}; struct clip_line_tag {};
struct clip_poly_tag {}; struct clip_poly_tag {};
struct clipper_tag {}; struct clipper_tag {};
struct close_poly_tag {};
struct smooth_tag {}; struct smooth_tag {};
struct simplify_tag {}; struct simplify_tag {};
struct stroke_tag {}; struct stroke_tag {};
@ -196,7 +198,7 @@ struct converter_traits<T,mapnik::clipper_tag>
static void setup(geometry_type & geom, Args const& args) static void setup(geometry_type & geom, Args const& args)
{ {
typename boost::mpl::at<Args,boost::mpl::int_<0> >::type box = boost::fusion::at_c<0>(args); typename boost::mpl::at<Args,boost::mpl::int_<0> >::type box = boost::fusion::at_c<0>(args);
agg::path_storage * ps = new agg::path_storage(); // this will leak memory! agg::path_storage * ps = new agg::path_storage(); // FIXME: this will leak memory!
ps->move_to(box.minx(),box.miny()); ps->move_to(box.minx(),box.miny());
ps->line_to(box.minx(),box.maxy()); ps->line_to(box.minx(),box.maxy());
ps->line_to(box.maxx(),box.maxy()); ps->line_to(box.maxx(),box.maxy());
@ -207,6 +209,17 @@ struct converter_traits<T,mapnik::clipper_tag>
} }
}; };
template <typename T>
struct converter_traits<T,mapnik::close_poly_tag>
{
typedef T geometry_type;
typedef typename agg::conv_close_polygon<geometry_type> conv_type;
template <typename Args>
static void setup(geometry_type & geom, Args const& args)
{
// no-op
}
};
template <typename T> template <typename T>
struct converter_traits<T,mapnik::transform_tag> struct converter_traits<T,mapnik::transform_tag>