no need for templated 'raster_marker_render_thunk'

This commit is contained in:
Dane Springmeyer 2015-02-19 01:36:43 -08:00
parent 5180168491
commit cb869e60f3
4 changed files with 7 additions and 11 deletions

View file

@ -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>;

View file

@ -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;

View file

@ -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_);

View file

@ -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)));
}