os/graphics/windowing/windowserver/test/t_stress/tstresscrp/src/stresscrp.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-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 #include <ecom/implementationproxy.h>
    17 #include <graphics/wsgraphicdrawer.h>
    18 #include <graphics/wsgraphicdrawerinterface.h>
    19 #include <graphics/wsgraphicscontext.h>
    20 #include "stresscrp.h"
    21 
    22 NONSHARABLE_CLASS(CStressCRP): public CWsGraphicDrawer
    23 	{
    24 public:
    25 	static CStressCRP* CreateL();
    26 	enum
    27 		{
    28 		EImplUid = 0xa0005923
    29 		};
    30 	void ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& aData);
    31 	void HandleMessage(const TDesC8& aData);
    32 private:
    33 	void DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& aData) const;
    34 	mutable MWsGraphicDrawerEnvironment* iEnv;
    35 	};
    36 
    37 CStressCRP* CStressCRP::CreateL()
    38 	{
    39 	return new(ELeave) CStressCRP;
    40 	}
    41 	
    42 void CStressCRP::ConstructL(MWsGraphicDrawerEnvironment& aEnv,const TGraphicDrawerId& aId,MWsClient& aOwner,const TDesC8& /*aData*/)
    43 	{
    44 	BaseConstructL(aEnv,aId,aOwner);
    45 	iEnv = &aEnv;
    46 	}
    47 	
    48 void CStressCRP::HandleMessage(const TDesC8&/* aData*/)
    49 	{
    50 	}
    51 	
    52 void CStressCRP::DoDraw(MWsGc& aGc,const TRect& aRect,const TDesC8& /*aData*/) const
    53 	{
    54 	MWsGraphicsContext* context = static_cast<MWsGraphicsContext*>(aGc.ResolveObjectInterface(KMWsGraphicsContext));
    55 	if(context) //NGA
    56 		StressCrpNgaContext::Draw(aGc, aRect);
    57 	else //NON NGA
    58 		StressCrpNonNgaContext::Draw(aGc, aRect);
    59 	}	
    60 	
    61 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)  //lint -e714 Suppress 'not referenced' 
    62 	{
    63 	static const TImplementationProxy KImplementationTable[] = 
    64 		{
    65 		IMPLEMENTATION_PROXY_ENTRY(CStressCRP::EImplUid,CStressCRP::CreateL)	//lint !e611 Suspicious cast
    66 		};
    67 	aTableCount = (sizeof(KImplementationTable) / sizeof(TImplementationProxy));
    68 	return KImplementationTable;
    69 	}