From 1eb298f48cbf84db9aecd2012bcb9f47fae7c922 Mon Sep 17 00:00:00 2001 From: Mickey Rose Date: Thu, 28 Jan 2016 01:53:06 +0100 Subject: [PATCH] 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 --- .../render_thunk_extractor.hpp | 3 ++- .../render_thunk_extractor.cpp | 20 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/include/mapnik/renderer_common/render_thunk_extractor.hpp b/include/mapnik/renderer_common/render_thunk_extractor.hpp index fba63e4a5..3ea86f6d7 100644 --- a/include/mapnik/renderer_common/render_thunk_extractor.hpp +++ b/include/mapnik/renderer_common/render_thunk_extractor.hpp @@ -78,7 +78,8 @@ struct render_thunk_extractor } 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 & box_; render_thunk_list & thunks_; diff --git a/src/renderer_common/render_thunk_extractor.cpp b/src/renderer_common/render_thunk_extractor.cpp index 96208e577..c437262da 100644 --- a/src/renderer_common/render_thunk_extractor.cpp +++ b/src/renderer_common/render_thunk_extractor.cpp @@ -98,15 +98,17 @@ void render_thunk_extractor::operator()(markers_symbolizer const& sym) const void render_thunk_extractor::operator()(text_symbolizer const& sym) const { - extract_text_thunk(sym); + auto helper = std::make_unique( + 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 -{ - extract_text_thunk(sym); -} - -void render_thunk_extractor::extract_text_thunk(text_symbolizer const& sym) const { auto helper = std::make_unique( 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_, 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(sym, keys::opacity, feature_, common_.vars_, 1.0); composite_mode_e comp_op = get(sym, keys::comp_op, feature_, common_.vars_, src_over); halo_rasterizer_enum halo_rasterizer = get(sym, keys::halo_rasterizer, feature_, common_.vars_, HALO_RASTERIZER_FULL);