2013-11-15 07:11:21 +00:00
|
|
|
#include "bench_framework.hpp"
|
|
|
|
#include <mapnik/image_util.hpp>
|
|
|
|
#include <mapnik/graphics.hpp>
|
|
|
|
|
|
|
|
class test : public benchmark::test_case
|
|
|
|
{
|
2014-12-04 10:02:42 +00:00
|
|
|
mapnik::image_data_rgba8 im_;
|
2013-11-15 07:11:21 +00:00
|
|
|
public:
|
|
|
|
test(mapnik::parameters const& params)
|
|
|
|
: test_case(params),
|
|
|
|
im_(256,256) {}
|
|
|
|
bool validate() const
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2014-12-12 16:59:45 +00:00
|
|
|
bool operator()() const
|
2013-11-15 07:11:21 +00:00
|
|
|
{
|
|
|
|
std::string out;
|
|
|
|
for (std::size_t i=0;i<iterations_;++i) {
|
|
|
|
out.clear();
|
2014-05-05 17:07:57 +00:00
|
|
|
out = mapnik::save_to_string(im_,"png8:m=h:z=1");
|
2013-11-15 07:11:21 +00:00
|
|
|
}
|
|
|
|
}
|
2014-12-12 16:59:45 +00:00
|
|
|
return true;
|
2013-11-15 07:11:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
BENCHMARK(test,"encoding blank png")
|