Update contrib.
1 // Copyright (c) 2005-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
22 #include "tsolidcolour.h"
24 const TInt KIterationsToTest = 250;
26 const TRgb KColourSet[] = {KRgbBlack,KRgbGreen,KRgbMagenta,KRgbDarkBlue,KRgbGray,KRgbRed};
27 const TInt KNumColourSet = TInt(sizeof(KColourSet)/sizeof(KColourSet[0]));
29 CTSolidColour::CTSolidColour()
31 SetTestStepName(KTSolidColourName);
35 Override of base class pure virtual
36 Our implementation only gets called if the base class doTestStepPreambleL() did
37 not leave. That being the case, the current test result value will be EPass.
39 @return - TVerdict code
41 TVerdict CTSolidColour::doTestStepL()
43 SetTestStepID(_L("GRAPHICS-UI-BENCH-0026"));
47 return TestStepResult();
52 GRAPHICS-UI-BENCH-0026
55 Tests how long it takes to draw a solid colour
58 Compare the results over time, and before and after changes to bitmap duplication code.
60 @SYMTestExpectedResults
61 Test should pass and display total test time and time per bitmap
63 void CTSolidColour::DrawSolidColourL()
66 TRect blockRect(10, 10, 200, 180);
68 for(TInt dispModeIndex = 0; dispModeIndex < KNumValidDisplayModes; dispModeIndex++)
70 SetScreenModeL(KValidDisplayModes[dispModeIndex]);
71 iGc->OrientationsAvailable(orientation);
72 for (TInt orient = CFbsBitGc::EGraphicsOrientationNormal; orient <= CFbsBitGc::EGraphicsOrientationRotated270; orient++)
74 if (orientation[orient])
76 iGc->SetOrientation((CFbsBitGc::TGraphicsOrientation)orient);
78 for(TInt count=KNumColourSet-1; count>=0; --count)
80 TRgb colour = KColourSet[count];
82 iGc->SetBrushColor(KRgbWhite);
84 iGc->SetBrushColor(colour);
85 iGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
86 iProfiler->InitResults();
87 for(TInt lc=KIterationsToTest; lc>=0; --lc)
89 iGc->DrawRect(blockRect);
90 iProfiler->MarkResultSetL();
92 iProfiler->ResultsAnalysis(_L("Rect-Fill"), orient, count, KValidDisplayModes[dispModeIndex], KIterationsToTest);