X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fdebugscript.h;h=8d34bc7c28608d2e5b7e8ebbb1bf0a9968a53a95;hb=b716ae547424e4e4bbda86781a151c31e3a64e67;hp=9895ddc39c09a68743fdeba14440184e249dc51a;hpb=326f04a375ce3120f7e8957e3d7cd5f296f513e3;p=ipdf%2Fcode.git diff --git a/src/debugscript.h b/src/debugscript.h index 9895ddc..8d34bc7 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 @@ -40,33 +37,48 @@ private: AT_ClearPerformance, AT_PrintPerformance, AT_RecordPerformance, + AT_DebugFont, + AT_ApproachBoundsZeno, + AT_ApproachBoundsLinear, + AT_SetBounds, + AT_QueryGPUBounds, // query bounds of Beziers when transformed to GPU + AT_ScreenShot, // take screenshot + AT_PrintSPF, // Print FPS statistics about the frames + AT_PrintBounds, // Print bounds + AT_ProfileDisplay, AT_Quit }; struct Action { ActionType type; - Real x, y; + VReal x, y; int ix, iy; - Real z; + VReal z; int iz; int loops; + VReal w, h; std::string textargs; 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_spf_cpu_mean; + double m_spf_gpu_mean; + double m_spf_cpu_stddev; + double m_spf_gpu_stddev; + struct PerformanceData { clock_t clock; unsigned object_count; - Rect view_bounds; + VRect view_bounds; }; PerformanceData m_perf_start; @@ -75,7 +87,7 @@ private: void PrintPerformance(View * view, Screen * scr); void ClearPerformance(View * view, Screen * scr); - void ParseAction(); + void ParseAction(View * view, Screen * scr); }; }