First public contribution.
1 // Copyright (c) 2005-2010 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 "te_graphicsperformanceSuiteServer.h"
23 #include "tbitbltperf.h"
24 #include "tfbsfonthandleperf.h"
25 #include "tfbsbitmaphandleperf.h"
26 #include "talphadrawing.h"
27 #include "tscrollingperf.h"
28 #include "toptimisedbmp.h"
29 #include "tscaleddrawbitmap.h"
30 #include "tsolidcolour.h"
31 #include "talphablend.h"
32 #include "tsimpledrawing.h"
33 #include "tshadowperf.h"
34 #include "tredrawing.h"
35 #include "tnonredrawdrawing.h"
36 #include "tgdifontrenderingperf.h"
37 #include "toutlineshadowdrawing.h"
38 #include "tfadeperf.h"
39 #include "tredrawstoreperf.h"
40 #include "ttranslucent.h"
41 #include "tspriteperf.h"
42 #include "textendedbitmap.h"
43 #include "tfbsglyphdata.h"
46 Same code for Secure and non-secure variants
47 Called inside the MainL() function to create and start the
48 CTestServer derived server.
50 @return - Instance of the test server
52 CTe_graphicsperformanceSuite* CTe_graphicsperformanceSuite::NewL()
54 CTe_graphicsperformanceSuite * server = new (ELeave) CTe_graphicsperformanceSuite();
55 CleanupStack::PushL(server);
57 // Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename
58 RProcess handle = RProcess();
59 TParsePtrC serverName(handle.FileName());
61 server->ConstructL(serverName.Name());
62 CleanupStack::Pop(server);
68 MainL - uses the new Rendezvous() call to sync with the client
72 // Active scheduler only for this thread. Test need to create own active scheduler
73 CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
74 CActiveScheduler::Install(scheduler);
76 CTe_graphicsperformanceSuite* server = NULL;
78 // Create the CTestServer derived server
79 TRAPD(err,server = CTe_graphicsperformanceSuite::NewL());
82 // Sync with the client and enter the active scheduler
83 RProcess::Rendezvous(KErrNone);
93 Process entry point. Called by client using RProcess API
95 @return - Standard Epoc error code on process exit
97 GLDEF_C TInt E32Main()
100 CTrapCleanup* cleanup = CTrapCleanup::New();
112 Secure and non-secure variants
113 Implementation of CTestServer pure virtual
115 @return - A CTestStep derived instance
117 CTestStep* CTe_graphicsperformanceSuite::CreateTestStep(const TDesC& aStepName)
119 CTestStep* testStep = NULL;
120 if(aStepName == KTBitBltPerfName)
121 testStep = new CTBitBltPerf();
122 else if(aStepName == KTFbsFontHandlePerfName)
123 testStep = new CTFbsFontHandlePerf();
124 else if(aStepName == KTFbsBitmapHandlePerfName)
125 testStep = new CTFbsBitmapHandlePerf();
126 else if(aStepName == KTAlphaDrawing)
127 testStep = new CTAlphaDrawing();
128 else if(aStepName == KScrollingPerfName)
129 testStep = new CScrollingPerf();
130 else if(aStepName == KTOptimisedBmpStep)
131 testStep = new CTOptimisedBmp();
132 else if(aStepName == KTScaledDrawBitmap)
133 testStep = new CTScaledDrawBitmap();
134 else if (aStepName == KTSolidColourName)
135 testStep = new CTSolidColour();
136 else if(aStepName == KAlphaBlendTest)
137 testStep = new CAlphaBlendTestNormal();
138 else if(aStepName == KAlphaBlendTestIType)
139 testStep = new CAlphaBlendTestIType();
140 else if (aStepName == KTSimpleDrawingPerfName)
141 testStep = new CTSimpleDrawing();
142 else if (aStepName == KTShadowPerfName)
143 testStep = new CTShadowPerf();
144 else if (aStepName == KTFadePerfName)
145 testStep = new CTFadePerf();
146 else if (aStepName == KRedrawingTest)
147 testStep = new CRedrawingTest();
148 else if (aStepName == KTNonRedrawDrawing)
149 testStep = new CTNonRedrawDrawing();
150 else if (aStepName == KTGDIFontRenderingPerfName)
151 testStep = new CTGDIFontRenderingPerf();
152 else if(aStepName == KTOutlineShadowDrawing)
153 testStep = new CTOutlineShadowDrawing();
154 else if(aStepName == KTRedrawstorePerf)
155 testStep = new CTRedrawstorePerf();
156 else if(aStepName == KTTranslucent)
157 testStep = new CTTranslucent();
158 else if (aStepName == KTSpritePerfName)
159 testStep = new CTSpritePerf();
160 else if(aStepName == KTExtendedBitmap)
161 testStep = new CTExtendedBitmap();
162 else if(aStepName == KTFbsGlyphData)
163 testStep = new CTFbsGlyphData();