+ re-use cairo_context
This commit is contained in:
parent
66beaaa05b
commit
c95959c549
1 changed files with 17 additions and 18 deletions
|
@ -745,7 +745,6 @@ void cairo_renderer_base::start_map_processing(Map const& map)
|
|||
smooth_type smooth(path);
|
||||
smooth.smooth_value(sym.smooth());
|
||||
context.add_agg_path(smooth);
|
||||
context.fill();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -755,10 +754,11 @@ void cairo_renderer_base::start_map_processing(Map const& map)
|
|||
clipped.clip_box(query_extent_.minx(),query_extent_.miny(),query_extent_.maxx(),query_extent_.maxy());
|
||||
path_type path(t_,clipped,prj_trans);
|
||||
context.add_path(path);
|
||||
context.fill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// fill polygon
|
||||
context.fill();
|
||||
}
|
||||
|
||||
void cairo_renderer_base::process(building_symbolizer const& sym,
|
||||
|
@ -877,35 +877,34 @@ void cairo_renderer_base::start_map_processing(Map const& map)
|
|||
{
|
||||
typedef agg::conv_clip_polyline<geometry_type> clipped_geometry_type;
|
||||
typedef coord_transform2<CoordTransform,clipped_geometry_type> path_type;
|
||||
|
||||
cairo_context context(context_);
|
||||
|
||||
mapnik::stroke const& stroke_ = sym.get_stroke();
|
||||
|
||||
cairo_context context(context_);
|
||||
context.set_color(stroke_.get_color(), stroke_.get_opacity());
|
||||
|
||||
context.set_line_join(stroke_.get_line_join());
|
||||
context.set_line_cap(stroke_.get_line_cap());
|
||||
context.set_miter_limit(4.0);
|
||||
context.set_line_width(stroke_.get_width());
|
||||
if (stroke_.has_dash())
|
||||
{
|
||||
context.set_dash(stroke_.get_dash_array());
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < feature->num_geometries(); ++i)
|
||||
{
|
||||
geometry_type & geom = feature->get_geometry(i);
|
||||
|
||||
if (geom.num_points() > 1)
|
||||
{
|
||||
cairo_context context(context_);
|
||||
//cairo_context context(context_);
|
||||
clipped_geometry_type clipped(geom);
|
||||
clipped.clip_box(query_extent_.minx(),query_extent_.miny(),query_extent_.maxx(),query_extent_.maxy());
|
||||
path_type path(t_,clipped,prj_trans);
|
||||
if (stroke_.has_dash())
|
||||
{
|
||||
context.set_dash(stroke_.get_dash_array());
|
||||
}
|
||||
|
||||
context.set_line_join(stroke_.get_line_join());
|
||||
context.set_line_cap(stroke_.get_line_cap());
|
||||
context.set_miter_limit(4.0);
|
||||
context.set_line_width(stroke_.get_width());
|
||||
|
||||
context.add_path(path);
|
||||
context.stroke();
|
||||
}
|
||||
}
|
||||
context.stroke();
|
||||
}
|
||||
|
||||
void cairo_renderer_base::render_marker(pixel_position const& pos, marker const& marker, const agg::trans_affine & tr, double opacity)
|
||||
|
|
Loading…
Add table
Reference in a new issue