From 280c280a9c660152f38e56b0814c80fe55989a2a Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Wed, 8 Oct 2014 14:23:33 -0700 Subject: [PATCH] make rendering bench shell easy to run --- benchmark/test_rendering.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/benchmark/test_rendering.cpp b/benchmark/test_rendering.cpp index 73ab6fb74..a5a76d06e 100644 --- a/benchmark/test_rendering.cpp +++ b/benchmark/test_rendering.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include class test : public benchmark::test_case @@ -36,17 +37,22 @@ public: if (!extent_.from_string(*ext)) throw std::runtime_error("could not parse `extent` string" + *ext); } + /* else { throw std::runtime_error("please provide a --extent= arg"); - } + }*/ } bool validate() const { mapnik::Map m(width_,height_); mapnik::load_map(m,xml_,true); - m.zoom_to_box(extent_); + if (extent_.valid()) { + m.zoom_to_box(extent_); + } else { + m.zoom_all(); + } mapnik::image_32 im(m.width(),m.height()); mapnik::agg_renderer ren(m,im); ren.apply(); @@ -57,7 +63,11 @@ public: { mapnik::Map m(width_,height_); mapnik::load_map(m,xml_); - m.zoom_to_box(extent_); + if (extent_.valid()) { + m.zoom_to_box(extent_); + } else { + m.zoom_all(); + } for (unsigned i=0;i