Lazy + CPU/GPU rendering toggle in script.
authorDavid Gow <[email protected]>
Thu, 25 Sep 2014 02:54:57 +0000 (10:54 +0800)
committerDavid Gow <[email protected]>
Thu, 25 Sep 2014 02:54:57 +0000 (10:54 +0800)
src/debugscript.cpp
src/debugscript.h
src/test.script

index b8746ed..a8bcd78 100644 (file)
@@ -60,6 +60,26 @@ void DebugScript::ParseAction()
                currentAction.type = AT_ZoomPx;
                return;
        }
+       else if (actionType == "gpu")
+       {
+               currentAction.type = AT_SetGPURendering;
+               return;
+       }
+       else if (actionType == "cpu")
+       {
+               currentAction.type = AT_SetCPURendering;
+               return;
+       }
+       else if (actionType == "lazy")
+       {
+               currentAction.type = AT_EnableLazyRendering;
+               return;
+       }
+       else if (actionType == "nolazy")
+       {
+               currentAction.type = AT_DisableLazyRendering;
+               return;
+       }
        else if (actionType == "quit")
        {
                currentAction.type = AT_Quit;
@@ -89,6 +109,18 @@ bool DebugScript::Execute(View *view, Screen *scr)
        case AT_ZoomPx:
                view->ScaleAroundPoint(Real(currentAction.ix)/Real(scr->ViewportWidth()),Real(currentAction.iy)/Real(scr->ViewportHeight()), Real(expf(-currentAction.iz/20.f)));
                break;
+       case AT_SetGPURendering:
+               view->SetGPURendering(true);
+               break;
+       case AT_SetCPURendering:
+               view->SetGPURendering(false);
+               break;
+       case AT_EnableLazyRendering:
+               view->SetLazyRendering(true);
+               break;
+       case AT_DisableLazyRendering:
+               view->SetLazyRendering(false);
+               break;
        default:
                Fatal("Unknown script command in queue.");
        }
index 822819a..9e4dce8 100644 (file)
@@ -26,6 +26,10 @@ private:
                AT_Zoom,
                AT_TranslatePx,
                AT_ZoomPx,
+               AT_SetCPURendering,
+               AT_SetGPURendering,
+               AT_EnableLazyRendering,
+               AT_DisableLazyRendering,
                AT_Quit
        };
 
index fecd5d7..302267a 100644 (file)
@@ -1,6 +1,10 @@
 # Test script for IPDF automation.
-loop 1000 pxzoom 400 300 1
+gpu
+nolazy
+loop 50 pxzoom 400 300 1
 translate 10.0 -3.0
 loop 100 wait
-loop 1000 zoom 0.5 0.5 0.95
+cpu
+lazy
+loop 90 zoom 0.5 0.5 1.05
 quit

UCC git Repository :: git.ucc.asn.au