|
|
9ea54a |
#ifndef __SYNFIG_TEST_VISULIZATION_WINDOW_H
|
|
|
9ea54a |
#define __SYNFIG_TEST_VISULIZATION_WINDOW_H
|
|
|
9ea54a |
|
|
|
c4ee38 |
#include <vector></vector>
|
|
|
9ea54a |
|
|
|
9ea54a |
#include <gtkmm window.h=""></gtkmm>
|
|
|
9ea54a |
|
|
|
9ea54a |
#include <synfig canvas.h=""></synfig>
|
|
|
9ea54a |
#include <synfig renddesc.h=""></synfig>
|
|
|
9ea54a |
#include <synfig renderer.h="" rendering=""></synfig>
|
|
|
9ea54a |
#include <synfig rendering="" surface.h=""></synfig>
|
|
|
9ea54a |
|
|
|
9ea54a |
|
|
|
9ea54a |
class VisualizationWindow: public Gtk::Window {
|
|
|
c4ee38 |
public:
|
|
|
c4ee38 |
struct Measure {
|
|
|
c4ee38 |
synfig::String name;
|
|
|
c4ee38 |
long long last;
|
|
|
c4ee38 |
long long sum;
|
|
|
c4ee38 |
explicit Measure(const synfig::String &name = synfig::String()):
|
|
|
c4ee38 |
name(name), last(), sum() { }
|
|
|
c4ee38 |
|
|
|
c4ee38 |
static void print(const synfig::String &name, long long sum, long long rendered_frames);
|
|
|
c4ee38 |
|
|
|
c4ee38 |
void print(long long rendered_frames) const
|
|
|
c4ee38 |
{ print(name, sum, rendered_frames); }
|
|
|
c4ee38 |
};
|
|
|
c4ee38 |
typedef std::vector<measure> MeasureList;</measure>
|
|
|
c4ee38 |
|
|
|
9ea54a |
private:
|
|
|
9ea54a |
synfig::Canvas::Handle canvas;
|
|
|
9ea54a |
synfig::rendering::Renderer::Handle renderer;
|
|
|
9ea54a |
|
|
|
9ea54a |
synfig::RendDesc rend_desc;
|
|
|
9ea54a |
bool transform;
|
|
|
9ea54a |
synfig::Matrix matrix;
|
|
|
9ea54a |
int frame;
|
|
|
9ea54a |
int frames_count;
|
|
|
9ea54a |
synfig::Time frame_duration;
|
|
|
9ea54a |
|
|
|
9ea54a |
synfig::PixelFormat pixel_format;
|
|
|
9ea54a |
Cairo::RefPtr<cairo::imagesurface> cairo_surface;</cairo::imagesurface>
|
|
|
9ea54a |
synfig::rendering::SurfaceResource::Handle surface_resource;
|
|
|
9ea54a |
|
|
|
c4ee38 |
long long last_frame_time;
|
|
|
c4ee38 |
long long last_report_time;
|
|
|
c4ee38 |
long long last_report_id;
|
|
|
c4ee38 |
long long rendered_frames;
|
|
|
c4ee38 |
long long report_seconds;
|
|
|
c4ee38 |
MeasureList measures;
|
|
|
c4ee38 |
|
|
|
c4ee38 |
bool closed;
|
|
|
c4ee38 |
|
|
|
9ea54a |
public:
|
|
|
9ea54a |
VisualizationWindow(
|
|
|
9ea54a |
const synfig::Canvas::Handle &canvas,
|
|
|
9ea54a |
const synfig::rendering::Renderer::Handle &renderer );
|
|
|
9ea54a |
|
|
|
9ea54a |
bool convert(const synfig::rendering::SurfaceResource::Handle &surface);
|
|
|
9ea54a |
|
|
|
9ea54a |
bool on_content_draw(const Cairo::RefPtr<cairo::context> &context);</cairo::context>
|
|
|
9ea54a |
|
|
|
9ea54a |
bool on_idle();
|
|
|
c4ee38 |
|
|
|
c4ee38 |
virtual void on_hide();
|
|
|
9ea54a |
};
|
|
|
9ea54a |
|
|
|
9ea54a |
#endif
|
|
|
9ea54a |
|
|
|
9ea54a |
|