os/graphics/windowing/windowserver/test/tauto/TRegion.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TRegion.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,854 @@
     1.4 +// Copyright (c) 1996-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 +// Code for testing CWindowGc::SetCurrentRegion
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +/**
    1.22 + @file
    1.23 + @test
    1.24 + @internalComponent - Internal Symbian test code
    1.25 +*/
    1.26 +
    1.27 +#include "TRegion.H"
    1.28 +
    1.29 +TBool RegionCanFade;
    1.30 +TBool RegionCanFadeSet;
    1.31 +
    1.32 +LOCAL_D TBuf<0x10> text=_L("SOME TEXT");
    1.33 +LOCAL_D TPoint textRefPos(210, 80);
    1.34 +
    1.35 +LOCAL_D TRect regionRectList[]={
    1.36 +					TRect(0,0,0,0),	TRect(30,10,70,40),TRect(60,30,80,70),TRect(10,110,70,170),
    1.37 +					TRect(190,0,240,60),TRect(62,63,67,115),TRect(0,180,240,200),TRect(40,50,210,130),
    1.38 +					TRect(160,130,190,160),TRect(100,140,140,170),TRect(140,170,100,140),TRect(90,120,230,200)};
    1.39 +LOCAL_D TRect clippingRectList[]={
    1.40 +					TRect(0,0,200,400),	TRect(30,10,500,600),TRect(-60,0,80,70),TRect(20,0,170,500),
    1.41 +					TRect(0,0,2000,6000),TRect(-1000,-2000,123,195),TRect(10,10,230,190),TRect(0,0,510,730),
    1.42 +					TRect(110,30,190,150),TRect(1,1,500,11170),TRect(0,0,800,940),TRect(-10,-20,240,210)};
    1.43 +LOCAL_D TPoint originList[]={
    1.44 +					TPoint(0,0),TPoint(10,0),TPoint(0,10),TPoint(-5,-20),
    1.45 +					TPoint(1,1),TPoint(0,0),TPoint(0,0),TPoint(100,0),
    1.46 +					TPoint(0,111),TPoint(90,40),TPoint(0,0),TPoint(-1,0)};
    1.47 +
    1.48 +CTRegion::CTRegion(CTestStep* aStep) : CTWsGraphicsBase(aStep)
    1.49 +	{
    1.50 +	}
    1.51 +
    1.52 +void CTRegion::ConstructL()
    1.53 +	{
    1.54 +	iDrawableSize=TestWin->Size();
    1.55 +//
    1.56 +	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)iFont,TFontSpec(_L("Arial"),200)));
    1.57 +  	User::LeaveIfError(iPicture.Load(TEST_BITMAP_NAME,0));
    1.58 +  
    1.59 +	iBitmap = new (ELeave) CWsBitmap(TheClient->iWs);
    1.60 +	User::LeaveIfError(iBitmap->Create(TSize(iDrawableSize.iWidth+1,iDrawableSize.iHeight),EGray16));
    1.61 +	iBitmap->SetSizeInTwips(TheClient->iScreen);
    1.62 +	iBitmapDevice=CFbsBitmapDevice::NewL(iBitmap);
    1.63 +	User::LeaveIfError(iBitmapDevice->CreateContext(iBitGc));
    1.64 +	User::LeaveIfError(iBitmapDevice->GetNearestFontToDesignHeightInTwips((CFont *&)iBitFont,TFontSpec(_L("Arial"),200)));
    1.65 +	}
    1.66 +
    1.67 +CTRegion::~CTRegion()
    1.68 +	{
    1.69 +	delete iBitGc;
    1.70 +	TheClient->iScreen->ReleaseFont(iFont);
    1.71 +	if (iBitmapDevice)
    1.72 +		iBitmapDevice->ReleaseFont(iBitFont);
    1.73 +	delete iBitmapDevice;
    1.74 +	DeleteChildWindows();
    1.75 +	delete iBitmap;
    1.76 +	}
    1.77 +
    1.78 +void CTRegion::CreateChildWindowsL()
    1.79 +	{
    1.80 +	TSize screenSize=TheClient->iGroup->Size();
    1.81 +	TInt winWidth=(screenSize.iWidth/3)-10;
    1.82 +	TInt winHeight=screenSize.iHeight-10;
    1.83 +	iBaseChildWin=new(ELeave) CBlankWindow();
    1.84 +	iBaseChildWin->SetUpL(BaseWin->Win()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
    1.85 +	iBaseChildWin->Win()->SetShadowHeight(2);
    1.86 +	iTestChildWin=new(ELeave) CBlankWindow();
    1.87 +	iTestChildWin->SetUpL(TestWin->Win()->InquireOffset(*TheClient->iGroup->GroupWin())+TPoint(winWidth>>2,winHeight>>2),TSize(winWidth>>2,winHeight>>1),TheClient->iGroup,*TheClient->iGc);
    1.88 +	}
    1.89 +
    1.90 +void CTRegion::DeleteChildWindows()
    1.91 +	{
    1.92 +	delete iBaseChildWin;
    1.93 +	iBaseChildWin=NULL;
    1.94 +	delete iTestChildWin;
    1.95 +	iTestChildWin=NULL;
    1.96 +	}
    1.97 +
    1.98 +void CTRegion::DrawNonClippedSample1(CBitmapContext &aGc)
    1.99 +	{
   1.100 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.101 +	aGc.SetBrushColor(TRgb::Gray4(2));
   1.102 +	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
   1.103 +	aGc.DrawRect(TRect(TPoint(30,100), TPoint(120,200)));
   1.104 +	TheClient->iWs.Flush();
   1.105 +	}
   1.106 +
   1.107 +void CTRegion::DrawClippedSample1(CBitmapContext &aGc)
   1.108 +	{
   1.109 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.110 +	aGc.SetBrushColor(TRgb::Gray4(1));
   1.111 +	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
   1.112 +	aGc.DrawRect(TRect(TSize(100,200)));
   1.113 +
   1.114 +//	aGc.BitBlt(TPoint(55,65), iPicture);
   1.115 +
   1.116 +	aGc.SetPenStyle(CGraphicsContext::ENullPen);
   1.117 +	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
   1.118 +	aGc.SetBrushColor(TRgb::Gray4(2));
   1.119 +	aGc.DrawEllipse(TRect(TPoint(20,35), TPoint(90,79)));
   1.120 +
   1.121 +	aGc.SetBrushColor(TRgb::Gray4(0));
   1.122 +	aGc.DrawEllipse(TRect(TPoint(110,110), TPoint(175,200)));
   1.123 +
   1.124 +	aGc.SetBrushColor(TRgb::Gray4(1));
   1.125 +	aGc.DrawEllipse(TRect(TPoint(170,30), TPoint(220,150)));
   1.126 +
   1.127 +	aGc.SetBrushColor(TRgb::Gray4(3));
   1.128 +	aGc.DrawEllipse(TRect(TPoint(0,150), TPoint(240,190)));
   1.129 +
   1.130 +	aGc.SetPenStyle(CGraphicsContext::ESolidPen);
   1.131 +	aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
   1.132 +
   1.133 +	TheClient->iWs.Flush();
   1.134 +	}
   1.135 +
   1.136 +void CTRegion::DrawNonClippedSample2(CBitmapContext &aGc, CFont *aFont)
   1.137 +	{
   1.138 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.139 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.140 +	aGc.UseFont(aFont);
   1.141 +	TPoint textPos=textRefPos-TPoint(iFont->TextWidthInPixels(text)*3/4, 0);
   1.142 +	aGc.DrawText(text, textPos);
   1.143 +	aGc.DiscardFont();
   1.144 +
   1.145 +	TheClient->iWs.Flush();
   1.146 +	}
   1.147 +
   1.148 +void CTRegion::DrawClippedSample2(CBitmapContext &aGc, CFont *aFont)
   1.149 +	{
   1.150 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.151 +	aGc.SetPenColor(TRgb::Gray4(2));
   1.152 +	aGc.UseFont(aFont);
   1.153 +	TPoint textPos=textRefPos-TPoint(iFont->TextWidthInPixels(text)*3/4, -20);
   1.154 +	aGc.DrawText(text, textPos);
   1.155 +	aGc.DiscardFont();
   1.156 +	aGc.SetBrushColor(TRgb::Gray4(3));
   1.157 +	aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
   1.158 +	aGc.DrawRect(TRect(TPoint(10,100), TPoint(210,120)));
   1.159 +	TheClient->iWs.Flush();
   1.160 +	}
   1.161 +
   1.162 +void CTRegion::DrawClippedSample3(CBitmapContext &aGc)
   1.163 +	{
   1.164 +	aGc.SetPenColor(TRgb::Gray4(0));
   1.165 +	aGc.SetPenColor(TRgb::Gray4(2));
   1.166 +	aGc.DrawRect(TRect(TPoint(10,200), TPoint(20,210)));
   1.167 +	}
   1.168 +
   1.169 +void CTRegion::DrawNonClippedSample1(CTWin *aWindow, const TPoint &aOrigin)
   1.170 +	{
   1.171 +	TheGc->Activate(*aWindow->Win());
   1.172 +	TheGc->SetOrigin(aOrigin);
   1.173 +	DrawNonClippedSample1(*TheGc);
   1.174 +	TheGc->Deactivate();
   1.175 +	}
   1.176 +
   1.177 +void CTRegion::DrawNonClippedSample1(CTWin *aWindow, const TRegion &aRegion, const TPoint &aOrigin)
   1.178 +	{
   1.179 +	TheGc->Activate(*aWindow->Win());
   1.180 +	TheGc->SetOrigin(aOrigin);
   1.181 +	TheGc->SetClippingRegion(aRegion);
   1.182 +	DrawNonClippedSample1(*TheGc);
   1.183 +	TheGc->Deactivate();
   1.184 +	}
   1.185 +
   1.186 +void CTRegion::DrawClippedSample1(TestWindow *aWindow, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin)
   1.187 +	{
   1.188 +	TheGc->Activate(*aWindow->Win());
   1.189 +	TheGc->SetOrigin(aOrigin);
   1.190 +	TheGc->SetClippingRegion(aRegion);
   1.191 +	TheGc->SetClippingRect(aClippingRect);
   1.192 +	DrawClippedSample1(*TheGc);
   1.193 +	TheGc->Deactivate();
   1.194 +	}
   1.195 +
   1.196 +void CTRegion::DrawNonClippedSample2(CTWin *aWindow, const TPoint &aOrigin)
   1.197 +	{
   1.198 +	TheGc->Activate(*aWindow->Win());
   1.199 +	TheGc->SetOrigin(aOrigin);
   1.200 +	DrawNonClippedSample2(*TheGc,iFont);
   1.201 +	TheGc->Deactivate();
   1.202 +	}
   1.203 +
   1.204 +void CTRegion::DrawNonClippedSample2(CTWin *aWindow, const TRegion &aRegion, const TPoint &aOrigin)
   1.205 +	{
   1.206 +	TheGc->Activate(*aWindow->Win());
   1.207 +	TheGc->SetOrigin(aOrigin);
   1.208 +	TheGc->SetClippingRegion(aRegion);
   1.209 +	DrawNonClippedSample2(*TheGc,iFont);
   1.210 +	TheGc->Deactivate();
   1.211 +	}
   1.212 +
   1.213 +void CTRegion::DrawClippedSample2(TestWindow *aWindow, const TRegion &aRegion, const TRect &aClippingRect, const TPoint &aOrigin)
   1.214 +	{
   1.215 +	TheGc->Activate(*aWindow->Win());
   1.216 +	TheGc->SetClippingRegion(TRegionFix<1>());
   1.217 +	DrawClippedSample3(*TheGc);	// needed to trigger region update in wserv
   1.218 +	TheGc->SetOrigin(aOrigin);
   1.219 +	TheGc->SetClippingRect(aClippingRect);
   1.220 +	TheGc->SetClippingRegion(aRegion);
   1.221 +	DrawClippedSample2(*TheGc,iFont);
   1.222 +	TheGc->CancelClippingRegion();
   1.223 +	TheGc->Deactivate();
   1.224 +	}
   1.225 +
   1.226 +void CTRegion::ClearBitmapAndWindows()
   1.227 +	{
   1.228 +	TestWin->Win()->Invalidate();
   1.229 +	TestWin->Win()->BeginRedraw();
   1.230 +	TheGc->Activate(*TestWin->Win());
   1.231 +	TheGc->SetBrushColor(TRgb::Gray4(3));
   1.232 +	TheGc->Clear();
   1.233 +	TheGc->Deactivate();
   1.234 +	TestWin->Win()->EndRedraw();
   1.235 +//
   1.236 +	BaseWin->Win()->Invalidate();
   1.237 +	BaseWin->Win()->BeginRedraw();
   1.238 +	TheGc->Activate(*BaseWin->Win());
   1.239 +	TheGc->SetBrushColor(TRgb::Gray4(3));
   1.240 +	TheGc->Clear();
   1.241 +	TheGc->Deactivate();
   1.242 +	BaseWin->Win()->EndRedraw();
   1.243 +//
   1.244 +	iBitGc->SetBrushColor(TRgb::Gray4(3));
   1.245 +	iBitGc->Clear();
   1.246 +	TheClient->iWs.Flush();
   1.247 +	}
   1.248 +
   1.249 +void CTRegion::TestRegionL(const TRegion &aClippingRegion, const TRect &aClippingRect, const TPoint &aOrigin)
   1.250 +	{
   1.251 +	if (aClippingRegion.CheckError())
   1.252 +		User::Leave(KErrGeneral);
   1.253 +	ClearBitmapAndWindows();
   1.254 +
   1.255 +	// draw to iWindow1 (clipping intermittently) and iBitmap (not clipping)
   1.256 +	DrawNonClippedSample1(TestWin,aOrigin);
   1.257 +	DrawNonClippedSample1(*iBitGc);
   1.258 +
   1.259 +	DrawNonClippedSample2(TestWin,aOrigin);
   1.260 +	DrawNonClippedSample2(*iBitGc, iBitFont);
   1.261 +
   1.262 +	DrawClippedSample1(TestWin,aClippingRegion,aClippingRect,aOrigin);
   1.263 +	DrawClippedSample1(*iBitGc);
   1.264 +
   1.265 +	DrawClippedSample2(TestWin,aClippingRegion,aClippingRect,aOrigin);
   1.266 +	DrawClippedSample2(*iBitGc, iBitFont);
   1.267 +
   1.268 +	// copy each rectangle of the clipping region from iBitmap to iWindow2
   1.269 +	TheGc->Activate(*BaseWin->Win());
   1.270 +	for (TUint i=0; i<(TUint)aClippingRegion.Count(); i++)
   1.271 +		{
   1.272 +		TRect rect=aClippingRegion.RectangleList()[i];
   1.273 +		rect.Intersection(aClippingRect);
   1.274 +		TheGc->SetOrigin(aOrigin);
   1.275 +		TheGc->BitBlt(rect.iTl, iBitmap, rect);
   1.276 +		TheClient->Flush();
   1.277 +		}
   1.278 +	TheGc->Deactivate();
   1.279 +
   1.280 +	// draw the non-clipped samples to everywhere in iWindow2 *except* the clipping region
   1.281 +	RRegion inverseClippingRegion(TRect(-aOrigin,iDrawableSize));
   1.282 +	RRegion clip;
   1.283 +	clip.Copy(aClippingRegion);
   1.284 +	clip.ClipRect(aClippingRect);
   1.285 +	inverseClippingRegion.SubRegion(clip);
   1.286 +	clip.Close();
   1.287 +	DrawNonClippedSample1(BaseWin,inverseClippingRegion,aOrigin);
   1.288 +	DrawNonClippedSample2(BaseWin,inverseClippingRegion,aOrigin);
   1.289 +	inverseClippingRegion.Close();
   1.290 +	CompareWindows(_L("CTRegion::TestRegionL"));
   1.291 +	}
   1.292 +
   1.293 +void CTRegion::CompareRectsL(TPoint aTl1,TPoint aTl2,TSize aSize)
   1.294 +	{
   1.295 +	_LIT(KError,"Pixels Differ: (%d,%d),(%d,%d)");
   1.296 +	CFbsScreenDevice* device;
   1.297 +	device=CFbsScreenDevice::NewL(KNullDesC,iBaseChildWin->BaseWin()->DisplayMode());
   1.298 +	TPoint br=aTl1+aSize;
   1.299 +	TInt startX1=aTl1.iX;
   1.300 +	TInt startX2=aTl2.iX;
   1.301 +	TSize pixelSize(1,1);
   1.302 +	TPoint zero;
   1.303 +	while(aTl1.iY<br.iY+1)
   1.304 +		{
   1.305 +		while (aTl1.iX<br.iX+1)
   1.306 +			{
   1.307 +			if (!device->RectCompare(TRect(aTl1,pixelSize),*device,TRect(aTl2,pixelSize)))
   1.308 +				{
   1.309 +				RDebug::Print(KError,aTl1.iX,aTl1.iY,aTl2.iX,aTl2.iY);
   1.310 +				iTest->LogColors(*device,zero,aTl1,aTl1);
   1.311 +				iTest->LogColors(*device,zero,aTl2,aTl2);
   1.312 +				}
   1.313 +			++aTl1.iX;
   1.314 +			++aTl2.iX;
   1.315 +			}
   1.316 +		aTl1.iX=startX1;
   1.317 +		aTl2.iX=startX2;
   1.318 +		++aTl1.iY;
   1.319 +		++aTl2.iY;
   1.320 +		}
   1.321 +	}
   1.322 +
   1.323 +void CTRegion::ScrollBugL()
   1.324 +	{
   1.325 +	CBlankWindow* testWin;
   1.326 +	RBlankWindow win(TheClient->iWs);
   1.327 +	CleanupClosePushL(win);
   1.328 +	TSize screenSize=TheClient->iGroup->Size();
   1.329 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.330 +	CleanupStack::PushL(testWin);
   1.331 +	//testWin->ConstructL(*TheClient->iGroup);
   1.332 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
   1.333 +	//testWin->Win()->SetBackgroundColor(TRgb::Gray2(1));
   1.334 +	testWin->Win()->EnableRedrawStore(EFalse);
   1.335 +	testWin->SetColor(TRgb::Gray4(1));
   1.336 +	testWin->RealDraw(ETrue);
   1.337 +	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
   1.338 +	win.SetColor(TRgb::Gray4(2));
   1.339 +	win.SetExtent(TPoint(screenSize.iWidth/3+30,20),TSize(screenSize.iWidth/3-62,25));
   1.340 +	win.Activate();
   1.341 +	TheClient->iWs.Flush();
   1.342 +	TheClient->WaitForRedrawsToFinish();
   1.343 +	win.SetVisible(EFalse);
   1.344 +	TheClient->iWs.Flush();
   1.345 +	testWin->Win()->BeginRedraw();
   1.346 +	testWin->DrawNow();
   1.347 +	testWin->SetColor(TRgb::Gray4(2));
   1.348 +	testWin->Win()->Scroll(TPoint(0,-50));
   1.349 +	testWin->DrawNow();
   1.350 +	testWin->Win()->EndRedraw();
   1.351 +	TheClient->iWs.Flush();
   1.352 +	TBool retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2-30))
   1.353 +							,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2-30),TSize(screenSize.iWidth/3,screenSize.iHeight/2-30)));
   1.354 +	TEST(retVal);
   1.355 +	if (!retVal)
   1.356 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.357 +															
   1.358 +	retVal = !TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight-60),TSize(10,10))
   1.359 +							,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight-50),TSize(10,10)));
   1.360 +	TEST(retVal);
   1.361 +	if (!retVal)
   1.362 +		INFO_PRINTF3(_L("!TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.363 +
   1.364 +	TheClient->WaitForRedrawsToFinish();
   1.365 +	win.SetVisible(ETrue);
   1.366 +	win.SetVisible(EFalse);
   1.367 +	testWin->Win()->BeginRedraw();
   1.368 +	testWin->Win()->Scroll(TPoint(0,-50));
   1.369 +	testWin->SetColor(TRgb::Gray4(1));
   1.370 +	testWin->DrawNow();
   1.371 +	testWin->Win()->EndRedraw();
   1.372 +	TheClient->iWs.Flush();	
   1.373 +	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3+35,0),TSize(screenSize.iWidth/6-35,100))
   1.374 +							,TRect(TPoint(screenSize.iWidth/2,0),TSize(screenSize.iWidth/6-35,100)));
   1.375 +	TEST(retVal);
   1.376 +	if (!retVal)
   1.377 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.378 +																			
   1.379 +	retVal = !TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3+30,20),TSize(10,10))
   1.380 +							,TRect(TPoint(screenSize.iWidth/3+30,50),TSize(10,10)));
   1.381 +	TEST(retVal);
   1.382 +	if (!retVal)
   1.383 +		INFO_PRINTF3(_L("!TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.384 +
   1.385 +	TheClient->WaitForRedrawsToFinish();
   1.386 +	testWin->Win()->BeginRedraw();
   1.387 +	testWin->DrawNow();
   1.388 +	testWin->Win()->EndRedraw();
   1.389 +	CleanupStack::PopAndDestroy(2,&win);
   1.390 +	}
   1.391 +
   1.392 +void CTRegion::ExposeTestL()
   1.393 +	{
   1.394 +	CBlankWindow* testWin;
   1.395 +	TSize screenSize=TheClient->iGroup->Size();
   1.396 +	TRect topHalf(0,0,screenSize.iWidth/3,screenSize.iHeight/2);
   1.397 +	TRect leftHalf(0,0,screenSize.iWidth/6,screenSize.iHeight);
   1.398 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.399 +	CleanupStack::PushL(testWin);
   1.400 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
   1.401 +	testWin->Win()->EnableRedrawStore(EFalse);
   1.402 +	testWin->SetColor(TRgb::Gray4(2));
   1.403 +	testWin->RealDraw(ETrue);
   1.404 +	TheClient->iWs.Flush();
   1.405 +	TheClient->WaitForRedrawsToFinish();
   1.406 +	testWin->Win()->BeginRedraw();
   1.407 +	testWin->DrawNow();
   1.408 +	testWin->Win()->Invalidate(topHalf);
   1.409 +	testWin->SetColor(TRgb::Gray4(1));
   1.410 +	testWin->DrawNow();
   1.411 +	testWin->Win()->EndRedraw();
   1.412 +	TheClient->iWs.Flush();
   1.413 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() A"));
   1.414 +
   1.415 +	TheClient->WaitForRedrawsToFinish();
   1.416 +	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() B"));
   1.417 +
   1.418 +	testWin->Win()->Invalidate(topHalf);
   1.419 +	testWin->SetColor(TRgb::Gray4(2));
   1.420 +	testWin->Win()->BeginRedraw();
   1.421 +	testWin->Win()->Invalidate(leftHalf);
   1.422 +	testWin->DrawNow();
   1.423 +	testWin->Win()->EndRedraw();
   1.424 +	TheClient->iWs.Flush();
   1.425 +	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/6-10,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() C"));
   1.426 +	CheckRectNoMatch(TPoint(screenSize.iWidth/2,0),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() D"));
   1.427 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/2,0),TSize(10,10),_L("CTRegion::ExposeTestL() E"));
   1.428 +	CheckRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(((screenSize.iWidth/6-5)/4*4),screenSize.iHeight/2),_L("CTRegion::ExposeTestL() F"));
   1.429 +	testWin->Win()->BeginRedraw();
   1.430 +	testWin->DrawNow();
   1.431 +	testWin->Win()->EndRedraw();
   1.432 +	TheClient->iWs.Flush();
   1.433 +	
   1.434 +	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/6-10,screenSize.iHeight/2),_L("CTRegion::ExposeTestL() G"));
   1.435 +	CheckRectNoMatch(TPoint(screenSize.iWidth/2,0),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() H"));
   1.436 +	CheckRect(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/2,0),TSize(((screenSize.iWidth/6-5)/4*4),screenSize.iHeight/2),_L("CTRegion::ExposeTestL() I"));
   1.437 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TPoint(screenSize.iWidth/2,screenSize.iHeight/2),TSize(10,10),_L("CTRegion::ExposeTestL() J"));
   1.438 +
   1.439 +	CleanupStack::PopAndDestroy(testWin);
   1.440 +	}
   1.441 +
   1.442 +#if defined(__MARM_ARM4__)
   1.443 +	#define FADING ETrue
   1.444 +#elif defined(__MARM__)
   1.445 +	#define FADING EFalse
   1.446 +#else
   1.447 +	#define FADING ETrue
   1.448 +#endif
   1.449 +void CTRegion::ExposeTest2L()
   1.450 +	{
   1.451 +	TBool canFade=FADING;
   1.452 +#if defined(__MARM_THUMB__)
   1.453 +	if (!RegionCanFadeSet)
   1.454 +		return;
   1.455 +	canFade=RegionCanFade;
   1.456 +#endif
   1.457 +	INFO_PRINTF1(_L("AUTO REGN ExpostTest2 "));
   1.458 +	CBlankWindow* testWin;
   1.459 +	RBlankWindow win(TheClient->iWs);
   1.460 +	CleanupClosePushL(win);
   1.461 +	TSize screenSize=TheClient->iGroup->Size();
   1.462 +	TRect topHalf(0,0,screenSize.iWidth/3,screenSize.iHeight/2);
   1.463 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.464 +	CleanupStack::PushL(testWin);
   1.465 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
   1.466 +	testWin->Win()->EnableRedrawStore(EFalse);
   1.467 +	testWin->Win()->SetRequiredDisplayMode(EGray16);
   1.468 +	testWin->SetColor(TRgb::Gray16(12));
   1.469 +	testWin->RealDraw(ETrue);
   1.470 +	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
   1.471 +	win.SetColor(TRgb::Gray4(2));
   1.472 +	win.SetExtent(TPoint(0,-screenSize.iHeight),TSize(screenSize.iWidth/3-2,2*screenSize.iHeight));
   1.473 +	win.SetShadowHeight(screenSize.iWidth/9);
   1.474 +	win.Activate();
   1.475 +	TheClient->iWs.Flush();
   1.476 +	TheClient->WaitForRedrawsToFinish();
   1.477 +	INFO_PRINTF1(_L(" Constructed Windows"));
   1.478 +	testWin->DrawNow();
   1.479 +	testWin->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
   1.480 +	testWin->DrawNow(topHalf);
   1.481 +	TheClient->iWs.Flush();
   1.482 +	INFO_PRINTF1(_L(" Drawn TopHalf Faded"));
   1.483 +	TBool retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
   1.484 +						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
   1.485 +	TEST(retVal);
   1.486 +	if (!retVal)
   1.487 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.488 +
   1.489 +	testWin->DrawNow(topHalf);
   1.490 +	TheClient->iWs.Flush();
   1.491 +	canFade!=TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(10,10))
   1.492 +															,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10)));
   1.493 +	TEST(canFade);
   1.494 +	if (!canFade)
   1.495 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, canFade);		
   1.496 +
   1.497 +	testWin->DrawNow();
   1.498 +	TheClient->iWs.Flush();
   1.499 +	INFO_PRINTF1(_L(" All Faded (Flush)"));
   1.500 +	
   1.501 +	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
   1.502 +						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
   1.503 +	TEST(retVal);
   1.504 +	if (!retVal)
   1.505 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.506 +
   1.507 +	testWin->Win()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
   1.508 +	TheClient->iWs.Flush();
   1.509 +	TheClient->WaitForRedrawsToFinish();
   1.510 +	INFO_PRINTF1(_L(" Redrawn Screen Unfaded"));
   1.511 +	testWin->Win()->Invalidate(topHalf);
   1.512 +	testWin->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
   1.513 +	testWin->DrawNow();
   1.514 +	TheClient->iWs.Flush();
   1.515 +	INFO_PRINTF1(_L(" Re Drawn Top Half Faded Again"));
   1.516 +	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
   1.517 +						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
   1.518 +	TEST(retVal);
   1.519 +	if (!retVal)
   1.520 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.521 +
   1.522 +	testWin->DrawNow();
   1.523 +	TheClient->iWs.Flush();
   1.524 +	INFO_PRINTF1(_L(" Re Drawn Top Half Faded Yet Again"));
   1.525 +	canFade!=TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(10,10))
   1.526 +															,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(10,10)));
   1.527 +	TEST(canFade);
   1.528 +	if (!canFade)
   1.529 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, canFade);		
   1.530 +
   1.531 +	testWin->DrawNow();
   1.532 +	TheClient->iWs.Flush();
   1.533 +	INFO_PRINTF1(_L(" All Faded Again"));
   1.534 +	retVal = TheClient->iScreen->RectCompare(TRect(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight/2))
   1.535 +						,TRect(TPoint(screenSize.iWidth/3,screenSize.iHeight/2),TSize(screenSize.iWidth/3,screenSize.iHeight/2)));
   1.536 +	TEST(retVal);
   1.537 +	if (!retVal)
   1.538 +		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare() return value  - Expected: %d, Actual: %d"), ETrue, retVal);		
   1.539 +
   1.540 +	CleanupStack::PopAndDestroy(2,&win);
   1.541 +	INFO_PRINTF1(_L(" Killed Windows"));
   1.542 +	}
   1.543 +
   1.544 +void CTRegion::CoverTestL()
   1.545 +	{
   1.546 +	CBlankWindow* testWin;
   1.547 +	RBlankWindow win(TheClient->iWs);
   1.548 +	CleanupClosePushL(win);
   1.549 +	TSize screenSize=TheClient->iGroup->Size();
   1.550 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.551 +	CleanupStack::PushL(testWin);
   1.552 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
   1.553 +	testWin->SetColor(TRgb::Gray4(1));
   1.554 +	testWin->RealDraw(ETrue);
   1.555 +	win.Construct(*TheClient->iGroup->WinTreeNode(),3456);
   1.556 +	win.SetColor(TRgb::Gray4(0));
   1.557 +	win.SetExtent(TPoint(screenSize.iWidth/3+30,20),TSize(screenSize.iWidth/3-62,25));
   1.558 +	win.SetVisible(EFalse);
   1.559 +	win.Activate();
   1.560 +	TheClient->iWs.Flush();
   1.561 +	TheClient->WaitForRedrawsToFinish();
   1.562 +	testWin->DrawNow();
   1.563 +	testWin->SetColor(TRgb::Gray4(2));
   1.564 +	win.SetVisible(ETrue);
   1.565 +	testWin->DrawNow();
   1.566 +	TheClient->iWs.Flush();
   1.567 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() A"));
   1.568 +
   1.569 +	TheClient->WaitForRedrawsToFinish();
   1.570 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() B"));
   1.571 +
   1.572 +	win.SetVisible(EFalse);
   1.573 +	TheClient->iWs.Flush();
   1.574 +	TheClient->WaitForRedrawsToFinish();
   1.575 +	testWin->SetColor(TRgb::Gray4(1));
   1.576 +	testWin->Win()->Invalidate();
   1.577 +	win.SetVisible(ETrue);
   1.578 +	testWin->DrawNow();
   1.579 +	TheClient->iWs.Flush();
   1.580 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3,0),TPoint(screenSize.iWidth/3+30,20),TSize(10,10),_L("TRegion::CoverTestL() C"));
   1.581 +
   1.582 +	CleanupStack::PopAndDestroy(2,&win);
   1.583 +	}
   1.584 +
   1.585 +void CTRegion::OffsetTestL()
   1.586 +	{
   1.587 +	CBlankWindow* testWin;
   1.588 +	RBlankWindow win(TheClient->iWs);
   1.589 +	CleanupClosePushL(win);
   1.590 +	TSize screenSize=TheClient->iGroup->Size();
   1.591 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.592 +	CleanupStack::PushL(testWin);
   1.593 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight-40),TheClient->iGroup,*TheGc);
   1.594 +	testWin->Win()->EnableRedrawStore(EFalse);
   1.595 +	testWin->SetColor(TRgb::Gray4(1));
   1.596 +	testWin->RealDraw(ETrue);
   1.597 +	win.Construct(*testWin->WinTreeNode(),3456);
   1.598 +	win.SetColor(TRgb::Gray4(2));
   1.599 +	win.SetExtent(TPoint(30,20),TSize(screenSize.iWidth/3-62,25));
   1.600 +	win.Activate();
   1.601 +	TheClient->iWs.Flush();
   1.602 +	TheClient->WaitForRedrawsToFinish();
   1.603 +	win.SetVisible(EFalse);
   1.604 +	TheClient->iWs.Flush();
   1.605 +	testWin->DrawNow();
   1.606 +	testWin->SetColor(TRgb::Gray4(2));
   1.607 +	testWin->Win()->SetPosition(TPoint(screenSize.iWidth/3+30,35));
   1.608 +	testWin->DrawNow();
   1.609 +	TheClient->iWs.Flush();
   1.610 +	/* Andy - this is verifying that the complete redraw of the window in the second DrawNow only affects part
   1.611 +	of the window.  I don't understand it atall.
   1.612 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+70,85),TSize(10,10),_L("CTRegion::OffsetTestL() A"));
   1.613 +	*/
   1.614 +	TheClient->WaitForRedrawsToFinish();
   1.615 +	CheckRect(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+70,85),TSize(screenSize.iWidth/3-62,25),_L("CTRegion::OffsetTestL() A"));
   1.616 +
   1.617 +	win.SetVisible(ETrue);
   1.618 +	win.SetVisible(EFalse);
   1.619 +	testWin->Win()->SetPosition(TPoint(screenSize.iWidth/3+5,5));
   1.620 +	testWin->SetColor(TRgb::Gray4(1));
   1.621 +	testWin->DrawNow();
   1.622 +	TheClient->iWs.Flush();
   1.623 +	CheckRect(TPoint(screenSize.iWidth/3+60,55),TPoint(screenSize.iWidth/3+55,90),TSize(screenSize.iWidth/3-62,25),_L("CTRegion::OffsetTestL() B"));
   1.624 +	/* Andy - this is verifying that the complete redraw of the window during DrawNow only affects part
   1.625 +	of the window.  I don't understand it atall.
   1.626 +	CheckRectNoMatch(TPoint(screenSize.iWidth/3+30,20),TPoint(screenSize.iWidth/3+50,90),TSize(10,10),_L("CTRegion::OffsetTestL() B"));
   1.627 +	*/
   1.628 +	CleanupStack::PopAndDestroy(2,&win);
   1.629 +	}
   1.630 +
   1.631 +void CTRegion::ClipTestL()
   1.632 +	{
   1.633 +	CBlankWindow* testWin;
   1.634 +	RBlankWindow win(TheClient->iWs);
   1.635 +	CleanupClosePushL(win);
   1.636 +	TSize screenSize=TheClient->iGroup->Size();
   1.637 +	testWin=new(ELeave) CBlankWindow(TRgb::Gray4(0));
   1.638 +	CleanupStack::PushL(testWin);
   1.639 +	testWin->SetUpL(TPoint(screenSize.iWidth/3,0),TSize(screenSize.iWidth/3,screenSize.iHeight),TheClient->iGroup,*TheGc);
   1.640 +	testWin->Win()->EnableRedrawStore(EFalse);
   1.641 +	testWin->SetColor(TRgb::Gray4(1));
   1.642 +	testWin->RealDraw(ETrue);
   1.643 +	win.Construct(*testWin->WinTreeNode(),3456);
   1.644 +	win.SetColor(TRgb::Gray4(2));
   1.645 +	win.SetExtent(TPoint(30,20),TSize(screenSize.iWidth/3-62,25));
   1.646 +	win.Activate();
   1.647 +	TheClient->iWs.Flush();
   1.648 +	TheClient->WaitForRedrawsToFinish();
   1.649 +	win.SetVisible(EFalse);
   1.650 +	TheClient->iWs.Flush();
   1.651 +	testWin->DrawNow();
   1.652 +	testWin->SetColor(TRgb::Gray4(2));
   1.653 +	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/6,screenSize.iHeight-2)));
   1.654 +	RRegion invalid;
   1.655 +	testWin->Win()->GetInvalidRegion(invalid);
   1.656 +	testWin->DrawNow();
   1.657 +	TheClient->iWs.Flush();
   1.658 +	TBool retVal = !invalid.CheckError();
   1.659 +	TEST(retVal);
   1.660 +	if (!retVal)
   1.661 +		INFO_PRINTF3(_L("!invalid.CheckError() return value  - Expected: %d, Actual: %d"), ETrue, retVal);			
   1.662 +	
   1.663 +	TEST(invalid.BoundingRect().iBr.iX<=screenSize.iWidth/6);
   1.664 +	if (invalid.BoundingRect().iBr.iX>screenSize.iWidth/6)
   1.665 +		INFO_PRINTF3(_L("invalid.BoundingRect().iBr.iX<=screenSize.iWidth/6  - Expected: %d, Actual: %d"), screenSize.iWidth/6, invalid.BoundingRect().iBr.iX);			
   1.666 +	TheClient->iWs.Finish();
   1.667 +	TheClient->WaitForRedrawsToFinish();
   1.668 +	testWin->Win()->GetInvalidRegion(invalid);
   1.669 +	
   1.670 +	retVal = invalid.IsEmpty();
   1.671 +	TEST(retVal);
   1.672 +	if (!retVal)
   1.673 +		{
   1.674 +		INFO_PRINTF3(_L("!invalid.CheckError() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
   1.675 +		}
   1.676 +
   1.677 +	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/3,screenSize.iHeight-4)));
   1.678 +	win.SetVisible(ETrue);
   1.679 +	win.SetVisible(EFalse);
   1.680 +	User::LeaveIfError(testWin->Win()->SetSizeErr(TSize(screenSize.iWidth/6,screenSize.iHeight-6)));
   1.681 +	testWin->SetColor(TRgb::Gray4(1));
   1.682 +	testWin->DrawNow();
   1.683 +	TheClient->iWs.Flush();
   1.684 +	//PeterI This is testing an intermediate state i.e. "flicker" and will never pass on mk3
   1.685 +/*	CheckRectNoMatch(TPoint(screenSize.iWidth/3+30,20),TPoint(screenSize.iWidth/3+50,90),TSize(10,10),_L("CTRegion::ClipTestL()"));
   1.686 +	TEST(retVal);
   1.687 +	if (!retVal)
   1.688 +		{
   1.689 +		INFO_PRINTF3(_L("!CheckRect() return value  - Expected: %d, Actual: %d"), ETrue, retVal);
   1.690 +		}
   1.691 +		*/
   1.692 +	CleanupStack::PopAndDestroy(2,&win);
   1.693 +	}
   1.694 +
   1.695 +void CTRegion::RunTestCaseL(TInt /*aCurTestCase*/)
   1.696 +	{
   1.697 +	((CTRegionStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
   1.698 +	switch(++iTest->iState)
   1.699 +		{
   1.700 +/**
   1.701 +@SYMTestCaseID		GRAPHICS-WSERV-0272
   1.702 +
   1.703 +@SYMDEF             DEF081259
   1.704 +
   1.705 +@SYMTestCaseDesc    Test drawing to a region including clipping
   1.706 +
   1.707 +@SYMTestPriority    High
   1.708 +
   1.709 +@SYMTestStatus      Implemented
   1.710 +
   1.711 +@SYMTestActions     Draw to a region that has clipping enabled and the check the
   1.712 +					drawing occurs correctly
   1.713 +
   1.714 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.715 +*/
   1.716 +		case 1:
   1.717 +			{
   1.718 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0272"));
   1.719 +			iTest->LogSubTest(_L("Main"));
   1.720 +			RRegion clippingRegion;
   1.721 +			CreateChildWindowsL();
   1.722 +			TheClient->iWs.Finish();
   1.723 +			TheClient->WaitForRedrawsToFinish();
   1.724 +			TSize scrSize(TheClient->iScreen->SizeInPixels());
   1.725 +			for(TUint index=0;index<(sizeof(regionRectList)/sizeof(regionRectList[0]));index++)
   1.726 +				{
   1.727 +				regionRectList[index].SetWidth((regionRectList[index].Width()*scrSize.iWidth)/640);
   1.728 +				regionRectList[index].SetHeight((regionRectList[index].Height()*scrSize.iHeight)/240);
   1.729 +				clippingRectList[index].SetWidth((clippingRectList[index].Width()*scrSize.iWidth)/640);
   1.730 +				clippingRectList[index].SetHeight((clippingRectList[index].Height()*scrSize.iHeight)/240);
   1.731 +				originList[index].iX = (originList[index].iX*scrSize.iWidth)/640;
   1.732 +				originList[index].iY = (originList[index].iY*scrSize.iHeight)/240;
   1.733 +
   1.734 +				clippingRegion.AddRect(regionRectList[index]);
   1.735 +				TestRegionL(clippingRegion,clippingRectList[index],originList[index]);
   1.736 +				}
   1.737 +			clippingRegion.Close();
   1.738 +			DeleteChildWindows();
   1.739 +			}
   1.740 +			break;
   1.741 +/**
   1.742 +@SYMTestCaseID		GRAPHICS-WSERV-0273
   1.743 +
   1.744 +@SYMDEF             DEF081259
   1.745 +
   1.746 +@SYMTestCaseDesc    Test drawing to a region including clipping as it is exposed
   1.747 +
   1.748 +@SYMTestPriority    High
   1.749 +
   1.750 +@SYMTestStatus      Implemented
   1.751 +
   1.752 +@SYMTestActions     Draw to a region that has clipping enabled as it is exposed
   1.753 +					and the check the drawing occurs correctly
   1.754 +
   1.755 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.756 +*/
   1.757 +		case 2:
   1.758 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0273"));
   1.759 +			//PeterI This appears to be testing "flicker" of a window after an expose
   1.760 +			//Mk3 doesn't exhibit this behaviour. Is the flicker expected behaviour?
   1.761 +//			iTest->LogSubTest(_L("Expose Test"));
   1.762 +//			ExposeTestL();
   1.763 +			break;
   1.764 +/**
   1.765 +@SYMTestCaseID		GRAPHICS-WSERV-0274
   1.766 +
   1.767 +@SYMDEF             DEF081259
   1.768 +
   1.769 +@SYMTestCaseDesc    Test drawing to a region including clipping as it is exposed
   1.770 +
   1.771 +@SYMTestPriority    High
   1.772 +
   1.773 +@SYMTestStatus      Implemented
   1.774 +
   1.775 +@SYMTestActions     Draw to a region that has clipping enabled as it is exposed
   1.776 +					and the check the drawing occurs correctly
   1.777 +
   1.778 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.779 +*/
   1.780 +		case 3:
   1.781 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0274"));
   1.782 +			iTest->LogSubTest(_L("Expose Test2"));
   1.783 +			ExposeTest2L();
   1.784 +			break;
   1.785 +/**
   1.786 +@SYMTestCaseID		GRAPHICS-WSERV-0275
   1.787 +
   1.788 +@SYMDEF             DEF081259
   1.789 +
   1.790 +@SYMTestCaseDesc    Test drawing to a region including clipping as it is covered
   1.791 +
   1.792 +@SYMTestPriority    High
   1.793 +
   1.794 +@SYMTestStatus      Implemented
   1.795 +
   1.796 +@SYMTestActions     Draw to a region that has clipping enabled as it is covered
   1.797 +					and the check the drawing occurs correctly
   1.798 +
   1.799 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.800 +*/
   1.801 +		case 4:
   1.802 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0275"));
   1.803 +			iTest->LogSubTest(_L("Cover Test"));
   1.804 +			CoverTestL();
   1.805 +			break;
   1.806 +/**
   1.807 +@SYMTestCaseID		GRAPHICS-WSERV-0276
   1.808 +
   1.809 +@SYMDEF             DEF081259
   1.810 +
   1.811 +@SYMTestCaseDesc    Test drawing to a region including clipping and with an offset
   1.812 +
   1.813 +@SYMTestPriority    High
   1.814 +
   1.815 +@SYMTestStatus      Implemented
   1.816 +
   1.817 +@SYMTestActions     Draw to a region that has clipping enabled and with an offset
   1.818 +					and the check the drawing occurs correctly
   1.819 +
   1.820 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.821 +*/
   1.822 +		case 5:
   1.823 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0276"));
   1.824 +			iTest->LogSubTest(_L("Offset Test"));
   1.825 +			OffsetTestL();
   1.826 +			break;
   1.827 +/**
   1.828 +@SYMTestCaseID		GRAPHICS-WSERV-0277
   1.829 +
   1.830 +@SYMDEF             DEF081259
   1.831 +
   1.832 +@SYMTestCaseDesc    Test drawing to a region including clipping
   1.833 +
   1.834 +@SYMTestPriority    High
   1.835 +
   1.836 +@SYMTestStatus      Implemented
   1.837 +
   1.838 +@SYMTestActions     Draw to a region that has clipping enabled
   1.839 +					and the check the drawing occurs correctly
   1.840 +
   1.841 +@SYMTestExpectedResults Drawing to the region occurs correctly
   1.842 +*/
   1.843 +		case 6:
   1.844 +			((CTRegionStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0277"));
   1.845 +			iTest->LogSubTest(_L("Clip Test"));
   1.846 +			ClipTestL();
   1.847 +			break;
   1.848 +		default:
   1.849 +			((CTRegionStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
   1.850 +			((CTRegionStep*)iStep)->CloseTMSGraphicsStep();
   1.851 +			TestComplete();
   1.852 +		}
   1.853 +	((CTRegionStep*)iStep)->RecordTestResultL();
   1.854 +	}
   1.855 +
   1.856 +	
   1.857 +__WS_CONSTRUCT_STEP__(Region)