X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fdebugscript.h;h=25fee58f9dccab46e540420132c829ed0f209579;hb=54cbdc5600ed4280f1e33f9f1f4780e48713c352;hp=9e85b51d9098758f72ce3e686c150f44c79b0f5c;hpb=180d764223a3568f734434a15d56f18e9ddc012b;p=ipdf%2Fcode.git diff --git a/src/debugscript.h b/src/debugscript.h index 9e85b51..25fee58 100644 --- a/src/debugscript.h +++ b/src/debugscript.h @@ -13,12 +13,9 @@ namespace IPDF class DebugScript { public: - DebugScript() : inp(), currentAction(), m_actions(), m_labels(), m_index(0) {} + DebugScript(std::istream * in) : m_input(in), currentAction(), m_actions(), m_labels(), m_index(0) {} virtual ~DebugScript() {} - void Load(const char *filename) - { - inp.open(filename); - } + bool Execute(View *view, Screen *scr); private: enum ActionType @@ -46,6 +43,9 @@ private: AT_SetBounds, AT_QueryGPUBounds, // query bounds of Beziers when transformed to GPU AT_ScreenShot, // take screenshot + AT_PrintFPS, // Print FPS statistics about the frames + AT_PrintBounds, // Print bounds + AT_ProfileDisplay, AT_Quit }; @@ -62,13 +62,18 @@ private: Action() : type(AT_WaitFrame), x(0), y(0), ix(0), iy(0), z(0), loops(0), textargs("") {} }; - std::ifstream inp; + std::istream * m_input; Action currentAction; std::vector m_actions; std::map m_labels; unsigned m_index; + double m_fps_cpu_mean; + double m_fps_gpu_mean; + double m_fps_cpu_stddev; + double m_fps_gpu_stddev; + struct PerformanceData { clock_t clock;