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.
17 @internalComponent - Internal Symbian test code
21 //This render stage sets up a test thread within window server that waits on
22 //an asynchonous message queue for test commands that are sent from the TEF driver app.
23 //All render stage calls are simply forwarded to the next stage in the chain. The
24 //renderstage is a NULL renderstage.
27 #include "renderstage.h"
28 #include "remotetestbase.h"
32 CRenderStage* CRenderStage::NewL(MWsGraphicDrawerEnvironment* /*aEnv*/, MWsScreen* /*aScreen*/, MWsScreenRedraw* /*aScreenRedraw*/, CWsRenderStage* aNextStage)
34 CRenderStage* stage = new(ELeave) CRenderStage();
35 CleanupStack::PushL(stage);
36 stage->ConstructL(aNextStage);
37 CleanupStack::Pop(stage);
42 CRenderStage::CRenderStage()
47 void CRenderStage::ConstructL(CWsRenderStage* aNextStage)
49 ENDPOINT_ASSERT_DEBUG(aNextStage, User::Invariant());
53 //Stack and heap sizes.
54 static const TInt KStackSize = 0x2000; // 8KB
55 static const TInt KHeapMinSize = 0x1000; // 4KB
56 static const TInt KHeapMaxSize = 0x1000000; // 16MB
58 //Create test environment thread.
59 TUint32 random = Math::Random();
61 _LIT(KThreadNameFormat, "%S-%u");
62 _LIT(KEnvName, "EpTestRemoteEnv");
63 threadName.Format(KThreadNameFormat, &KEnvName, random);
64 User::LeaveIfError(iTestEnvThread.Create(threadName, TestEnvThreadEntryPoint, KStackSize, KHeapMinSize, KHeapMaxSize, this));
65 iTestEnvThread.Resume();
69 CRenderStage::~CRenderStage()
71 iTestEnvThread.Kill(KErrNone);
75 TAny* CRenderStage::ResolveObjectInterface(TUint aTypeId)
77 return Next()->ResolveObjectInterface(aTypeId);
81 void CRenderStage::Begin(const TRegion* aRegion)
83 Next()->Begin(aRegion);
87 void CRenderStage::End(TRequestStatus* aCompositorReady)
89 Next()->End(aCompositorReady);
93 TInt CRenderStage::TestEnvThreadEntryPoint(TAny* /*aSelf*/)
95 RDebug::Printf("CRenderStage: Entering Test Environment Thread...");
97 //Create cleanup stack.
98 CTrapCleanup* cleanup = CTrapCleanup::New();
101 //Create active scheduler.
102 CActiveScheduler* scheduler = new CActiveScheduler();
104 CActiveScheduler::Install(scheduler);
106 //Create a CRemoteTestEnv.
107 CRemoteTestEnv* testEnv = NULL;
108 TRAPD(err, testEnv = CRemoteTestEnv::NewL());
109 __ASSERT_ALWAYS(err == KErrNone, User::Invariant());
110 testEnv->StartReceivingCmds();
115 RDebug::Printf("CRenderStage: Leaving Test Environment Thread...");