2014-06-20 02:21:57 +02:00
|
|
|
#include "bench_framework.hpp"
|
|
|
|
#include <mapnik/font_engine_freetype.hpp>
|
|
|
|
#include <boost/format.hpp>
|
|
|
|
#include <boost/foreach.hpp>
|
|
|
|
|
|
|
|
class test : public benchmark::test_case
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
test(mapnik::parameters const& params)
|
|
|
|
: test_case(params) {}
|
|
|
|
bool validate() const
|
|
|
|
{
|
2017-05-26 16:52:50 +02:00
|
|
|
return mapnik::freetype_engine::instance().register_fonts("./fonts", true);
|
2014-06-20 02:21:57 +02:00
|
|
|
}
|
2014-12-12 17:59:45 +01:00
|
|
|
bool operator()() const
|
2014-06-20 02:21:57 +02:00
|
|
|
{
|
|
|
|
unsigned long count = 0;
|
|
|
|
for (unsigned i=0;i<iterations_;++i)
|
|
|
|
{
|
2017-05-26 16:52:50 +02:00
|
|
|
mapnik::freetype_engine::instance().register_fonts("./fonts", true);
|
2014-06-20 02:21:57 +02:00
|
|
|
count++;
|
|
|
|
}
|
2014-12-12 17:59:45 +01:00
|
|
|
return true;
|
2014-06-20 02:21:57 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-01-22 00:57:16 +01:00
|
|
|
BENCHMARK(test,"font registration")
|