fix text_render_thunk construction

- this reverts render_thunk_extractor visitation by text/shield
  symbolizer back to how it works in master, only amended to avoid
  passing temporaries to text_symbolizer_helper
This commit is contained in:
Mickey Rose 2016-01-28 01:53:06 +01:00
parent 7bbc758fbc
commit 1eb298f48c
2 changed files with 16 additions and 7 deletions

View file

@ -78,7 +78,8 @@ struct render_thunk_extractor
} }
private: private:
void extract_text_thunk(text_symbolizer const& sym) const; void extract_text_thunk(text_render_thunk::helper_ptr && helper,
text_symbolizer const& sym) const;
box2d<double> & box_; box2d<double> & box_;
render_thunk_list & thunks_; render_thunk_list & thunks_;

View file

@ -98,15 +98,17 @@ void render_thunk_extractor::operator()(markers_symbolizer const& sym) const
void render_thunk_extractor::operator()(text_symbolizer const& sym) const void render_thunk_extractor::operator()(text_symbolizer const& sym) const
{ {
extract_text_thunk(sym); auto helper = std::make_unique<text_symbolizer_helper>(
sym, feature_, vars_, prj_trans_,
common_.width_, common_.height_,
common_.scale_factor_,
common_.t_, common_.font_manager_, *common_.detector_,
clipping_extent_, agg::trans_affine::identity);
extract_text_thunk(std::move(helper), sym);
} }
void render_thunk_extractor::operator()(shield_symbolizer const& sym) const void render_thunk_extractor::operator()(shield_symbolizer const& sym) const
{
extract_text_thunk(sym);
}
void render_thunk_extractor::extract_text_thunk(text_symbolizer const& sym) const
{ {
auto helper = std::make_unique<text_symbolizer_helper>( auto helper = std::make_unique<text_symbolizer_helper>(
sym, feature_, vars_, prj_trans_, sym, feature_, vars_, prj_trans_,
@ -115,6 +117,12 @@ void render_thunk_extractor::extract_text_thunk(text_symbolizer const& sym) cons
common_.t_, common_.font_manager_, *common_.detector_, common_.t_, common_.font_manager_, *common_.detector_,
clipping_extent_, agg::trans_affine::identity); clipping_extent_, agg::trans_affine::identity);
extract_text_thunk(std::move(helper), sym);
}
void render_thunk_extractor::extract_text_thunk(text_render_thunk::helper_ptr && helper,
text_symbolizer const& sym) const
{
double opacity = get<double>(sym, keys::opacity, feature_, common_.vars_, 1.0); double opacity = get<double>(sym, keys::opacity, feature_, common_.vars_, 1.0);
composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature_, common_.vars_, src_over); composite_mode_e comp_op = get<composite_mode_e>(sym, keys::comp_op, feature_, common_.vars_, src_over);
halo_rasterizer_enum halo_rasterizer = get<halo_rasterizer_enum>(sym, keys::halo_rasterizer, feature_, common_.vars_, HALO_RASTERIZER_FULL); halo_rasterizer_enum halo_rasterizer = get<halo_rasterizer_enum>(sym, keys::halo_rasterizer, feature_, common_.vars_, HALO_RASTERIZER_FULL);