Merge branch 'release/image_data_any' of github.com:mapnik/mapnik into release/image_data_any
This commit is contained in:
commit
198be8f1cc
7 changed files with 10 additions and 14 deletions
|
@ -46,7 +46,7 @@ class MAPNIK_DECL marker_cache :
|
|||
private:
|
||||
marker_cache();
|
||||
~marker_cache();
|
||||
bool insert_marker(std::string const& key, marker & path);
|
||||
bool insert_marker(std::string const& key, marker && path);
|
||||
boost::unordered_map<std::string, mapnik::marker> marker_cache_;
|
||||
bool insert_svg(std::string const& name, std::string const& svg_string);
|
||||
boost::unordered_map<std::string,std::string> svg_cache_;
|
||||
|
|
|
@ -127,16 +127,15 @@ struct vector_marker_render_thunk : util::noncopyable
|
|||
snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {}
|
||||
};
|
||||
|
||||
template <typename BufferType>
|
||||
struct raster_marker_render_thunk : util::noncopyable
|
||||
{
|
||||
BufferType const& src_;
|
||||
image_rgba8 const& src_;
|
||||
agg::trans_affine tr_;
|
||||
double opacity_;
|
||||
composite_mode_e comp_op_;
|
||||
bool snap_to_pixels_;
|
||||
|
||||
raster_marker_render_thunk(BufferType const& src,
|
||||
raster_marker_render_thunk(image_rgba8 const& src,
|
||||
agg::trans_affine const& marker_trans,
|
||||
double opacity,
|
||||
composite_mode_e comp_op,
|
||||
|
@ -150,8 +149,6 @@ struct raster_marker_render_thunk : util::noncopyable
|
|||
snap_to_pixels_(std::move(rhs.snap_to_pixels_)) {}
|
||||
};
|
||||
|
||||
template struct raster_marker_render_thunk<image_rgba8>;
|
||||
|
||||
using helper_ptr = std::unique_ptr<text_symbolizer_helper>;
|
||||
|
||||
struct text_render_thunk : util::noncopyable
|
||||
|
@ -181,7 +178,7 @@ struct text_render_thunk : util::noncopyable
|
|||
// via a static visitor later.
|
||||
|
||||
using render_thunk = util::variant<vector_marker_render_thunk,
|
||||
raster_marker_render_thunk<image_rgba8>,
|
||||
raster_marker_render_thunk,
|
||||
text_render_thunk>;
|
||||
using render_thunk_ptr = std::unique_ptr<render_thunk>;
|
||||
using render_thunk_list = std::list<render_thunk_ptr>;
|
||||
|
|
|
@ -94,7 +94,7 @@ struct thunk_renderer<image_rgba8>
|
|||
render_vector_marker(svg_renderer, *ras_ptr_, renb, thunk.src_->bounding_box(), offset_tr, thunk.opacity_, thunk.snap_to_pixels_);
|
||||
}
|
||||
|
||||
void operator()(raster_marker_render_thunk<image_rgba8> const &thunk) const
|
||||
void operator()(raster_marker_render_thunk const &thunk) const
|
||||
{
|
||||
using blender_type = agg::comp_op_adaptor_rgba_pre<agg::rgba8, agg::order_rgba>; // comp blender
|
||||
using buf_type = agg::rendering_buffer;
|
||||
|
|
|
@ -77,7 +77,7 @@ struct thunk_renderer
|
|||
thunk.opacity_);
|
||||
}
|
||||
|
||||
void operator()(raster_marker_render_thunk<image_rgba8> const &thunk) const
|
||||
void operator()(raster_marker_render_thunk const& thunk) const
|
||||
{
|
||||
cairo_save_restore guard(context_);
|
||||
context_.set_operator(thunk.comp_op_);
|
||||
|
|
|
@ -105,7 +105,7 @@ struct thunk_renderer
|
|||
pixmap_.add_feature(feature_);
|
||||
}
|
||||
|
||||
void operator()(raster_marker_render_thunk<image_rgba8> const &thunk) const
|
||||
void operator()(raster_marker_render_thunk const &thunk) const
|
||||
{
|
||||
using buf_type = grid_rendering_buffer;
|
||||
using pixfmt_type = typename grid_renderer_base_type::pixfmt_type;
|
||||
|
|
|
@ -109,7 +109,7 @@ bool marker_cache::insert_svg(std::string const& name, std::string const& svg_st
|
|||
return false;
|
||||
}
|
||||
|
||||
bool marker_cache::insert_marker(std::string const& uri, mapnik::marker & path)
|
||||
bool marker_cache::insert_marker(std::string const& uri, mapnik::marker && path)
|
||||
{
|
||||
#ifdef MAPNIK_THREADSAFE
|
||||
mapnik::scoped_lock lock(mutex_);
|
||||
|
|
|
@ -39,8 +39,7 @@ vector_marker_render_thunk::vector_marker_render_thunk(svg_path_ptr const& src,
|
|||
comp_op_(comp_op), snap_to_pixels_(snap_to_pixels)
|
||||
{}
|
||||
|
||||
template <>
|
||||
raster_marker_render_thunk<image_rgba8>::raster_marker_render_thunk(image_rgba8 const& src,
|
||||
raster_marker_render_thunk::raster_marker_render_thunk(image_rgba8 const& src,
|
||||
agg::trans_affine const& marker_trans,
|
||||
double opacity,
|
||||
composite_mode_e comp_op,
|
||||
|
@ -116,7 +115,7 @@ struct raster_marker_thunk_dispatch : public raster_markers_dispatch<Detector>
|
|||
|
||||
void render_marker(agg::trans_affine const& marker_tr, double opacity)
|
||||
{
|
||||
raster_marker_render_thunk<image_rgba8> thunk(this->src_, marker_tr, opacity, comp_op_, snap_to_pixels_);
|
||||
raster_marker_render_thunk thunk(this->src_, marker_tr, opacity, comp_op_, snap_to_pixels_);
|
||||
thunks_.push_back(std::make_unique<render_thunk>(std::move(thunk)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue