Use feature_id in render_id [WIP] [skip ci]

This commit is contained in:
Artem Pavlenko 2022-11-22 10:56:17 +00:00
parent 4ef05da536
commit 8c04fb1262

View file

@ -475,12 +475,14 @@ class renderer_agg : util::noncopyable
{ {
grid_renderer(renderer_agg& renderer, grid_renderer(renderer_agg& renderer,
Rasterizer& ras, Scanline& sl, Renderer& ren, Rasterizer& ras, Scanline& sl, Renderer& ren,
agg::trans_affine const& mtx) agg::trans_affine const& mtx,
mapnik::value_integer const& feature_id)
: renderer_(renderer), : renderer_(renderer),
ras_(ras), ras_(ras),
sl_(sl), sl_(sl),
ren_(ren), ren_(ren),
mtx_(mtx) mtx_(mtx),
feature_id_(feature_id)
{} {}
void operator() (group const& g) const void operator() (group const& g) const
@ -488,7 +490,7 @@ class renderer_agg : util::noncopyable
for (auto const& elem : g.elements) for (auto const& elem : g.elements)
{ {
mapbox::util::apply_visitor( mapbox::util::apply_visitor(
grid_renderer(renderer_, ras_, sl_, ren_, mtx_), elem); grid_renderer(renderer_, ras_, sl_, ren_, mtx_, feature_id_), elem);
} }
} }
void operator() (path_attributes const& attr) const void operator() (path_attributes const& attr) const
@ -513,7 +515,7 @@ class renderer_agg : util::noncopyable
renderer_.curved_.approximation_scale(scl); renderer_.curved_.approximation_scale(scl);
renderer_.curved_.angle_tolerance(0.0); renderer_.curved_.angle_tolerance(0.0);
typename PixelFormat::color_type color{0}; typename PixelFormat::color_type color{feature_id_};
if (attr.fill_flag || attr.fill_gradient.get_gradient_type() != NO_GRADIENT) if (attr.fill_flag || attr.fill_gradient.get_gradient_type() != NO_GRADIENT)
{ {
@ -567,6 +569,7 @@ class renderer_agg : util::noncopyable
Scanline& sl_; Scanline& sl_;
Renderer& ren_; Renderer& ren_;
agg::trans_affine const& mtx_; agg::trans_affine const& mtx_;
mapnik::value_integer const& feature_id_;
}; };
template<typename Rasterizer, typename Scanline, typename Renderer> template<typename Rasterizer, typename Scanline, typename Renderer>
@ -582,7 +585,7 @@ class renderer_agg : util::noncopyable
for (auto const& elem : svg_group_.elements) for (auto const& elem : svg_group_.elements)
{ {
mapbox::util::apply_visitor(grid_renderer<Rasterizer, Scanline, Renderer> mapbox::util::apply_visitor(grid_renderer<Rasterizer, Scanline, Renderer>
(*this, ras, sl, ren, mtx), elem); (*this, ras, sl, ren, mtx, feature_id), elem);
} }
} }
#endif #endif