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 "tcopyrect.h"
26 const TInt KIterationsToTest = 100;
27 _LIT(KTestStep0017,"GRAPHICS-UI-BENCH-S60-0017");
30 CTCopyRect::CTCopyRect()
32 SetTestStepName(KTCopyRect);
35 CTCopyRect::~CTCopyRect()
41 Override of base class pure virtual
42 Our implementation only gets called if the base class doTestStepPreambleL() did
43 not leave. That being the case, the current test result value will be EPass.
45 @return - TVerdict code
47 TVerdict CTCopyRect::doTestStepL()
49 SetTestStepID(KTestStep0017);
50 TRAPD(err, CopyRectL());
53 SetTestStepResult(EAbort);
55 return TestStepResult();
60 GRAPHICS-UI-BENCH-S60-0017
63 Tests how long it takes to copy a rectangle to a different location with CFbsBitGc.
64 The test runs with the display modes EColor16MAP, EColor16MA, EColor16MU and EColor64K.
67 Copy a rectangular area several times and measure the time it takes.
69 @SYMTestExpectedResults
70 Test should pass and display the average framerate.
72 void CTCopyRect::CopyRectL()
74 for (TInt dispModeIndex = KNumValidDisplayModes - 1; dispModeIndex >= 0; --dispModeIndex)
76 SetScreenModeL(KValidDisplayModes[dispModeIndex]);
77 iSourceRect = TRect(TPoint(0, 1), iScreenDevice->SizeInPixels());
78 iSourceRect.Resize(0, -2);
79 iProfiler->InitResults();
80 for(TInt i = 0; i < KIterationsToTest; ++i)
82 iGc->CopyRect(TPoint(0,1),iSourceRect);
83 iScreenDevice->Update();
85 iProfiler->MarkResultSetL();
86 iProfiler->ResultsAnalysisFrameRate(KTestStep0017, 0, 0, iScreenDevice->BitmapDevice().DisplayMode(),
87 KIterationsToTest, iSourceRect.Size().iWidth * iSourceRect.Size().iHeight);