os/graphics/graphicstest/uibench/s60/src/te_graphicsperformancesuiteserver_s60.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @test 
    19 */
    20 
    21 #include "te_graphicsperformancesuiteserver_s60.h"
    22 #include "ttextlistscroll.h"
    23 #include "tfullscreentext.h"
    24 #include "tuiandvideo.h"
    25 #include "tcomplexfonts.h"
    26 #include "tfontmultiplesizes.h"
    27 #include "tpan.h"
    28 #include "tscale.h"
    29 #include "tflowwindowstest.h"
    30 #include "trotateteststep.h"
    31 #include "tflowwindowstestopenglvg.h"
    32 #include "tsmallwindowstest.h"
    33 #include "tsmallwindowstestopengl.h"
    34 #include "tsmallwindowstestzoom.h"
    35 #include "tzorder.h"
    36 #include "tzordermultiplesurfaces.h"
    37 #include "tsmallwindowstestopenvg.h"
    38 #include "tsmallwindowstestraster.h"
    39 #include "tcopyrect.h"
    40 
    41 
    42 /**
    43 Same code for Secure and non-secure variants
    44 Called inside the MainL() function to create and start the
    45 CTestServer derived server.
    46 
    47 @return - Instance of the test server
    48 */
    49 CTe_graphicsperformanceSuite_S60* CTe_graphicsperformanceSuite_S60::NewL()
    50 	{
    51 	CTe_graphicsperformanceSuite_S60 * server = new (ELeave) CTe_graphicsperformanceSuite_S60();
    52 	CleanupStack::PushL(server);
    53 
    54 	// Get server name from process so we can use SetCap to change the capabilites and use this server with a different filename
    55 	RProcess handle = RProcess();
    56 	TParsePtrC serverName(handle.FileName());
    57 
    58 	server->ConstructL(serverName.Name());
    59 	CleanupStack::Pop(server);
    60 	return server;
    61 	}
    62 
    63 
    64 /**
    65 MainL - uses the new Rendezvous() call to sync with the client
    66 */
    67 LOCAL_C void MainL()
    68 	{
    69 	// Active scheduler only for this thread. Test need to create own active scheduler	
    70 	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
    71 	CActiveScheduler::Install(scheduler);
    72 
    73 	CTe_graphicsperformanceSuite_S60* server = NULL;
    74 
    75 	// Create the CTestServer derived server
    76 	TRAPD(err,server = CTe_graphicsperformanceSuite_S60::NewL());
    77 	if(!err)
    78 		{
    79 		// Sync with the client and enter the active scheduler
    80 		RProcess::Rendezvous(KErrNone);
    81 		scheduler->Start();
    82 		}
    83 	delete server;
    84 	delete scheduler;
    85 	}
    86 
    87 /**
    88 Secure variant only
    89 Process entry point. Called by client using RProcess API
    90 
    91 @return - Standard Epoc error code on process exit
    92 */
    93 GLDEF_C TInt E32Main()
    94 	{
    95 	__UHEAP_MARK;
    96 	CTrapCleanup* cleanup = CTrapCleanup::New();
    97 	if(cleanup == NULL)
    98 		{
    99 		return KErrNoMemory;
   100 		}
   101 	TRAPD(err,MainL());
   102 	delete cleanup;
   103 	__UHEAP_MARKEND;
   104 	return err;
   105     }
   106 
   107 /**
   108 Secure and non-secure variants
   109 Implementation of CTestServer pure virtual
   110 
   111 @return - A CTestStep derived instance
   112 */
   113 CTestStep* CTe_graphicsperformanceSuite_S60::CreateTestStep(const TDesC& aStepName)
   114 	{
   115 	CTestStep* testStep = NULL;
   116 	if (aStepName == KTTextListScroll)
   117 	    {
   118 		testStep = new CTTextListScroll();
   119 		}
   120 	else if (aStepName == KFullScreenText)
   121 	    {
   122 		testStep = new CTFullScreenText();
   123 		}
   124 	else if(aStepName == KTUiAndVideo)
   125 	    {
   126 		testStep = new CTUiAndVideo();
   127 		}
   128 	else if(aStepName == KTComplexFonts)
   129 		{
   130 		testStep = new CTComplexFonts();
   131 		}
   132 	else if(aStepName == KFontMultipleSizesTestStep)
   133 	    {
   134 		testStep = new CTFontMultipleSizesTestStep();
   135 		}
   136 	else if(aStepName == KTPan)
   137 	    {
   138 		testStep = new CTPan();
   139 		}
   140 	else if(aStepName == KTScale)
   141 	    {
   142 		testStep = new CTScale();
   143 		}
   144 	else if(aStepName == KTFlowWindows)
   145 	    {
   146 		testStep = new CTFlowWindowsTest();
   147 		}
   148 	else if(aStepName == KTRotateTestStep)
   149 	    {
   150 		testStep = new CTRotateTestStep();
   151 		}
   152 	else if(aStepName == KTFlowWindowsOpenGLVG)
   153 	    {
   154 		testStep = new CTFlowWindowsTestOpenGLVG();
   155 		}
   156 	else if(aStepName == KTSmallWindows)
   157 	    {
   158 		testStep = new CTSmallWindowsTest();
   159 		}
   160 	else if(aStepName == KTSmallWindowsOpenGL)
   161 	    {
   162 		testStep = new CTSmallWindowsTestOpenGL();
   163 		}
   164 	else if(aStepName == KTSmallWindowsZoom)
   165 	    {
   166 		testStep = new CTSmallWindowsTestZoom();
   167 		}
   168 	else if(aStepName == KTZOrder)
   169 	    {
   170 		testStep = new CTZOrder();
   171 		}
   172 	else if(aStepName == KTZOrderMultipleSurfaces)
   173 	    {
   174 		testStep = new CTZOrderMultipleSurfaces();
   175 		}
   176 	else if(aStepName == KTSmallWindowsOpenVG)
   177 	    {
   178 		testStep = new CTSmallWindowsTestOpenVG();
   179 		}
   180 	else if(aStepName == KTSmallWindowsRaster)
   181 	    {
   182 		testStep = new CTSmallWindowsTestRaster();
   183 		}
   184 	else if(aStepName == KTCopyRect)
   185 	    {
   186 		testStep = new CTCopyRect();
   187 		}
   188 
   189 	return testStep;
   190 	}