2014-06-20 00:21:57 +00: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
|
|
|
|
{
|
2022-01-26 22:32:21 +00:00
|
|
|
public:
|
2014-06-20 00:21:57 +00:00
|
|
|
test(mapnik::parameters const& params)
|
2022-01-26 22:32:21 +00:00
|
|
|
: test_case(params)
|
|
|
|
{}
|
|
|
|
bool validate() const { return mapnik::freetype_engine::register_fonts("./fonts", true); }
|
2014-12-12 16:59:45 +00:00
|
|
|
bool operator()() const
|
2014-06-20 00:21:57 +00:00
|
|
|
{
|
|
|
|
unsigned long count = 0;
|
2022-01-26 22:32:21 +00:00
|
|
|
for (unsigned i = 0; i < iterations_; ++i)
|
2014-06-20 00:21:57 +00:00
|
|
|
{
|
|
|
|
mapnik::freetype_engine::register_fonts("./fonts", true);
|
|
|
|
count++;
|
|
|
|
}
|
2014-12-12 16:59:45 +00:00
|
|
|
return true;
|
2014-06-20 00:21:57 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-01-26 22:32:21 +00:00
|
|
|
BENCHMARK(test, "font registration")
|