os/graphics/windowing/windowserver/test/tauto/TBACKUPW.CPP
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
// Test backed up windows
sl@0
    15
// 
sl@0
    16
//
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @test
sl@0
    21
 @internalComponent - Internal Symbian test code
sl@0
    22
*/
sl@0
    23
sl@0
    24
#include "TBACKUPW.H"
sl@0
    25
sl@0
    26
CTBackedUpWindow::CTBackedUpWindow(CTestStep* aStep):
sl@0
    27
	CTWsGraphicsBase(aStep)
sl@0
    28
	{
sl@0
    29
	}
sl@0
    30
sl@0
    31
sl@0
    32
void CTBackedUpWindow::CheckWindow(CFbsBitmap *aBitmap)
sl@0
    33
	{
sl@0
    34
	TPoint oldPos=iBackedUpWindow.Position();
sl@0
    35
	iBackedUpWindow.SetPosition(TPoint(0,0));
sl@0
    36
sl@0
    37
	iCheckWindow.SetVisible(ETrue);
sl@0
    38
	iCheckWindow.SetPosition(iCheckPos);
sl@0
    39
sl@0
    40
	iCheckWindow.BeginRedraw();
sl@0
    41
	TheGc->Activate(iCheckWindow);
sl@0
    42
	TheGc->BitBlt(TPoint(0,0), aBitmap);
sl@0
    43
	TheGc->Deactivate();
sl@0
    44
	iCheckWindow.EndRedraw();
sl@0
    45
sl@0
    46
	TheClient->iWs.Flush();
sl@0
    47
	TheClient->WaitForRedrawsToFinish();
sl@0
    48
	TBool retVal = TheClient->iScreen->RectCompare(TRect(iSize),TRect(iCheckPos,iSize));
sl@0
    49
	TEST(retVal);
sl@0
    50
	if (!retVal)
sl@0
    51
		INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(TRect(iSize),TRect(iCheckPos,iSize)) return value - Expected: %d , Actual: %d"), ETrue, retVal);		
sl@0
    52
sl@0
    53
	iCheckWindow.SetVisible(EFalse);
sl@0
    54
	iBackedUpWindow.SetPosition(oldPos);
sl@0
    55
	}
sl@0
    56
sl@0
    57
void CTBackedUpWindow::CheckWindow()
sl@0
    58
	{
sl@0
    59
	CheckWindow(&iBitmap);
sl@0
    60
	}
sl@0
    61
sl@0
    62
void CTBackedUpWindow::Draw(TInt aDrawFunc, TAny *aParam)
sl@0
    63
	{
sl@0
    64
	TheGc->Activate(iBackedUpWindow);
sl@0
    65
	Draw(aDrawFunc, aParam, TheGc, iBitGc);
sl@0
    66
	TheGc->Deactivate();
sl@0
    67
	}
sl@0
    68
sl@0
    69
void CTBackedUpWindow::DrawWithTwoGcsL()
sl@0
    70
	{
sl@0
    71
	RBlankWindow blank(TheClient->iWs);
sl@0
    72
	User::LeaveIfError(blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle));
sl@0
    73
	blank.Activate();
sl@0
    74
	CWindowGc *gc2;
sl@0
    75
	User::LeaveIfError(TheClient->iScreen->CreateContext(gc2));
sl@0
    76
	CleanupStack::PushL(gc2);
sl@0
    77
sl@0
    78
	CFbsFont *font1;
sl@0
    79
	TFontSpec fspec(KTestFontTypefaceName,200);
sl@0
    80
	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font1,fspec));
sl@0
    81
	CFbsFont *font2;
sl@0
    82
	TFontSpec fspec2(KTestFontTypefaceName,400);
sl@0
    83
	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font2,fspec2));
sl@0
    84
sl@0
    85
	gc2->Activate(iBackedUpWindow);
sl@0
    86
	gc2->UseFont(font2);
sl@0
    87
	TheGc->Activate(iBackedUpWindow);
sl@0
    88
	TheGc->UseFont(font1);
sl@0
    89
	_LIT(KText,"Testing123");
sl@0
    90
	TheGc->DrawText(KText,TPoint(20,20));
sl@0
    91
	gc2->DrawText(KText,TPoint(20,40));
sl@0
    92
	iBitGc->UseFont(font1);
sl@0
    93
	iBitGc->DrawText(KText,TPoint(20,20));
sl@0
    94
	iBitGc->UseFont(font2);
sl@0
    95
	iBitGc->DrawText(KText,TPoint(20,40));
sl@0
    96
	iBitGc->DiscardFont();
sl@0
    97
	TheGc->Deactivate();
sl@0
    98
	TheClient->iScreen->ReleaseFont(font2);
sl@0
    99
	TheClient->iScreen->ReleaseFont(font1);
sl@0
   100
	CleanupStack::PopAndDestroy();
sl@0
   101
	blank.Close();
sl@0
   102
	}
sl@0
   103
sl@0
   104
void CTBackedUpWindow::Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *gc1, CBitmapContext *gc2)			//DDD
sl@0
   105
	{
sl@0
   106
	CBitmapContext *gc;
sl@0
   107
	for(TInt mode=0;mode<2;mode++)
sl@0
   108
		{
sl@0
   109
		if (mode==0)
sl@0
   110
			gc=gc1;
sl@0
   111
		else
sl@0
   112
			gc=gc2;
sl@0
   113
		gc->Reset();
sl@0
   114
		switch(aDrawFunc)
sl@0
   115
			{
sl@0
   116
			case 0:
sl@0
   117
				gc->SetBrushColor(*((TRgb *)aParam));
sl@0
   118
				gc->SetBrushStyle(CGraphicsContext::ESolidBrush);
sl@0
   119
				gc->SetPenStyle(CGraphicsContext::ENullPen);
sl@0
   120
				gc->DrawRect(TRect(iSize));
sl@0
   121
				break;
sl@0
   122
			case 1:
sl@0
   123
				{
sl@0
   124
				TSize half(iSize.iWidth/2,iSize.iHeight/2);
sl@0
   125
				gc->DrawEllipse(TRect(half));
sl@0
   126
				gc->DrawEllipse(TRect(TPoint(0,half.iHeight),half));
sl@0
   127
				TRect rect1(half);
sl@0
   128
				gc->SetOrigin(TPoint(half.iWidth,0));
sl@0
   129
				gc->SetClippingRect(rect1);
sl@0
   130
				gc->DrawEllipse(rect1);
sl@0
   131
				gc->SetOrigin(TPoint(half.iWidth,half.iHeight));
sl@0
   132
				gc->SetClippingRect(rect1);
sl@0
   133
				gc->DrawEllipse(rect1);
sl@0
   134
				gc->SetOrigin(TPoint(0,0));
sl@0
   135
				gc->CancelClippingRect();
sl@0
   136
				}
sl@0
   137
				break;
sl@0
   138
			case 2:
sl@0
   139
				{
sl@0
   140
				TInt param= *((TInt *)aParam);
sl@0
   141
				if (param&0x1)
sl@0
   142
					gc->DrawLine(TPoint(param+(param*27)%iSize.iWidth,0),
sl@0
   143
								 TPoint(iSize.iWidth-((param<<1)+(param*19)%iSize.iWidth),iSize.iHeight));
sl@0
   144
				else
sl@0
   145
					gc->DrawLine(TPoint(0, (param<<1)+(param*7)%iSize.iHeight),
sl@0
   146
								 TPoint(iSize.iWidth,param+(param*13)%iSize.iHeight));
sl@0
   147
				}
sl@0
   148
				break;
sl@0
   149
			case 3:
sl@0
   150
				{
sl@0
   151
				TPoint pos;
sl@0
   152
				for(;pos.iX<iSize.iWidth;pos.iX+=10)
sl@0
   153
					gc->DrawLine(pos,pos+TSize(0,iSize.iHeight));
sl@0
   154
				for(pos.iX=0;pos.iY<iSize.iHeight;pos.iY+=10)
sl@0
   155
					gc->DrawLine(pos,pos+TSize(iSize.iWidth,0));
sl@0
   156
				}
sl@0
   157
				break;
sl@0
   158
			}
sl@0
   159
		}
sl@0
   160
	}
sl@0
   161
sl@0
   162
CTBackedUpWindow::~CTBackedUpWindow()
sl@0
   163
	{
sl@0
   164
	iBackedUpWindow.Close();
sl@0
   165
	iCheckWindow.Close();
sl@0
   166
	iOomFrontWindow.Close();
sl@0
   167
	delete iBitGc;
sl@0
   168
	delete iBitmapDevice;
sl@0
   169
	delete iTestBitmap;
sl@0
   170
	delete iMaskBitmap;
sl@0
   171
	}
sl@0
   172
sl@0
   173
void CopyToGray4L(CFbsBitmap*& aDestBitmap,const CFbsBitmap& aSrcBitmap)
sl@0
   174
	{
sl@0
   175
	aDestBitmap=new(ELeave) CFbsBitmap();
sl@0
   176
	CleanupStack::PushL(aDestBitmap);
sl@0
   177
	User::LeaveIfError(aDestBitmap->Create(aSrcBitmap.SizeInPixels(),EGray4));
sl@0
   178
	CFbsBitmapDevice* device=CFbsBitmapDevice::NewL(aDestBitmap);
sl@0
   179
	CleanupStack::PushL(device);
sl@0
   180
	CFbsBitGc* gc;
sl@0
   181
	User::LeaveIfError(device->CreateContext(gc));
sl@0
   182
	gc->BitBlt(TPoint(),&aSrcBitmap);
sl@0
   183
	delete gc;
sl@0
   184
	CleanupStack::PopAndDestroy(device);
sl@0
   185
	CleanupStack::Pop(aDestBitmap);
sl@0
   186
	}
sl@0
   187
sl@0
   188
void CTBackedUpWindow::ConstructL()
sl@0
   189
	{
sl@0
   190
	iBackedUpWindow=RBackedUpWindow(TheClient->iWs);
sl@0
   191
	iBackedUpWindow.Construct(*(TheClient->iGroup->GroupWin()),EGray4,ENullWsHandle);
sl@0
   192
	TSize size=TheClient->iScreen->SizeInTwips();
sl@0
   193
	iSize=TheClient->iScreen->SizeInPixels();
sl@0
   194
	iSize.iWidth>>=1;
sl@0
   195
	iSize.iHeight>>=1;
sl@0
   196
	size.iWidth>>=1;
sl@0
   197
	size.iHeight>>=1;
sl@0
   198
	size.iWidth-=1;			//Modification to get the mapping factor the same as the screen
sl@0
   199
	size.iHeight-=1;		//Ditto
sl@0
   200
	iWinPos.SetXY(iSize.iWidth>>1,iSize.iHeight>>1);
sl@0
   201
	User::LeaveIfError(iBackedUpWindow.SetExtentErr(iWinPos,iSize));
sl@0
   202
	iBackedUpWindow.Activate();
sl@0
   203
sl@0
   204
	iCheckPos.SetXY(iSize.iWidth,0);
sl@0
   205
	iCheckWindow=RWindow(TheClient->iWs);
sl@0
   206
	iCheckWindow.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   207
	iCheckWindow.SetSize(iSize);
sl@0
   208
	iCheckWindow.SetVisible(EFalse);
sl@0
   209
	iCheckWindow.Activate();
sl@0
   210
sl@0
   211
	TInt col,grey;
sl@0
   212
	TDisplayMode defMode=TheClient->iWs.GetDefModeMaxNumColors(col,grey);
sl@0
   213
	User::LeaveIfError(iBitmap.Create(iSize,defMode));
sl@0
   214
	iBitmap.SetSizeInTwips(size);
sl@0
   215
	iBitmapDevice=CFbsBitmapDevice::NewL(&iBitmap);
sl@0
   216
	User::LeaveIfError(iBitmapDevice->CreateContext(iBitGc));
sl@0
   217
sl@0
   218
	TRgb rgb(TRgb::Gray4(2));
sl@0
   219
	Draw(0,&rgb);
sl@0
   220
sl@0
   221
	iTestBitmap=new(ELeave) CFbsBitmap();
sl@0
   222
  	User::LeaveIfError(iTestBitmap->Load(TEST_BITMAP_NAME,0));
sl@0
   223
	iTestBitmap->SetSizeInTwips(TSize(1500,750));
sl@0
   224
	iMaskBitmap=new(ELeave) CFbsBitmap();
sl@0
   225
  	User::LeaveIfError(iMaskBitmap->Load(TEST_BITMAP_NAME,0));
sl@0
   226
  	TDisplayMode defMode2=iMaskBitmap->DisplayMode();
sl@0
   227
  	if (defMode>EGray4)
sl@0
   228
		{
sl@0
   229
		CFbsBitmap* bitmap=iTestBitmap;
sl@0
   230
		CopyToGray4L(iTestBitmap,*bitmap);
sl@0
   231
		delete bitmap;
sl@0
   232
		bitmap=iMaskBitmap;
sl@0
   233
		CopyToGray4L(iMaskBitmap,*bitmap);
sl@0
   234
		delete bitmap;
sl@0
   235
		}
sl@0
   236
	defMode2=iMaskBitmap->DisplayMode();
sl@0
   237
	defMode2=iMaskBitmap->DisplayMode();	
sl@0
   238
	}
sl@0
   239
sl@0
   240
void CTBackedUpWindow::InvisVis()
sl@0
   241
	{
sl@0
   242
	iBackedUpWindow.SetVisible(EFalse);
sl@0
   243
	TheClient->iWs.Flush();
sl@0
   244
	iBackedUpWindow.SetVisible(ETrue);
sl@0
   245
	TheClient->iWs.Flush();
sl@0
   246
	}
sl@0
   247
sl@0
   248
void CTBackedUpWindow::WindowOnTop()
sl@0
   249
	{
sl@0
   250
	RBlankWindow blank(TheClient->iWs);
sl@0
   251
	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   252
	blank.Activate();
sl@0
   253
	blank.Close();
sl@0
   254
	TheClient->iWs.Flush();
sl@0
   255
sl@0
   256
	TPoint pos;
sl@0
   257
	TInt sizeMode=0;
sl@0
   258
	TInt draw=13;
sl@0
   259
sl@0
   260
	for(pos.iX=-iSize.iWidth;pos.iX<iSize.iWidth;pos.iX+=50)
sl@0
   261
		for(pos.iY=-iSize.iHeight;pos.iY<iSize.iHeight;pos.iY+=50)
sl@0
   262
			{
sl@0
   263
			blank=RBlankWindow(TheClient->iWs);
sl@0
   264
			blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   265
			blank.SetColor(TRgb::Gray256(220));
sl@0
   266
			blank.SetShadowHeight(2);
sl@0
   267
			blank.SetExtent(pos+iWinPos,TSize((sizeMode&0x1)?iSize.iWidth>>1:iSize.iWidth<<1,(sizeMode&0x2)?iSize.iHeight>>1:iSize.iHeight<<1));
sl@0
   268
			sizeMode=(sizeMode+1)%4;
sl@0
   269
			blank.Activate();
sl@0
   270
			Draw(2,&draw);
sl@0
   271
			TheClient->iWs.Flush();
sl@0
   272
			draw++;
sl@0
   273
			blank.Close();
sl@0
   274
			}
sl@0
   275
	}
sl@0
   276
sl@0
   277
void CTBackedUpWindow::Resize()
sl@0
   278
	{
sl@0
   279
	RBlankWindow blank(TheClient->iWs);
sl@0
   280
	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   281
	blank.SetColor(TRgb::Gray256(128));
sl@0
   282
	blank.Activate();
sl@0
   283
	TInt xtop=(iSize.iWidth)-(iSize.iWidth>>2);
sl@0
   284
	TInt ytop=(iSize.iHeight)-(iSize.iHeight>>2);
sl@0
   285
	for(TInt winMode=0;winMode<3;winMode++)
sl@0
   286
		{
sl@0
   287
		switch(winMode)
sl@0
   288
			{
sl@0
   289
			case 0:
sl@0
   290
				blank.SetExtent(TPoint(0,ytop),TSize(iSize.iWidth,iSize.iHeight>>1));
sl@0
   291
				break;
sl@0
   292
			case 1:
sl@0
   293
				blank.SetExtent(TPoint(xtop,0),TSize(iSize.iWidth>>1,iSize.iHeight));
sl@0
   294
				break;
sl@0
   295
			case 2:
sl@0
   296
				blank.SetExtent(TPoint(xtop,ytop),TSize(iSize.iWidth>>1,iSize.iHeight>>1));
sl@0
   297
				break;
sl@0
   298
			}
sl@0
   299
		blank.SetShadowHeight(winMode);
sl@0
   300
		TPoint oldPos=iBackedUpWindow.Position();
sl@0
   301
		TPoint pos=oldPos;
sl@0
   302
		for(TUint i=0;i<sizeof(moveList)/sizeof(moveList[0]);i++)
sl@0
   303
			{
sl@0
   304
			pos+=moveList[i];
sl@0
   305
			iBackedUpWindow.SetPosition(pos);
sl@0
   306
			TheClient->iWs.Flush();
sl@0
   307
			}
sl@0
   308
		iBackedUpWindow.SetPosition(oldPos);
sl@0
   309
		}
sl@0
   310
	blank.Close();
sl@0
   311
	}
sl@0
   312
sl@0
   313
void CTBackedUpWindow::ChildWindows()
sl@0
   314
	{
sl@0
   315
	TPoint pos;
sl@0
   316
	TInt sizeMode=0;
sl@0
   317
	TInt draw=13;
sl@0
   318
	RBlankWindow blank(TheClient->iWs);
sl@0
   319
	for(pos.iX=-(iSize.iWidth>>1);pos.iX<iSize.iWidth;pos.iX+=33)
sl@0
   320
		for(pos.iY=-(iSize.iHeight>>1);pos.iY<iSize.iHeight;pos.iY+=33)
sl@0
   321
			{
sl@0
   322
			blank.Construct(iBackedUpWindow,ENullWsHandle);
sl@0
   323
			blank.SetColor(TRgb::Gray256(220));
sl@0
   324
			blank.SetShadowHeight(2);
sl@0
   325
			blank.SetExtent(pos,TSize((sizeMode&0x1)?iSize.iWidth>>2:iSize.iWidth,(sizeMode&0x2)?iSize.iHeight>>2:iSize.iHeight));
sl@0
   326
			sizeMode=(sizeMode+1)%4;
sl@0
   327
			blank.Activate();
sl@0
   328
			Draw(2,&draw);
sl@0
   329
			TheClient->iWs.Flush();
sl@0
   330
			draw++;
sl@0
   331
			blank.Close();
sl@0
   332
			}
sl@0
   333
	}
sl@0
   334
sl@0
   335
void CTBackedUpWindow::DupBitmapTestL()
sl@0
   336
	{
sl@0
   337
	INFO_PRINTF1(_L("AUTO  Dup Bitmap Test "));
sl@0
   338
	CFbsBitmap *dup=new(ELeave) CFbsBitmap();
sl@0
   339
	dup->Duplicate(iBackedUpWindow.BitmapHandle());
sl@0
   340
	CheckWindow(dup);
sl@0
   341
	TRgb rgb(TRgb::Gray4(1));
sl@0
   342
	Draw(0,&rgb);
sl@0
   343
	CheckWindow(dup);
sl@0
   344
	INFO_PRINTF1(_L(" Done Window Drawing Test"));
sl@0
   345
sl@0
   346
	CFbsBitmapDevice *dupDevice=NULL;
sl@0
   347
	TRAPD(err,dupDevice=CFbsBitmapDevice::NewL(dup));
sl@0
   348
	CFbsBitGc *gc;
sl@0
   349
	if (err==KErrNone && dupDevice->CreateContext(gc)==KErrNone)
sl@0
   350
		{
sl@0
   351
		Draw(3,NULL,gc,iBitGc);		// Draw directly to backup bitmap (and test bitmap)
sl@0
   352
		iBackedUpWindow.UpdateScreen();
sl@0
   353
		INFO_PRINTF1(_L(" First Bitmap Drawing"));
sl@0
   354
		CheckWindow();
sl@0
   355
		TRgb rgb(TRgb::Gray256(128));
sl@0
   356
		TInt col,grey;
sl@0
   357
		if (TheClient->iWs.GetDefModeMaxNumColors(col,grey)>EGray4)
sl@0
   358
			rgb=TRgb::Gray4(2);
sl@0
   359
		Draw(0,&rgb,gc,iBitGc);
sl@0
   360
		Draw(1,NULL,gc,iBitGc);
sl@0
   361
		iBackedUpWindow.UpdateScreen(TRegionFix<1>(TRect(iSize)));
sl@0
   362
		INFO_PRINTF1(_L(" Second Bitmap Drawing"));
sl@0
   363
		CheckWindow();
sl@0
   364
		delete gc;
sl@0
   365
		}
sl@0
   366
	delete dupDevice;
sl@0
   367
	delete dup;
sl@0
   368
	}
sl@0
   369
sl@0
   370
void CTBackedUpWindow::UpdateBitmapTestL()
sl@0
   371
	{
sl@0
   372
	INFO_PRINTF1(_L("AUTO  UpdateBitmap "));
sl@0
   373
	CheckWindow();
sl@0
   374
	CFbsBitmap *dup=new(ELeave) CFbsBitmap();
sl@0
   375
	dup->Duplicate(iBackedUpWindow.BitmapHandle());
sl@0
   376
	Draw(3,NULL);
sl@0
   377
	iBackedUpWindow.UpdateBackupBitmap();
sl@0
   378
	INFO_PRINTF1(_L(" First Drawing"));
sl@0
   379
	CheckWindow(dup);
sl@0
   380
	TRgb rgb;
sl@0
   381
	if (iSupState==0)
sl@0
   382
		rgb=TRgb::Gray256(128);
sl@0
   383
	else
sl@0
   384
		rgb=TRgb::Gray4(2);
sl@0
   385
	Draw(0,&rgb);
sl@0
   386
	Draw(1,NULL);
sl@0
   387
	iBackedUpWindow.UpdateBackupBitmap();
sl@0
   388
	INFO_PRINTF1(_L(" Second Drawing"));
sl@0
   389
	CheckWindow(dup);
sl@0
   390
	delete dup;
sl@0
   391
	}
sl@0
   392
sl@0
   393
void CTBackedUpWindow::OOML()
sl@0
   394
	{
sl@0
   395
	iOomFrontWindow=RBlankWindow(TheClient->iWs);
sl@0
   396
	TSize size(iBackedUpWindow.Size());
sl@0
   397
	size.iWidth>>=1;
sl@0
   398
	size.iHeight>>=1;
sl@0
   399
	TPoint pos(size.iWidth*3/2,size.iHeight*3/2);
sl@0
   400
	iOomFrontWindow.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   401
	iOomFrontWindow.SetColor(TRgb(TRgb::Gray4(1)));
sl@0
   402
	iOomFrontWindow.SetExtent(pos,size);
sl@0
   403
	iOomFrontWindow.Activate();
sl@0
   404
	TheClient->iWs.Flush();
sl@0
   405
sl@0
   406
	TPoint buwPos=iBackedUpWindow.Position();
sl@0
   407
	TSize buwSize=iBackedUpWindow.Size();
sl@0
   408
	for(TInt count=0;count<100;count++)
sl@0
   409
		{
sl@0
   410
		iOomFrontWindow.SetVisible(ETrue);
sl@0
   411
		TheClient->iWs.HeapSetFail(RHeap::EDeterministic,count);
sl@0
   412
		iBackedUpWindow.SetPosition(buwPos+TPoint(10,5));
sl@0
   413
		iBackedUpWindow.SetPosition(buwPos);
sl@0
   414
		iOomFrontWindow.SetSize(size+TSize(10,5));
sl@0
   415
		iOomFrontWindow.SetSize(size);
sl@0
   416
		iBackedUpWindow.SetSizeErr(buwSize+TSize(13,7));
sl@0
   417
		iBackedUpWindow.SetSizeErr(buwSize);
sl@0
   418
		iOomFrontWindow.SetVisible(EFalse);
sl@0
   419
		TheClient->iWs.HeapSetFail(RHeap::ENone,0);
sl@0
   420
		User::LeaveIfError(iBackedUpWindow.SetSizeErr(buwSize));
sl@0
   421
		TheClient->WaitForRedrawsToFinish();
sl@0
   422
		CheckWindow();
sl@0
   423
		}
sl@0
   424
sl@0
   425
	iOomFrontWindow.Close();
sl@0
   426
	}
sl@0
   427
sl@0
   428
void CTBackedUpWindow::doGraphicFunctionsL(CBitmapContext *gc,TBool aExtraDrawBitMap)
sl@0
   429
	{
sl@0
   430
	TSize size=iBackedUpWindow.Size();
sl@0
   431
	CFbsFont *aFont;
sl@0
   432
	_LIT(KFontName,"Swiss");
sl@0
   433
	TFontSpec fspec(KFontName,190);
sl@0
   434
	User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)aFont,fspec));
sl@0
   435
	CFbsBitmap* aBitmap=iTestBitmap;
sl@0
   436
	CFbsBitmap* aMaskBitmap=iMaskBitmap;
sl@0
   437
sl@0
   438
	#include "DLLDRAW.H"	// Draws to a Gc called 'gc'
sl@0
   439
	
sl@0
   440
	TheClient->iScreen->ReleaseFont(aFont);
sl@0
   441
	}
sl@0
   442
sl@0
   443
void CTBackedUpWindow::AllGraphicFunctionsL(RBlankWindow &aBlank,TBool aExtraDrawBitMap/*=ETrue*/)
sl@0
   444
	{
sl@0
   445
	aExtraDrawBitMap=EFalse;		//Check out when bitblit scaling has changed again
sl@0
   446
	aBlank.SetVisible(ETrue);
sl@0
   447
	TheGc->Activate(iBackedUpWindow);
sl@0
   448
	TRAPD(err,doGraphicFunctionsL(TheGc,aExtraDrawBitMap));
sl@0
   449
	TheGc->Deactivate();
sl@0
   450
	User::LeaveIfError(err);
sl@0
   451
	iBitGc->Reset();
sl@0
   452
	iBitGc->SetUserDisplayMode(EGray4);
sl@0
   453
	doGraphicFunctionsL(iBitGc,aExtraDrawBitMap);
sl@0
   454
	aBlank.SetVisible(EFalse);
sl@0
   455
	CheckWindow();
sl@0
   456
	}
sl@0
   457
sl@0
   458
void CTBackedUpWindow::AllGraphicFunctionsTestsL()
sl@0
   459
	{
sl@0
   460
	RBlankWindow blank(TheClient->iWs);
sl@0
   461
	TInt xtop=(iSize.iWidth)-(iSize.iWidth>>1);
sl@0
   462
	TInt ytop=(iSize.iHeight)-(iSize.iHeight>>1);
sl@0
   463
	blank.Construct(*(TheClient->iGroup->GroupWin()),ENullWsHandle);
sl@0
   464
	blank.SetColor(TRgb::Gray256(128));
sl@0
   465
	blank.Activate();
sl@0
   466
	blank.SetExtent(TPoint(0,ytop),TSize(iSize.iWidth,iSize.iHeight>>2));
sl@0
   467
	AllGraphicFunctionsL(blank);
sl@0
   468
	blank.SetExtent(TPoint(0,ytop+10),TSize(iSize.iWidth,iSize.iHeight>>2));
sl@0
   469
	AllGraphicFunctionsL(blank);
sl@0
   470
	blank.SetExtent(TPoint(xtop,ytop),TSize(iSize.iWidth>>1,iSize.iHeight));
sl@0
   471
	AllGraphicFunctionsL(blank,EFalse);
sl@0
   472
	blank.SetExtent(TPoint(xtop+(iSize.iWidth>>1),ytop),TSize(iSize.iWidth>>1,iSize.iHeight));
sl@0
   473
	AllGraphicFunctionsL(blank,EFalse);
sl@0
   474
	blank.SetExtent(TPoint(xtop+10,iSize.iHeight),TSize(iSize.iWidth,iSize.iHeight));
sl@0
   475
	AllGraphicFunctionsL(blank,EFalse);
sl@0
   476
	blank.SetExtent(TPoint(xtop,ytop),iSize);
sl@0
   477
	AllGraphicFunctionsL(blank,EFalse);
sl@0
   478
	blank.SetExtent(TPoint(0,0),TSize(0,0));
sl@0
   479
	AllGraphicFunctionsL(blank);
sl@0
   480
	blank.Close();
sl@0
   481
	}
sl@0
   482
sl@0
   483
void CTBackedUpWindow::RunTestCaseL(TInt /*aCurTestCase*/)
sl@0
   484
	{
sl@0
   485
	switch(iSupState)
sl@0
   486
		{
sl@0
   487
		case 0:
sl@0
   488
			for (TInt iSubTest=0;iSubTest<KLastSubtest;iSubTest++)
sl@0
   489
				{
sl@0
   490
				DoSubTestL(iSubTest);
sl@0
   491
				}
sl@0
   492
			iBackedUpWindow.MaintainBackup();		//Putting this line here is a work around
sl@0
   493
			break;
sl@0
   494
		case 1:
sl@0
   495
			for (TInt iSubTest=0;iSubTest<KLastSubtest;iSubTest++)
sl@0
   496
				{
sl@0
   497
				DoSubTestL(iSubTest);
sl@0
   498
				}
sl@0
   499
			break;
sl@0
   500
		default:
sl@0
   501
			TestComplete();
sl@0
   502
			break;
sl@0
   503
		}
sl@0
   504
	iSupState++;
sl@0
   505
	}
sl@0
   506
sl@0
   507
void CTBackedUpWindow::DoSubTestL(TInt iState)
sl@0
   508
	{
sl@0
   509
	_LIT(KTest0,"Simple draw");
sl@0
   510
	_LIT(KTest1,"Resizing");
sl@0
   511
	_LIT(KTest2,"Invisible/Visible");
sl@0
   512
	_LIT(KTest3,"Windows on top");
sl@0
   513
	_LIT(KTest4,"Child Windows");
sl@0
   514
	_LIT(KTest5,"OOM");
sl@0
   515
	_LIT(KTest6,"Update Bitmap");
sl@0
   516
	_LIT(KTest7,"Bitmap duplicate");
sl@0
   517
	_LIT(KTest8,"Two Graphic Contexts");
sl@0
   518
	_LIT(KTest9,"All Graphic Functions");
sl@0
   519
	_LIT(KTest10,"Reactivate");
sl@0
   520
	_LIT(KTest11,"DoDrawCommand");
sl@0
   521
sl@0
   522
	TRgb rgb1(255,255,255);
sl@0
   523
	TRgb rgb2(255,255,255);
sl@0
   524
	TRgb rgb3(255,255,255);
sl@0
   525
	TRgb rgb4(255,255,255);
sl@0
   526
	TRgb rgb5(255,255,255);
sl@0
   527
	TRgb rgb6(255,255,255);
sl@0
   528
	TRgb rgb7(255,255,255);
sl@0
   529
	TRgb color(TRgb::Gray4(2));
sl@0
   530
sl@0
   531
	iTest->iState=iState;
sl@0
   532
((CTBackedUpWindowStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
sl@0
   533
	switch(iState)
sl@0
   534
		{
sl@0
   535
/**
sl@0
   536
@SYMTestCaseID		GRAPHICS-WSERV-0202-0001
sl@0
   537
sl@0
   538
@SYMDEF             DEF081259
sl@0
   539
sl@0
   540
@SYMTestCaseDesc    Test drawing in a backed up window
sl@0
   541
sl@0
   542
@SYMTestPriority    High
sl@0
   543
sl@0
   544
@SYMTestStatus      Implemented
sl@0
   545
sl@0
   546
@SYMTestActions     Draw in a backed up window and a normal window and check
sl@0
   547
					the two drawings are the same
sl@0
   548
sl@0
   549
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   550
*/
sl@0
   551
		case 0:
sl@0
   552
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0202-0001"));
sl@0
   553
			iTest->LogSubTest(KTest0);
sl@0
   554
			Draw(1,NULL);
sl@0
   555
			CheckWindow();
sl@0
   556
			break;
sl@0
   557
/**
sl@0
   558
@SYMTestCaseID		GRAPHICS-WSERV-0202-0002
sl@0
   559
sl@0
   560
@SYMDEF             DEF081259
sl@0
   561
sl@0
   562
@SYMTestCaseDesc    Test drawing in a backed up window
sl@0
   563
sl@0
   564
@SYMTestPriority    High
sl@0
   565
sl@0
   566
@SYMTestStatus      Implemented
sl@0
   567
sl@0
   568
@SYMTestActions     Draw in a backed up window and a normal window and check
sl@0
   569
					the two drawings are the same
sl@0
   570
sl@0
   571
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   572
*/
sl@0
   573
		case 1:
sl@0
   574
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0202-0002"));
sl@0
   575
			iTest->LogSubTest(KTest1);
sl@0
   576
			Draw(0,&rgb1);
sl@0
   577
			Draw(3,NULL);
sl@0
   578
			Resize();
sl@0
   579
			CheckWindow();
sl@0
   580
			break;
sl@0
   581
/**
sl@0
   582
@SYMTestCaseID		GRAPHICS-WSERV-0203
sl@0
   583
sl@0
   584
@SYMDEF             DEF081259
sl@0
   585
sl@0
   586
@SYMTestCaseDesc    Test making a backed up window invisible
sl@0
   587
sl@0
   588
@SYMTestPriority    High
sl@0
   589
sl@0
   590
@SYMTestStatus      Implemented
sl@0
   591
sl@0
   592
@SYMTestActions     Draw in a backed up window and a normal window, make
sl@0
   593
					the backed up window invisible then visible and
sl@0
   594
					then check the two drawings are the same
sl@0
   595
sl@0
   596
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   597
*/
sl@0
   598
		case 2:
sl@0
   599
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0203"));
sl@0
   600
			iTest->LogSubTest(KTest2);
sl@0
   601
			Draw(0,&rgb2);
sl@0
   602
			Draw(1,NULL);
sl@0
   603
			InvisVis();
sl@0
   604
			CheckWindow();
sl@0
   605
			break;
sl@0
   606
/**
sl@0
   607
@SYMTestCaseID		GRAPHICS-WSERV-0204
sl@0
   608
sl@0
   609
@SYMDEF             DEF081259
sl@0
   610
sl@0
   611
@SYMTestCaseDesc    Test drawing in a backed up window and then placing a
sl@0
   612
					window on top of it
sl@0
   613
sl@0
   614
@SYMTestPriority    High
sl@0
   615
sl@0
   616
@SYMTestStatus      Implemented
sl@0
   617
sl@0
   618
@SYMTestActions     Draw in a backed up window and a normal window, then
sl@0
   619
					place a window on top of the backed up window and then
sl@0
   620
					check the two drawings are the same
sl@0
   621
sl@0
   622
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   623
*/
sl@0
   624
		case 3:
sl@0
   625
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0204"));
sl@0
   626
			iTest->LogSubTest(KTest3);
sl@0
   627
			//TRgb rgb(220,220,220);
sl@0
   628
			Draw(0,&rgb3);
sl@0
   629
			Draw(1,NULL);
sl@0
   630
			WindowOnTop();
sl@0
   631
			CheckWindow();
sl@0
   632
			break;
sl@0
   633
/**
sl@0
   634
@SYMTestCaseID		GRAPHICS-WSERV-0205
sl@0
   635
sl@0
   636
@SYMDEF             DEF081259
sl@0
   637
sl@0
   638
@SYMTestCaseDesc    Test drawing in a backed up window and then drawing in
sl@0
   639
					a child window
sl@0
   640
sl@0
   641
@SYMTestPriority    High
sl@0
   642
sl@0
   643
@SYMTestStatus      Implemented
sl@0
   644
sl@0
   645
@SYMTestActions     Draw in a backed up window and a normal window, then
sl@0
   646
					create and draw in a child window and then
sl@0
   647
					check the two original drawings are the same
sl@0
   648
sl@0
   649
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   650
*/
sl@0
   651
		case 4:
sl@0
   652
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0205"));
sl@0
   653
			iTest->LogSubTest(KTest4);
sl@0
   654
			Draw(0,&rgb4);
sl@0
   655
			Draw(3,NULL);
sl@0
   656
			ChildWindows();
sl@0
   657
			CheckWindow();
sl@0
   658
			break;
sl@0
   659
/**
sl@0
   660
@SYMTestCaseID		GRAPHICS-WSERV-0206
sl@0
   661
sl@0
   662
@SYMDEF             DEF081259
sl@0
   663
sl@0
   664
@SYMTestCaseDesc    Out of memeory test for backed up windows
sl@0
   665
sl@0
   666
@SYMTestPriority    High
sl@0
   667
sl@0
   668
@SYMTestStatus      Implemented
sl@0
   669
sl@0
   670
@SYMTestActions     Out of memeory test for backed up windows
sl@0
   671
sl@0
   672
@SYMTestExpectedResults Backed up window responds correctly when out
sl@0
   673
						of memory
sl@0
   674
*/
sl@0
   675
		case 5:
sl@0
   676
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0206"));
sl@0
   677
			iTest->LogSubTest(KTest5);
sl@0
   678
			if (!iTest->IsFullRomL())
sl@0
   679
				{
sl@0
   680
				Draw(0,&rgb5);
sl@0
   681
				Draw(3,NULL);
sl@0
   682
				OOML();
sl@0
   683
				CheckWindow();
sl@0
   684
				}
sl@0
   685
			break;
sl@0
   686
/**
sl@0
   687
@SYMTestCaseID		GRAPHICS-WSERV-0207
sl@0
   688
sl@0
   689
@SYMDEF             DEF081259
sl@0
   690
sl@0
   691
@SYMTestCaseDesc    Test updating a bitmap in a backed up window
sl@0
   692
sl@0
   693
@SYMTestPriority    High
sl@0
   694
sl@0
   695
@SYMTestStatus      Implemented
sl@0
   696
sl@0
   697
@SYMTestActions     Update a bitmap in a backed up window and a normal window
sl@0
   698
					and check the two bitmaps are the same
sl@0
   699
sl@0
   700
@SYMTestExpectedResults The two bitmaps are exactly the same
sl@0
   701
*/
sl@0
   702
		case 6:
sl@0
   703
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0207"));
sl@0
   704
			iTest->LogSubTest(KTest6);
sl@0
   705
			Draw(0,&rgb6);
sl@0
   706
			Draw(1,NULL);
sl@0
   707
			UpdateBitmapTestL();
sl@0
   708
			break;
sl@0
   709
/**
sl@0
   710
@SYMTestCaseID		GRAPHICS-WSERV-0208
sl@0
   711
sl@0
   712
@SYMDEF             DEF081259
sl@0
   713
sl@0
   714
@SYMTestCaseDesc    Test updating a duplicate bitmap in a backed up window
sl@0
   715
sl@0
   716
@SYMTestPriority    High
sl@0
   717
sl@0
   718
@SYMTestStatus      Implemented
sl@0
   719
sl@0
   720
@SYMTestActions     Update a duplicated bitmap in a backed up window and a normal window
sl@0
   721
					and check the two bitmaps are the same
sl@0
   722
sl@0
   723
@SYMTestExpectedResults The two bitmaps are exactly the same
sl@0
   724
*/
sl@0
   725
		case 7:
sl@0
   726
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0208"));
sl@0
   727
			if (iSupState==0)		//Will fail unless the window is fully backup.
sl@0
   728
				break;
sl@0
   729
			iTest->LogSubTest(KTest7);
sl@0
   730
			Draw(0,&rgb7);
sl@0
   731
			Draw(1,NULL);
sl@0
   732
			DupBitmapTestL();
sl@0
   733
			break;
sl@0
   734
/**
sl@0
   735
@SYMTestCaseID		GRAPHICS-WSERV-0209
sl@0
   736
sl@0
   737
@SYMDEF             DEF081259
sl@0
   738
sl@0
   739
@SYMTestCaseDesc    Test drawing with two graphic contexts in a backed up window
sl@0
   740
sl@0
   741
@SYMTestPriority    High
sl@0
   742
sl@0
   743
@SYMTestStatus      Implemented
sl@0
   744
sl@0
   745
@SYMTestActions     Draw using two graphic contexts in a backed up window and a normal
sl@0
   746
					window and check the two drawings are the same
sl@0
   747
sl@0
   748
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   749
*/
sl@0
   750
		case 8:
sl@0
   751
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0209"));
sl@0
   752
			iTest->LogSubTest(KTest8);
sl@0
   753
			Draw(0,&color);
sl@0
   754
			Draw(1,NULL);
sl@0
   755
			DrawWithTwoGcsL();
sl@0
   756
			CheckWindow();
sl@0
   757
			break;
sl@0
   758
			
sl@0
   759
/**
sl@0
   760
@SYMTestCaseID		GRAPHICS-WSERV-0210
sl@0
   761
sl@0
   762
@SYMDEF             DEF081259
sl@0
   763
sl@0
   764
@SYMTestCaseDesc    Test drawing using all the graphic functions in a backed up window
sl@0
   765
sl@0
   766
@SYMTestPriority    High
sl@0
   767
sl@0
   768
@SYMTestStatus      Implemented
sl@0
   769
sl@0
   770
@SYMTestActions     Draw using all the graphic functions in a backed up window and a normal
sl@0
   771
					window and check the two drawings are the same
sl@0
   772
sl@0
   773
@SYMTestExpectedResults The two drawings are exactly the same
sl@0
   774
*/
sl@0
   775
		case 9:
sl@0
   776
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0210"));
sl@0
   777
			iTest->LogSubTest(KTest9);
sl@0
   778
			if(TheClient->iScreen->SizeInPixels() == TSize(640,240))
sl@0
   779
				AllGraphicFunctionsTestsL();
sl@0
   780
			break;
sl@0
   781
sl@0
   782
		//A Coverage test, nothing spectacular just making the code
sl@0
   783
		//go into CWsGc::Reactivate
sl@0
   784
		case 10:
sl@0
   785
			{
sl@0
   786
/**
sl@0
   787
@SYMTestCaseID		GRAPHICS-WSERV-0502
sl@0
   788
*/
sl@0
   789
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0502"));
sl@0
   790
			iTest->LogSubTest(KTest10);
sl@0
   791
			TheGc->Deactivate();
sl@0
   792
			RBackedUpWindow extentWindow;
sl@0
   793
			extentWindow=RBackedUpWindow(TheClient->iWs);
sl@0
   794
			extentWindow.Construct(*(TheClient->iGroup->GroupWin()),EGray4,ENullWsHandle);
sl@0
   795
			TheGc->Activate(extentWindow);
sl@0
   796
			TheClient->Flush();
sl@0
   797
			User::LeaveIfError(extentWindow.SetExtentErr(TPoint(2,2), TSize(4,4)));
sl@0
   798
			extentWindow.Activate();
sl@0
   799
			extentWindow.Close();
sl@0
   800
			TheGc->Deactivate();
sl@0
   801
			break;
sl@0
   802
			}
sl@0
   803
sl@0
   804
		//Coverage for various messages for CWsGc::DoDrawCommand
sl@0
   805
		case 11:
sl@0
   806
			{
sl@0
   807
/**
sl@0
   808
@SYMTestCaseID		GRAPHICS-WSERV-0507
sl@0
   809
*/
sl@0
   810
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0507"));
sl@0
   811
			iTest->LogSubTest(KTest11);
sl@0
   812
			TheGc->Activate(iBackedUpWindow);
sl@0
   813
			TheGc->Reset();
sl@0
   814
			iBitGc->Reset();
sl@0
   815
			iBitGc->SetUserDisplayMode(EGray4);
sl@0
   816
			
sl@0
   817
			// EWsGcOpDrawWsGraphic
sl@0
   818
			TheGc->DrawWsGraphic(TWsGraphicId(0), TRect(0,0,10,10)); 
sl@0
   819
			
sl@0
   820
			//create a large junk buffer so that messages with Ptr suffix will be sent
sl@0
   821
			RBuf8 junkBuf8;
sl@0
   822
			RBuf  junkBuf;
sl@0
   823
			junkBuf8.CreateMax(650); // a large enough buffer to sent as Ptr (this value used to crash the code before)
sl@0
   824
			junkBuf.CreateMax(650); // a large enough buffer to sent as Ptr
sl@0
   825
			for (int i=0; i<junkBuf.MaxLength()-1;i++)
sl@0
   826
				{
sl@0
   827
				junkBuf8[i] = 'A';
sl@0
   828
				junkBuf[i] = 'A';
sl@0
   829
				}
sl@0
   830
			junkBuf8[junkBuf8.MaxLength()-1] = '\0';
sl@0
   831
			junkBuf[junkBuf.MaxLength()-1] = '\0';
sl@0
   832
			
sl@0
   833
			// EWsGcOpDrawWsGraphicPtr
sl@0
   834
			TheGc->DrawWsGraphic(TWsGraphicId(0), TRect(0,0,10,10), junkBuf8);
sl@0
   835
			
sl@0
   836
			// Set font for drawing on screen
sl@0
   837
			CFbsFont *font1;
sl@0
   838
			TFontSpec fspec(KTestFontTypefaceName,200);
sl@0
   839
			User::LeaveIfError(TheClient->iScreen->GetNearestFontToDesignHeightInTwips((CFont *&)font1,fspec));
sl@0
   840
			TheGc->UseFont(font1);
sl@0
   841
			iBitGc->UseFont(font1);
sl@0
   842
						
sl@0
   843
			// EWsGcOpDrawTextPtr
sl@0
   844
			TheGc->DrawText(junkBuf, TPoint(0,0));
sl@0
   845
			iBitGc->DrawText(junkBuf, TPoint(0,0));
sl@0
   846
			
sl@0
   847
			// EWsGcOpDrawBoxText - unreachable 299-too lo, 300-too hi
sl@0
   848
sl@0
   849
			// EWsGcOpDrawBoxTextPtr
sl@0
   850
			TheGc->DrawText(junkBuf, TRect(0,0,10,10), 0, CGraphicsContext::ELeft, 0); 
sl@0
   851
			iBitGc->DrawText(junkBuf, TRect(0,0,10,10), 0, CGraphicsContext::ELeft, 0); 
sl@0
   852
			
sl@0
   853
			// EWsGcOpDrawTextVerticalPtr
sl@0
   854
			TheGc->DrawTextVertical(junkBuf, TPoint(0,0), ETrue);
sl@0
   855
			iBitGc->DrawTextVertical(junkBuf, TPoint(0,0), ETrue);
sl@0
   856
			
sl@0
   857
			// EWsGcOpDrawBoxTextVerticalPtr
sl@0
   858
			TheGc->DrawTextVertical(junkBuf, TRect(0,0,10,10), 0, ETrue, CGraphicsContext::ELeft, 0);
sl@0
   859
			iBitGc->DrawTextVertical(junkBuf, TRect(0,0,10,10), 0, ETrue, CGraphicsContext::ELeft, 0);
sl@0
   860
			
sl@0
   861
			// EWsGcOpMoveBy
sl@0
   862
			TheGc->MoveBy(TPoint(2,2));
sl@0
   863
			iBitGc->MoveBy(TPoint(2,2));
sl@0
   864
			
sl@0
   865
			// a bitmap for bitblt ops
sl@0
   866
			CWsBitmap bmp(TheClient->iWs);
sl@0
   867
			bmp.Create(TSize(16,16), iBackedUpWindow.DisplayMode());
sl@0
   868
			
sl@0
   869
			// EWsGcOpGdiWsBlt2
sl@0
   870
			TheGc->BitBlt(TPoint(0,0), &bmp);
sl@0
   871
			iBitGc->BitBlt(TPoint(0,0), &bmp);
sl@0
   872
			
sl@0
   873
			// EWsGcOpGdiWsBlt3
sl@0
   874
			TheGc->BitBlt(TPoint(0,0), &bmp, TRect(0,0,10,10));
sl@0
   875
			iBitGc->BitBlt(TPoint(0,0), &bmp, TRect(0,0,10,10));
sl@0
   876
			
sl@0
   877
			// EWsGcOpGdiWsBltMasked
sl@0
   878
			TheGc->BitBltMasked(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, EFalse);
sl@0
   879
			iBitGc->BitBltMasked(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, EFalse);
sl@0
   880
			
sl@0
   881
			// EWsGcOpGdiWsAlphaBlendBitmaps
sl@0
   882
			TheGc->AlphaBlendBitmaps(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, TPoint(1,1));
sl@0
   883
			iBitGc->AlphaBlendBitmaps(TPoint(0,0), &bmp, TRect(0,0,10,10), &bmp, TPoint(1,1));
sl@0
   884
			
sl@0
   885
			// EWsGcOpWsDrawBitmapMasked
sl@0
   886
			TheGc->DrawBitmapMasked(TRect(0,0,10,10), &bmp, TRect(0,0,8,8), &bmp, ETrue);
sl@0
   887
			iBitGc->DrawBitmapMasked(TRect(0,0,10,10), &bmp, TRect(0,0,8,8), &bmp, ETrue);
sl@0
   888
			
sl@0
   889
			// EWsGcOpDrawBitmap 
sl@0
   890
			TheGc->DrawBitmap(TPoint(0,0), &bmp);
sl@0
   891
			iBitGc->DrawBitmap(TPoint(0,0), &bmp);
sl@0
   892
			
sl@0
   893
			// EWsGcOpDrawBitmapMasked 
sl@0
   894
			TheGc->DrawBitmapMasked(TRect(0,0,10,10), static_cast<const CFbsBitmap*>(&bmp), 
sl@0
   895
					                TRect(0,0,8,8), static_cast<const CFbsBitmap*>(&bmp), 
sl@0
   896
					                EFalse);
sl@0
   897
			iBitGc->DrawBitmapMasked(TRect(0,0,10,10), static_cast<const CFbsBitmap*>(&bmp), 
sl@0
   898
	                				TRect(0,0,8,8), static_cast<const CFbsBitmap*>(&bmp), 
sl@0
   899
	                				EFalse);
sl@0
   900
			
sl@0
   901
			// EWsGcOpDrawPolyLineContinued
sl@0
   902
			TheGc->DrawPolyLine(reinterpret_cast<const TPoint*>(junkBuf8.Ptr()),
sl@0
   903
    				            TInt(junkBuf8.Size()/sizeof(TPoint)));
sl@0
   904
			iBitGc->DrawPolyLine(reinterpret_cast<const TPoint*>(junkBuf8.Ptr()),
sl@0
   905
		            			TInt(junkBuf8.Size()/sizeof(TPoint)));
sl@0
   906
			
sl@0
   907
			// EWsGcOpCopyRect
sl@0
   908
			TheGc->CopyRect(TPoint(0,0), TRect(0,0,10,10));
sl@0
   909
			iBitGc->CopyRect(TPoint(0,0), TRect(0,0,10,10));
sl@0
   910
			
sl@0
   911
			//cleanup
sl@0
   912
			TheClient->Flush();
sl@0
   913
			TheGc->DiscardFont();
sl@0
   914
			iBitGc->DiscardFont();
sl@0
   915
			TheClient->iScreen->ReleaseFont(font1);
sl@0
   916
			junkBuf.Close();
sl@0
   917
			junkBuf8.Close();
sl@0
   918
			TheGc->Deactivate();
sl@0
   919
		
sl@0
   920
			CheckWindow();
sl@0
   921
			
sl@0
   922
			//the following have no client equivalent methods
sl@0
   923
			// EWsGcOpMapColorsLocal
sl@0
   924
			// EWsGcOpDrawPolyLineLocalBufLen
sl@0
   925
			// EWsGcOpDrawPolyLineLocal
sl@0
   926
			// EWsGcOpDrawPolygonLocalBufLen
sl@0
   927
			// EWsGcOpDrawPolygonLocal
sl@0
   928
			// EWsGcOpDrawBitmapLocal
sl@0
   929
			// EWsGcOpDrawBitmap2Local
sl@0
   930
			// EWsGcOpDrawBitmap3Local
sl@0
   931
			// EWsGcOpDrawBitmapMaskedLocal
sl@0
   932
			// EWsGcOpDrawTextPtr1
sl@0
   933
			// EWsGcOpDrawBoxTextPtr1
sl@0
   934
			// EWsGcOpDrawTextVerticalPtr1
sl@0
   935
			// EWsGcOpDrawBoxTextVerticalPtr1
sl@0
   936
			// EWsGcOpDrawTextLocal
sl@0
   937
			// EWsGcOpDrawBoxTextLocal
sl@0
   938
			// EWsGcOpGdiBlt2Local
sl@0
   939
			// EWsGcOpGdiBlt3Local
sl@0
   940
			// EWsGcOpGdiBltMaskedLocal
sl@0
   941
			((CTBackedUpWindowStep*)iStep)->CloseTMSGraphicsStep();
sl@0
   942
			break;
sl@0
   943
			}
sl@0
   944
sl@0
   945
		default:
sl@0
   946
			((CTBackedUpWindowStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
sl@0
   947
			((CTBackedUpWindowStep*)iStep)->CloseTMSGraphicsStep();
sl@0
   948
			break;
sl@0
   949
		}
sl@0
   950
       ((CTBackedUpWindowStep*)iStep)->RecordTestResultL();
sl@0
   951
	}
sl@0
   952
sl@0
   953
__WS_CONSTRUCT_STEP__(BackedUpWindow)