+ enable multiple python threads with Cairo rennderer patch from jonb

This commit is contained in:
Artem Pavlenko 2009-01-10 23:30:33 +00:00
parent bb284d0cfc
commit 14fa35fb18

View file

@ -91,16 +91,20 @@ void render2(const mapnik::Map& map,mapnik::Image32& image)
void render3(const mapnik::Map& map,PycairoSurface* surface, unsigned offset_x = 0, unsigned offset_y = 0) void render3(const mapnik::Map& map,PycairoSurface* surface, unsigned offset_x = 0, unsigned offset_y = 0)
{ {
Py_BEGIN_ALLOW_THREADS
Cairo::RefPtr<Cairo::Surface> s(new Cairo::Surface(surface->surface)); Cairo::RefPtr<Cairo::Surface> s(new Cairo::Surface(surface->surface));
mapnik::cairo_renderer<Cairo::Surface> ren(map,s,offset_x, offset_y); mapnik::cairo_renderer<Cairo::Surface> ren(map,s,offset_x, offset_y);
ren.apply(); ren.apply();
Py_END_ALLOW_THREADS
} }
void render4(const mapnik::Map& map,PycairoSurface* surface) void render4(const mapnik::Map& map,PycairoSurface* surface)
{ {
Py_BEGIN_ALLOW_THREADS
Cairo::RefPtr<Cairo::Surface> s(new Cairo::Surface(surface->surface)); Cairo::RefPtr<Cairo::Surface> s(new Cairo::Surface(surface->surface));
mapnik::cairo_renderer<Cairo::Surface> ren(map,s); mapnik::cairo_renderer<Cairo::Surface> ren(map,s);
ren.apply(); ren.apply();
Py_END_ALLOW_THREADS
} }
#endif #endif