diff --git a/src/agg/process_polygon_pattern_symbolizer.cpp b/src/agg/process_polygon_pattern_symbolizer.cpp index 5fc8f8236..eb19d19ed 100644 --- a/src/agg/process_polygon_pattern_symbolizer.cpp +++ b/src/agg/process_polygon_pattern_symbolizer.cpp @@ -79,7 +79,7 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, typedef coord_transform2 path_type; agg::rendering_buffer buf(current_buffer_->raw_data(), width_, height_, width_ * 4); - agg::pixfmt_rgba32_plain pixf(buf); + //agg::pixfmt_rgba32_plain pixf(buf); agg::scanline_u8 sl; ras_ptr->reset(); @@ -109,26 +109,31 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, if (!pat) return; + typedef agg::rgba8 color; + typedef agg::order_rgba order; + typedef agg::pixel32_type pixel_type; + typedef agg::comp_op_adaptor_rgba blender_type; typedef agg::wrap_mode_repeat wrap_x_type; - typedef agg::wrap_mode_repeat wrap_y_type; - typedef agg::pixfmt_alpha_blend_rgba, agg::pixel32_type> rendering_buffer; - typedef agg::image_accessor_wrap pixfmt_type; + typedef agg::image_accessor_wrap img_source_type; + wrap_y_type> img_source_type; typedef agg::span_pattern_rgba span_gen_type; - typedef agg::renderer_base ren_base; + typedef agg::renderer_base ren_base; + typedef agg::renderer_scanline_aa, span_gen_type> renderer_type; - + + pixfmt_type pixf(buf); + if (sym.comp_op()) pixf.comp_op(static_cast(*sym.comp_op())); ren_base renb(pixf); + unsigned w=(*pat)->width(); unsigned h=(*pat)->height(); - agg::row_accessor pattern_rbuf((agg::int8u*)(*pat)->getBytes(),w,h,w*4); - agg::span_allocator sa; - rendering_buffer pixf_pattern(pattern_rbuf); - + agg::rendering_buffer pattern_rbuf((agg::int8u*)(*pat)->getBytes(),w,h,w*4); + agg::pixfmt_rgba32 pixf_pattern(pattern_rbuf); pixf_pattern.for_each_pixel(multiplier()); img_source_type img_src(pixf_pattern); @@ -154,11 +159,11 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, } span_gen_type sg(img_src, offset_x, offset_y); - renderer_type rp(renb,sa, sg); - //metawriter_with_properties writer = sym.get_metawriter(); + agg::span_allocator sa; + renderer_type rp(renb,sa, sg); - box2d inflated_extent = query_extent_ * 1.1; + box2d inflated_extent = query_extent_ * 1.0; typedef boost::mpl::vector conv_types; vertex_converter,rasterizer,polygon_pattern_symbolizer, proj_transform, CoordTransform,conv_types> converter(inflated_extent,*ras_ptr,sym,t_,prj_trans, scale_factor_); @@ -166,7 +171,7 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, if (sym.clip()) converter.set(); //optional clip (default: true) converter.set(); //always transform if (sym.smooth() > 0.0) converter.set(); // optional smooth converter - + BOOST_FOREACH( geometry_type & geom, feature->paths()) { if (geom.num_points() > 2) @@ -174,7 +179,7 @@ void agg_renderer::process(polygon_pattern_symbolizer const& sym, converter.apply(geom); } } - + agg::render_scanlines(*ras_ptr, sl, rp); }