1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/t_stress/tstresscrp/src/stresscrp.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,69 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +#include <ecom/implementationproxy.h>
1.20 +#include <graphics/wsgraphicdrawer.h>
1.21 +#include <graphics/wsgraphicdrawerinterface.h>
1.22 +#include <graphics/wsgraphicscontext.h>
1.23 +#include "stresscrp.h"
1.24 +
1.25 +NONSHARABLE_CLASS(CStressCRP): public CWsGraphicDrawer
1.26 + {
1.27 +public:
1.28 + static CStressCRP* CreateL();
1.29 + enum
1.30 + {
1.31 + EImplUid = 0xa0005923
1.32 + };
1.33 + void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& aData);
1.34 + void HandleMessage(const TDesC8& aData);
1.35 +private:
1.36 + void DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& aData) const;
1.37 + mutable MWsGraphicDrawerEnvironment* iEnv;
1.38 + };
1.39 +
1.40 +CStressCRP* CStressCRP::CreateL()
1.41 + {
1.42 + return new(ELeave) CStressCRP;
1.43 + }
1.44 +
1.45 +void CStressCRP::ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& /*aData*/)
1.46 + {
1.47 + BaseConstructL(aEnv,aId,aOwner);
1.48 + iEnv = &aEnv;
1.49 + }
1.50 +
1.51 +void CStressCRP::HandleMessage(const TDesC8&/* aData*/)
1.52 + {
1.53 + }
1.54 +
1.55 +void CStressCRP::DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& /*aData*/) const
1.56 + {
1.57 + MWsGraphicsContext* context = static_cast<MWsGraphicsContext*>(aGc.ResolveObjectInterface(KMWsGraphicsContext));
1.58 + if(context) //NGA
1.59 + StressCrpNgaContext::Draw(aGc, aRect);
1.60 + else //NON NGA
1.61 + StressCrpNonNgaContext::Draw(aGc, aRect);
1.62 + }
1.63 +
1.64 +EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) //lint -e714 Suppress 'not referenced'
1.65 + {
1.66 + static const TImplementationProxy KImplementationTable[] =
1.67 + {
1.68 + IMPLEMENTATION_PROXY_ENTRY(CStressCRP::EImplUid,CStressCRP::CreateL) //lint !e611 Suspicious cast
1.69 + };
1.70 + aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
1.71 + return KImplementationTable;
1.72 + }