ardour/libs/canvas/benchmark/render_whole.cc

47 lines
847 B
C++
Raw Normal View History

#include <sys/time.h>
#include <pangomm/init.h>
#include "pbd/xml++.h"
#include "pbd/compose.h"
#include "canvas/canvas.h"
#include "canvas/types.h"
#include "benchmark.h"
using namespace std;
using namespace ArdourCanvas;
class RenderWhole : public Benchmark
{
public:
RenderWhole (string const & session) : Benchmark (session) {}
void do_run (ImageCanvas& canvas)
{
canvas.render_to_image (Rect (0, 0, 4096, 1024));
}
void finish (ImageCanvas& canvas)
{
canvas.write_to_png ("session.png");
}
};
int main (int argc, char* argv[])
{
if (argc < 2) {
cerr << "Syntax: render_whole <session-name> [<number-of-iterations>]\n";
exit (EXIT_FAILURE);
}
Pango::init ();
RenderWhole render_whole (argv[1]);
if (argc > 2) {
render_whole.set_iterations (atoi (argv[2]));
}
2015-10-05 10:17:49 -04:00
cout << render_whole.run () << "\n";
2015-10-05 10:17:49 -04:00
return 0;
}