fix cairo_renderer usage in demo/viewer + revert aac69d0b34

This commit is contained in:
artemp 2014-08-11 13:40:12 +01:00
parent 9a1639a1d6
commit eabba25948
2 changed files with 4 additions and 1 deletions

View file

@ -533,9 +533,11 @@ void render_cairo(mapnik::Map const& map, double scaling_factor, QPixmap & pix)
#ifdef HAVE_CAIRO #ifdef HAVE_CAIRO
mapnik::cairo_surface_ptr image_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,map.width(),map.height()), mapnik::cairo_surface_ptr image_surface(cairo_image_surface_create(CAIRO_FORMAT_ARGB32,map.width(),map.height()),
mapnik::cairo_surface_closer()); mapnik::cairo_surface_closer());
mapnik::cairo_renderer<mapnik::cairo_surface_ptr> renderer(map, image_surface, scaling_factor); mapnik::cairo_ptr cairo = mapnik::create_context(image_surface);
if (cairo)
{ {
mapnik::auto_cpu_timer t(std::clog, "rendering took: "); mapnik::auto_cpu_timer t(std::clog, "rendering took: ");
mapnik::cairo_renderer<mapnik::cairo_ptr> renderer(map, cairo, scaling_factor);
renderer.apply(); renderer.apply();
} }
image_32 buf(image_surface); image_32 buf(image_surface);

View file

@ -226,6 +226,7 @@ void cairo_renderer<T>::render_marker(pixel_position const& pos,
} }
template class cairo_renderer<cairo_ptr>; template class cairo_renderer<cairo_ptr>;
} }
#endif // HAVE_CAIRO #endif // HAVE_CAIRO