From: kgv Date: Sat, 17 Sep 2016 10:32:13 +0000 (+0300) Subject: 0027879: Draw Harness, ViewerTest - disable VSync within non-interactive mode X-Git-Tag: V7_1_0_beta~123 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=14cb22a1a4202191d33b0b5d0cc405178232d49a;p=occt-copy.git 0027879: Draw Harness, ViewerTest - disable VSync within non-interactive mode --- diff --git a/src/ViewerTest/ViewerTest_ViewerCommands.cxx b/src/ViewerTest/ViewerTest_ViewerCommands.cxx index ff91e617b2..6992046e1f 100644 --- a/src/ViewerTest/ViewerTest_ViewerCommands.cxx +++ b/src/ViewerTest/ViewerTest_ViewerCommands.cxx @@ -558,8 +558,17 @@ TCollection_AsciiString ViewerTest::ViewerInit (const Standard_Integer thePxLeft (void)theDisplayName; // avoid warning on unused argument SetDisplayConnection (new Aspect_DisplayConnection ()); #endif + + if (Draw_VirtualWindows) + { + // don't waste the time waiting for VSync when window is not displayed on the screen + ViewerTest_myDefaultCaps.swapInterval = 0; + // alternatively we can disable buffer swap at all, but this might be inappropriate for testing + //ViewerTest_myDefaultCaps.buffersNoSwap = true; + } aGraphicDriver = new OpenGl_GraphicDriver (GetDisplayConnection()); aGraphicDriver->ChangeOptions() = ViewerTest_myDefaultCaps; + ViewerTest_myDrivers.Bind (aViewNames.GetDriverName(), aGraphicDriver); toCreateViewer = Standard_True; }