os/graphics/graphicstest/uibench/s60/src/tests_flowwindow/tflowwindowstestopenglvg.cpp
Update contrib.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
23 #include "tflowwindowstestopenglvg.h"
24 #include "tflowwindowopengl.h"
25 #include "tflowwindowopenvg.h"
26 #include "tsmallwindowraster.h"
27 #include "tflowwindowscontroller.h"
30 _LIT(KTestStep0002,"GRAPHICS-UI-BENCH-S60-0002");
31 _LIT(KSectNameOpenGLVGTest, "OpenGLVGTest");
32 _LIT(KKeyNamePreload, "Preload");
33 _LIT(KKeyNameFiles, "Files");
34 _LIT(KKeyNameWindowWidth, "WindowWidth");
35 _LIT(KKeyNameWindowHeight, "WindowHeight");
37 CTFlowWindowsTestOpenGLVG::CTFlowWindowsTestOpenGLVG()
39 SetTestStepName(KTFlowWindowsOpenGLVG);
42 CTFlowWindowsTestOpenGLVG::~CTFlowWindowsTestOpenGLVG()
44 delete iFlowWindowsController;
48 TVerdict CTFlowWindowsTestOpenGLVG::doTestStepPreambleL()
50 CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL();
52 iPreload = EFalse; // default behaviour
53 GetBoolFromConfig(KSectNameOpenGLVGTest, KKeyNamePreload, iPreload);
55 TSize windowSize = CTWindow::GetDisplaySizeInPixels();
56 GetIntFromConfig(KSectNameOpenGLVGTest, KKeyNameWindowWidth, windowSize.iWidth);
57 GetIntFromConfig(KSectNameOpenGLVGTest, KKeyNameWindowHeight, windowSize.iHeight);
59 TEST(GetStringFromConfig(KSectNameOpenGLVGTest, KKeyNameFiles, fileNameList));
60 ExtractListL(fileNameList, iFileNames);
61 iIterationsToTest = windowSize.iWidth * iFileNames.Count();
63 RArray<TPoint> initialPositions;
64 RArray<pTWindowCreatorFunction> windowCreatorFunctions;
65 TPoint initialPosition(0, 0);
66 CleanupClosePushL(initialPositions);
67 CleanupClosePushL(windowCreatorFunctions);
68 windowCreatorFunctions.AppendL(CTFlowWindowOpenGL::NewL);
69 initialPositions.AppendL(initialPosition);
71 windowCreatorFunctions.AppendL(CTFlowWindowOpenVG::NewL);
72 initialPosition.iX += windowSize.iWidth;
73 initialPositions.AppendL(initialPosition);
75 windowCreatorFunctions.AppendL(CTSmallWindowRaster::NewL);
76 initialPosition.iX += windowSize.iWidth;
77 initialPositions.AppendL(initialPosition);
79 iFlowWindowsController = CTFlowWindowsController::NewL(ETrue, iFileNames, windowSize, windowCreatorFunctions, initialPositions, EFalse);
80 CleanupStack::PopAndDestroy(2, &initialPositions);
81 return TestStepResult();
85 Override of base class pure virtual
86 Our implementation only gets called if the base class doTestStepPreambleL() did
89 @return - TVerdict code
91 TVerdict CTFlowWindowsTestOpenGLVG::doTestStepL()
93 SetTestStepID(KTestStep0002);
94 TRAPD(err, FlowOpenGLVGWindowsL());
97 SetTestStepResult(EAbort);
99 return TestStepResult();
104 GRAPHICS-UI-BENCH-S60-0002
107 Tests how long it takes to moves windows over the screen.
110 Creates windows which draw bitmaps, OpenVG and OpenGL ES content and moves them over the screen.
112 @SYMTestExpectedResults
113 Test should pass and write the average framerate of the test to a log file.
115 void CTFlowWindowsTestOpenGLVG::FlowOpenGLVGWindowsL()
117 iProfiler->InitResults();
118 iIterationsToTest = 25;
119 for (TInt i = 0; i < iIterationsToTest; ++i)
121 iFlowWindowsController->MoveL();
123 iProfiler->MarkResultSetL();
124 TSize windowSize = CTWindow::GetDisplaySizeInPixels();
125 iProfiler->ResultsAnalysisFrameRate(KTestStep0002, 0, 0, 0, iIterationsToTest, windowSize.iWidth * windowSize.iHeight);