First public contribution.
1 // Copyright (c) 1998-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.
14 // Test Fading and UnFading of windows
19 #define __DISPLAY_MODE_64K_COLOR
23 CRedrawWin::CRedrawWin(CTFade *aTest) : CTWin(), iTest(aTest)
26 CRedrawWin::~CRedrawWin()
30 void CRedrawWin::ConstructL(TRect aArea)
33 ConstructExtLD(*TheClient->iGroup,aArea.iTl,aArea.Size());
34 AssignGC(*TheClient->iGc);
40 void CRedrawWin::Draw()
42 iTest->Drawing(iTest->Content(),iGc);
48 CTFade::CTFade(CTestStep* aStep) : CTWsGraphicsBase(aStep)
50 #if defined (__MARM_THUMB__)
56 void CTFade::ConstructL()
58 iDeviceDisplayMode=TheClient->iScreen->DisplayMode();
59 iTestWinSize=StdTestWindowSize();
60 iFadeDrawMode = iDeviceDisplayMode;
61 iTestWinCopy = new (ELeave) CFbsBitmap();
62 iTestWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
63 iCheckWinCopy = new (ELeave) CFbsBitmap();
64 iCheckWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
69 __ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
74 TInt CTFade::Content()
79 void CTFade::CreateBlankWindowL()
81 __ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
82 TSize scrSize(TheClient->iScreen->SizeInPixels());
83 iTestWinSize.SetSize(2*scrSize.iWidth/3-6,scrSize.iHeight-6);
84 iBlankWin=new(ELeave) CTBlankWindow();
85 iWindowRect.SetRect(TPoint(3+scrSize.iWidth/3,3),iTestWinSize);
86 iBlankWin->SetUpL(iWindowRect.iTl,iTestWinSize,TheClient->iGroup,*TheClient->iGc);
87 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
90 void CTFade::DestroyBlankWindow()
92 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
97 void CTFade::CreateBackupWindowL(TBool aMaintainBackup)
99 __ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
100 CTBackedUpWin* backUpWin=new(ELeave) CTBackedUpWin(MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
103 iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
104 backUpWin->ConstructExtLD(*TheClient->iGroup,iWindowRect.iTl,iTestWinSize);
106 backUpWin->BackedUpWin()->MaintainBackup();
107 backUpWin->Activate();
108 TheClient->WaitForRedrawsToFinish(); //Without this bitmaps won't draw into the window
111 void CTFade::CreateRedrawWindowL()
113 __ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
114 iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
115 CRedrawWin* redrawWin=new(ELeave) CRedrawWin(this);
116 redrawWin->ConstructL(iWindowRect);
117 redrawWin->Win()->EnableRedrawStore(EFalse);
120 iWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
123 void CTFade::DestroyDrawableWindow()
125 __ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
131 void CTFade::CreateBitmapsL()
133 iTestWinSize=BaseWin->Size();
134 iBaseRect.SetRect(BaseWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),iTestWinSize);
135 iNormalBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
136 iFadedBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
137 iNormalBitmapDevice=CFbsBitmapDevice::NewL(&iNormalBitmap);
138 iFadedBitmapDevice=CFbsBitmapDevice::NewL(&iFadedBitmap);
139 User::LeaveIfError(iNormalBitmapDevice->CreateContext(iNormalBitGc));
140 User::LeaveIfError(iFadedBitmapDevice->CreateContext(iFadedBitGc));
141 iFadedBitGc->SetFadeMode(ETrue);
142 iBaseWinMode=BaseWin->BaseWin()->DisplayMode();
143 BaseWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
146 void CTFade::DestroyBitmaps()
150 delete iNormalBitmapDevice;
151 delete iFadedBitmapDevice;
152 BaseWin->BaseWin()->SetRequiredDisplayMode(iBaseWinMode);
155 void CTFade::Drawing(TInt aDrawFunc, CBitmapContext *gc)
157 TRgb grey=TRgb::Gray4(2);
182 for (ii=1;ii<37;ii+=7)
190 for (ii=2;ii<60;ii+=11)
199 for (ii=3;ii<70;ii+=13)
210 void CTFade::Draw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade/*=EFalse*/, TBool aFade/*=EFalse*/)
212 CWindowGc *gc=TheClient->iGc;
213 gc->Activate(*iWin->DrawableWin());
217 iNormalBitGc->Reset();
218 iFadedBitGc->Reset();
219 iFadedBitGc->SetFadeMode(ETrue);
220 if (aAlternativeFade)
221 iFadedBitGc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
222 Draw(aDrawFunc,aParam,gc);
223 Draw(aDrawFunc,aParam,iNormalBitGc);
224 Draw(aDrawFunc,aParam,iFadedBitGc);
226 if (aAlternativeFade)
227 iFadedBitGc->SetFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
230 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // CWindowGc fading is deprecated in NGA
231 void CTFade::GCDraw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade)
233 CWindowGc *gc=TheClient->iGc;
234 gc->Activate(*iWin->DrawableWin());
236 Draw(aDrawFunc,aParam,gc);
238 gc->Activate(*BaseWin->DrawableWin());
241 if (aAlternativeFade)
242 gc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
243 Draw(aDrawFunc,aParam,gc);
246 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
248 void CTFade::Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *aGc)
253 aGc->SetBrushColor(*((TRgb *)aParam));
254 aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
255 aGc->SetPenStyle(CGraphicsContext::ENullPen);
256 aGc->DrawRect(TRect(iTestWinSize));
260 TSize half(iTestWinSize.iWidth/2,iTestWinSize.iHeight/2);
262 aGc->DrawEllipse(rect);
263 aGc->DrawEllipse(TRect(TPoint(0,half.iHeight),half));
264 aGc->SetOrigin(TPoint(half.iWidth,0));
265 aGc->SetClippingRect(rect);
266 aGc->DrawEllipse(rect);
267 aGc->SetOrigin(TPoint(half.iWidth,half.iHeight));
268 aGc->SetClippingRect(rect);
269 aGc->DrawEllipse(rect);
270 aGc->SetOrigin(TPoint());
271 aGc->CancelClippingRect();
276 TInt param= *((TInt *)aParam);
278 aGc->DrawLine(TPoint(param+(param*27)%iTestWinSize.iWidth,0),
279 TPoint(iTestWinSize.iWidth-((param<<1)+(param*19)%iTestWinSize.iWidth),iTestWinSize.iHeight));
281 aGc->DrawLine(TPoint(0, (param<<1)+(param*7)%iTestWinSize.iHeight),
282 TPoint(iTestWinSize.iWidth,param+(param*13)%iTestWinSize.iHeight));
288 for(;pos.iX<iTestWinSize.iWidth;pos.iX+=10)
289 aGc->DrawLine(pos,pos+TSize(0,iTestWinSize.iHeight));
290 for(pos.iX=0;pos.iY<iTestWinSize.iHeight;pos.iY+=10)
291 aGc->DrawLine(pos,pos+TSize(iTestWinSize.iWidth,0));
297 void CTFade::CompareWithBitmap(TBool aFade)
300 CWindowGc& gc=*TheClient->iGc;
302 TheClient->iWs.Flush();
304 bitmap=&iFadedBitmap;
306 bitmap=&iNormalBitmap;
307 gc.Activate(*BaseWin->DrawableWin());
309 gc.BitBlt(TPoint(),bitmap);
311 TheClient->iWs.Flush();
312 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
313 match=TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
314 #else // In NGA comparison has to be lossy because fading can be implemented on hardware
315 match=LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, iWindowRect);
320 _LIT(KLog,"Windows content don't match when they should");
325 void CTFade::CompareWindows(TBool aAlternativeFade/*=EFalse*/)
327 if (aAlternativeFade)
328 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
330 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
331 TheClient->iWs.Flush();
332 TBool retVal = TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
335 INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(iBaseRect,iWindowRect) return value - Expected: %d, Actual: %d"), ETrue, retVal);
337 iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
338 TheClient->iWs.Flush();
339 TheClient->WaitForRedrawsToFinish();
342 #define FADE(n,col) n/2+col/2
343 TInt CTFade::Fade4(TInt aGray4)
345 #if defined(__WINS__)
346 return FADE(4,aGray4);
347 #elif defined (__MARM_THUMB__)
348 return (CanFade ? FADE(4,aGray4):aGray4);
349 #elif defined (__MARM__)
350 return FADE(4,aGray4);
356 TInt CTFade::Fade16(TInt aGray16)
358 #if defined(__WINS__)
359 return FADE(16,aGray16);
360 #elif defined (__MARM_THUMB__)
361 return (CanFade ? FADE(16,aGray16):aGray16);
362 #elif defined (__MARM__)
363 return FADE(16,aGray16);
369 TRgb CTFade::FadeRgb(TRgb aColor)
371 switch (iFadeDrawMode)
379 aColor=TRgb::Color64K(aColor.Color64K());
382 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // Color fading calculation differs in NGA
383 TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL+1;
385 TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL;
387 TInt fadeMapOffset=BLACK_NORMAL;
388 TInt value = aColor.Internal();
390 TInt b = (((value & 0x000000ff) * fadeMapFactor) >> 8) + fadeMapOffset;
391 TInt g = (((value & 0x0000ff00) * fadeMapFactor) >> 16) + fadeMapOffset;
392 TInt r = (((value & 0x00ff0000) * fadeMapFactor) >> 24) + fadeMapOffset;
396 TRgb CTFade::FadeRgb(TRgb aColor, TInt aFadeMapFactor, TInt aFadeMapOffset)
398 switch (iFadeDrawMode)
406 aColor=TRgb::Color64K(aColor.Color64K());
409 TInt value = aColor.Internal();
411 TInt b = (((value & 0x000000ff) * aFadeMapFactor) >> 8) + aFadeMapOffset;
412 TInt g = (((value & 0x0000ff00) * aFadeMapFactor) >> 16) + aFadeMapOffset;
413 TInt r = (((value & 0x00ff0000) * aFadeMapFactor) >> 24) + aFadeMapOffset;
417 inline void CTFade::ViewDelay()
419 //This routine can provide a delay which will allow the user to see the colors changing
422 TheClient->iWs.Finish();
423 /*TheClient->iWs.Flush();
424 User::After(1000000);*/ // 1 sec
427 void CTFade::ColorTest()
429 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
431 TSize size(iTestWinSize);
432 #if defined(SMALL_RECTS)
433 size.iWidth=Min(SIZE_X,size.iWidth);
434 size.iHeight=Min(SIZE_Y,size.iHeight);
436 TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
438 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray4);
439 TheClient->WaitForRedrawsToFinish(); //Force the screen into 4 gray mode
441 for (ii=1;ii<4;ii+=2) //0 and 3 now give dithered colors when fading so causing this test to fail
443 iBlankWin->SetColor(TRgb::Gray4(ii));
445 INFO_PRINTF1(_L(" Testing Normal Color"));
446 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
447 retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
449 TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
450 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
454 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
455 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
457 fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
458 #if defined (__MARM_THUMB__)
461 CanFade=!CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
463 fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
466 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
467 retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
469 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
473 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
475 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
477 INFO_PRINTF1(_L(" Testing Unfaded Color"));
478 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
479 retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
481 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
485 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
487 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
489 if (MaxGrays()==0 && MaxColors()<256)
492 INFO_PRINTF1(_L(" Doing 16 Gray Colors"));
493 for (ii=0;ii<16;++ii)
495 iBlankWin->SetColor(TRgb::Gray16(ii));
497 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
498 retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
500 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
504 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
506 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
508 fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
509 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
510 retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
512 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
516 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
518 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
521 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
522 retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
524 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
528 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
532 void CTFade::BlankWindowL()
535 if (MaxGrays()==0 && MaxColors()<256)
538 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
539 CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
540 TRect testArea(iWindowRect);
541 TRect windowRect(testArea);
542 #if defined(SMALL_RECTS)
543 TSize size(testArea.Size());
544 size.iWidth=Min(2*SIZE_X,size.iWidth);
545 size.iHeight=Min(2*SIZE_Y,size.iHeight);
546 testArea.SetHeight(size.iHeight);
547 testArea.iTl.iX=testArea.iBr.iX-size.iWidth;
549 windowRect.Shrink(size.iWidth/4,size.iHeight/4);
551 windowRect.Shrink(30,30);
553 blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
554 for (TInt col=2;col<16;col+=6)
556 iBlankWin->SetColor(TRgb::Gray16(col));
557 TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
558 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
559 blankWin->SetVisible(EFalse);
560 TheClient->iWs.Finish();
561 TRgb fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
562 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
563 retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
565 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
569 INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);
571 blankWin->SetVisible(ETrue);
572 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
573 blankWin->SetVisible(EFalse);
574 TheClient->iWs.Finish();
575 retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
578 INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
580 blankWin->SetVisible(ETrue);
581 iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
582 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
583 blankWin->SetVisible(EFalse);
584 iBlankWin->SetPos(iWindowRect.iTl);
585 fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
586 TheClient->iWs.Finish();
587 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
588 retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
590 retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
594 INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);
596 blankWin->SetVisible(ETrue);
597 iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
598 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
599 blankWin->SetVisible(EFalse);
600 iBlankWin->SetPos(iWindowRect.iTl);
601 TheClient->iWs.Finish();
602 retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
605 INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
607 blankWin->SetVisible(ETrue);
612 void CTFade::TestStrips(TRect aRect,TInt aHeight,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
617 for (ii=0;ii<16;++ii)
619 isFaded=((!aInvert)==(!(ii<aNumNotFaded)));
621 col=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
623 col=TRgb::Gray16(ii);
624 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
625 TBool retVal = CheckBlankWindow(aRect,col,TheClient->iScreen);
627 TBool retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
631 INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
633 aRect.Move(0,aHeight);
637 void CTFade::FadeChildrenL()
639 if (MaxGrays()==0 && MaxColors()<256)
645 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
646 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
647 iBlankWin->SetColor(TRgb::Gray16(0));
648 CTBlankWindow* win[16];
650 TRect rect(iTestWinSize);
651 TInt height=iTestWinSize.iHeight/16;
654 for (ii=1;ii<16;++ii) //Causes memory leakage under OOM
656 win[ii]=new(ELeave) CTBlankWindow();
657 win[ii]->SetUpL(rect.iTl,rect.Size(),win[ii-1],*TheClient->iGc);
658 win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
659 win[ii]->SetColor(TRgb::Gray16(ii));
663 rect.SetHeight(height);
664 #if defined(SMALL_RECTS)
665 TSize size(rect.Size());
666 size.iWidth=Min(SIZE_X,size.iWidth);
667 size.iHeight=Min(SIZE_Y,size.iHeight);
670 for (ii=0;ii<15;++ii)
672 win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
673 retVal = win[ii]->BaseWin()->IsFaded();
676 INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
678 TestStrips(rect,height,ii);
679 win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
680 retBool = !win[ii]->BaseWin()->IsFaded();
683 INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
685 TestStrips(rect,height,16);
687 TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
688 TestStrips(rect,height,0);
689 TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
690 TestStrips(rect,height,16);
691 for (ii=0;ii<16;++ii)
693 win[ii]->BaseWin()->FadeBehind(ETrue);
694 retBool = !win[ii]->BaseWin()->IsFaded();
697 INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
699 retVal = win[0]->BaseWin()->IsFaded();
700 TEST(retVal==(ii>0));
702 INFO_PRINTF3(_L("win[0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0), retVal);
704 TestStrips(rect,height,ii,ETrue);
705 win[ii]->BaseWin()->FadeBehind(EFalse);
706 TestStrips(rect,height,16);
708 iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
709 TestStrips(rect,height,0);
710 iBlankWin->WinTreeNode()->SetNonFading(ETrue);
711 TestStrips(rect,height,16);
712 win[8]->WinTreeNode()->SetNonFading(EFalse);
713 TestStrips(rect,height,8);
714 iBlankWin->WinTreeNode()->SetNonFading(EFalse);
715 TestStrips(rect,height,0);
716 iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
717 TestStrips(rect,height,16);
718 win[8]->WinTreeNode()->SetNonFading(ETrue);
719 TestStrips(rect,height,16);
720 iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
721 TestStrips(rect,height,8,ETrue);
722 win[8]->WinTreeNode()->SetNonFading(EFalse);
723 TestStrips(rect,height,0);
724 iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
725 TestStrips(rect,height,16);
726 for (ii=15;ii>0;--ii)
730 static void ResetAndDestroyWindows(TAny* aPtr)
732 RPointerArray<CTBlankWindow>& win = *(static_cast<RPointerArray<CTBlankWindow>*>(aPtr));
734 win.ResetAndDestroy();
738 void CTFade::FadeChildrenAfterNewChildIsCreatedL()
740 if (MaxGrays()==0 && MaxColors()<256)
746 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
747 iBlankWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
748 iBlankWin->SetColor(TRgb::Gray16(0));
749 RPointerArray<CTBlankWindow> win;
750 CleanupStack::PushL(TCleanupItem(ResetAndDestroyWindows, &win));
751 TInt height=iTestWinSize.iHeight/NUMBER_OF_WINDOWS;
752 CTBlankWindow* window=NULL;
754 for (TInt firstLoop=0;firstLoop<NUMBER_OF_WINDOWS-1;)
756 win.ResetAndDestroy();
757 TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
758 TRect rect(iTestWinSize);
760 CTBlankWindow* parent=iBlankWin;
761 for (TInt secondLoop=0;secondLoop<=firstLoop;)
763 window=new(ELeave) CTBlankWindow();
764 CleanupStack::PushL(window);
765 User::LeaveIfError(win.Append(window));
766 CleanupStack::Pop(window);
767 window->SetUpL(rect.iTl,rect.Size(),parent,*TheClient->iGc);
768 window->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
769 window->SetColor(TRgb::Gray16(++secondLoop));
772 retBool = window->BaseWin()->IsFaded();
775 INFO_PRINTF3(_L("window->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
779 TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
780 const TInt count=win.Count();
781 for(TInt index=0;index<count;++index)
783 retBool = win[index]->BaseWin()->IsFaded();
786 INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), EFalse, retBool);
790 User::LeaveIfError(win.Insert(iBlankWin,0));
791 TRect testRect=iWindowRect;
792 testRect.SetHeight(height);
793 #if defined(SMALL_RECTS)
794 TSize size(testRect.Size());
795 size.iWidth=Min(SIZE_X,size.iWidth);
796 size.iHeight=Min(SIZE_Y,size.iHeight);
797 testRect.SetSize(size);
799 for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
801 win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
802 retVal = win[ii]->BaseWin()->IsFaded();
805 INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), 1, retVal);
807 TestStrips(testRect,height,ii);
808 win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
809 retBool = !win[ii]->BaseWin()->IsFaded();
812 INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);
814 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
816 TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
817 TestStrips(testRect,height,0);
818 TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
819 TestStrips(testRect,height,16);
820 for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
822 win[ii]->BaseWin()->FadeBehind(ETrue);
823 retBool = !win[ii]->BaseWin()->IsFaded();
826 INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);
828 retVal = win[0]->BaseWin()->IsFaded();
829 TEST(retVal==(ii>0));
831 INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), (ii>0), retVal);
833 TestStrips(testRect,height,ii,ETrue);
834 win[ii]->BaseWin()->FadeBehind(EFalse);
835 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
837 iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
838 TestStrips(testRect,height,0);
839 iBlankWin->WinTreeNode()->SetNonFading(ETrue);
840 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
841 win[8]->WinTreeNode()->SetNonFading(EFalse);
842 TestStrips(testRect,height,NUMBER_OF_WINDOWS/2);
843 iBlankWin->WinTreeNode()->SetNonFading(EFalse);
844 TestStrips(testRect,height,0);
845 iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
846 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
847 win[8]->WinTreeNode()->SetNonFading(ETrue);
848 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
849 iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
850 TestStrips(testRect,height,NUMBER_OF_WINDOWS/2,ETrue);
851 win[8]->WinTreeNode()->SetNonFading(EFalse);
852 TestStrips(testRect,height,0);
853 iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
854 TestStrips(testRect,height,NUMBER_OF_WINDOWS);
856 CleanupStack::PopAndDestroy(&win);
859 void CTFade::TestBlocks(TRect aRect,TSize aSize,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
868 if ((!aInvert)!=(!(count<aNumNotFaded)))
869 col=TRgb::Gray16(count);
872 col = TRgb::Gray16(count);
873 col = MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(count)):FadeRgb(col);
875 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
876 TBool retBool = CheckBlankWindow(aRect,col,TheClient->iScreen);
878 TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
882 INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), EFalse, retBool);
884 aRect.Move(0,aSize.iHeight);
887 aRect.Move(aSize.iWidth,-jj*aSize.iHeight);
891 void CTFade::FadeBehindL()
893 if (MaxGrays()==0 && MaxColors()<256)
899 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
900 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
901 iBlankWin->SetColor(TRgb::Gray16(0));
902 CTBlankWindow* win[4][4];
904 TSize size=iTestWinSize;
905 TInt height=iTestWinSize.iHeight/4;
906 TInt width=iTestWinSize.iWidth/4;
907 TRect rect(iWindowRect.iTl,TSize(width,height));
908 TSize rectSize(rect.Size());
909 TPoint offset(0,height);
913 #if defined(SMALL_RECTS)
914 TSize rSize(rectSize);
915 rSize.iWidth=Min(SIZE_X,rSize.iWidth);
916 rSize.iHeight=Min(SIZE_Y,rSize.iHeight);
919 for (ii=0;ii<4;++ii) //Causes memory leakage under OOM
921 parent=TheClient->iGroup;
922 topLeft=iWindowRect.iTl+TPoint(ii*width,0);
923 size.iHeight=iTestWinSize.iHeight;
928 win[ii][jj]=new(ELeave) CTBlankWindow();
929 win[ii][jj]->SetUpL(topLeft,size,parent,*TheClient->iGc);
930 win[ii][jj]->BaseWin()->SetRequiredDisplayMode(EGray16);
931 win[ii][jj]->SetColor(TRgb::Gray16(4*ii+jj));
933 size.iHeight-=height;
943 win[ii][jj]->BaseWin()->FadeBehind(ETrue);
944 retVal = win[0][0]->BaseWin()->IsFaded();
945 TEST(retVal==(ii>0||jj>0));
946 if (retVal!=(ii>0||jj>0))
947 INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0||jj>0), retVal);
949 retBool = !win[ii][jj]->BaseWin()->IsFaded();
952 INFO_PRINTF3(_L("!win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
954 TestBlocks(rect,rectSize,4*ii+jj,ETrue);
955 win[ii][jj]->BaseWin()->FadeBehind(EFalse);
956 TestBlocks(rect,rectSize,16);
963 win[ii][jj]->BaseWin()->FadeBehind(ETrue);
964 TestBlocks(rect,rectSize,4*ii+jj,ETrue);
966 retVal = win[ii][0]->BaseWin()->IsFaded();
969 INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);
971 for (ii=3;ii>=0;--ii)
973 retVal = win[ii][0]->BaseWin()->IsFaded();
976 INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);
978 for (jj=3;jj>=0;--jj)
980 TestBlocks(rect,rectSize,4*ii+jj,ETrue);
981 win[ii][jj]->BaseWin()->FadeBehind(EFalse);
984 TestBlocks(rect,rectSize,0,ETrue);
989 win[ii][jj]->BaseWin()->FadeBehind(ETrue);
997 fadeCount=15-(4*ii+jj);
998 retVal = win[0][0]->BaseWin()->IsFaded();
999 TEST(retVal==Min(15,fadeCount+1));
1000 if (retVal!=Min(15,fadeCount+1))
1001 INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Min(15,fadeCount+1), retVal);
1003 retVal = win[ii][jj]->BaseWin()->IsFaded();
1004 TEST(retVal==Max(0,fadeCount));
1005 if (retVal!=Max(0,fadeCount))
1006 INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);
1008 TestBlocks(rect,rectSize,15,ETrue);
1009 win[ii][jj]->BaseWin()->FadeBehind(EFalse);
1010 retVal = win[ii][jj]->BaseWin()->IsFaded();
1011 TEST(retVal==Max(0,fadeCount));
1012 if (retVal!=Max(0,fadeCount))
1013 INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);
1017 TestBlocks(rect,rectSize,0,ETrue);
1020 win[3][3]->BaseWin()->FadeBehind(ETrue); //All faded as the only unfaded one is white
1021 for (ii=3;ii>=0;--ii)
1023 retVal = win[ii][0]->BaseWin()->IsFaded();
1026 INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
1028 retBool = !win[ii][1]->BaseWin()->IsNonFading();
1031 INFO_PRINTF3(_L("!win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1033 win[ii][0]->WinTreeNode()->SetNonFading(ETrue);
1034 retBool = win[ii][1]->BaseWin()->IsNonFading();
1037 INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1039 TestBlocks(rect,rectSize,4*ii,ETrue);
1041 for (ii=3;ii>=0;--ii)
1043 retVal = win[ii][0]->BaseWin()->IsFaded();
1046 INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
1048 retBool = win[ii][1]->BaseWin()->IsNonFading();
1051 INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1053 win[ii][0]->WinTreeNode()->SetNonFading(EFalse);
1054 retBool = !win[ii][1]->BaseWin()->IsNonFading();
1057 INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1059 TestBlocks(rect,rectSize,4*ii);
1061 win[3][3]->BaseWin()->FadeBehind(EFalse);
1063 for (ii=3;ii>=0;--ii)
1065 for (jj=3;jj>=0;--jj)
1073 void CTFade::ColorTest2()
1075 #if defined(__MARM__)
1078 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
1079 TSize size=iTestWinSize;
1080 #if defined(SMALL_RECTS)
1081 size.iWidth=Min(SIZE_X,size.iWidth);
1082 size.iHeight=Min(SIZE_Y,size.iHeight);
1084 if (MaxGrays()==0 && MaxColors()<256)
1086 TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
1093 TInt fadeMapFactor = 0;
1094 TInt fadeMapOffset = 0;
1102 case 1: //Shadowing or Quartz fading
1105 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1106 TheClient->iWs.SetDefaultFadingParameters(0,127);
1107 fadeMapFactor = 128;
1109 TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),127);
1110 fadeMapFactor = 127-STATIC_CAST(TUint8,bm*17);
1114 TheClient->iWs.SetDefaultFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
1119 fadeMapOffset = STATIC_CAST(TUint8,bm*17);
1120 fadeMapFactor = STATIC_CAST(TUint8,wm*17) - fadeMapOffset;
1121 TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),STATIC_CAST(TUint8,wm*17));
1124 for (ii=0;ii<16;ii+=5)
1126 iBlankWin->SetColor(TRgb::Gray16(ii));
1128 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1129 TBool retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1131 TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1136 _LIT(KLog,"Setting color on blank window failed mappings=%d color=%d");
1137 LOG_MESSAGE3(KLog,test,ii);
1139 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1142 TRgb col1 = FadeRgb(TRgb::Gray16(ii), fadeMapFactor, fadeMapOffset);
1143 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1144 retBool=CheckBlankWindow(windowRect,col1,TheClient->iScreen);
1146 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
1151 _LIT(KLog,"Fading the window gave wrong color mappings=%d color=%d");
1152 LOG_MESSAGE3(KLog,test,ii);
1154 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
1156 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1157 retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1159 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1164 _LIT(KLog,"Unfading the window gave wrong color mappings=%d color=%d");
1165 LOG_MESSAGE3(KLog,test,ii);
1173 void CTFade::FadeTest()
1175 #if defined(__MARM__)
1178 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
1179 TSize size=iTestWinSize;
1180 #if defined(SMALL_RECTS)
1181 size.iWidth=Min(SIZE_X,size.iWidth);
1182 size.iHeight=Min(SIZE_Y,size.iHeight);
1184 if (MaxGrays()==0 && MaxColors()<256)
1186 TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
1195 TInt fadeMapFactor = 0;
1196 TInt fadeMapOffset = 0;
1204 case 1: //Shadowing or Quartz fading
1213 fb=STATIC_CAST(TUint8,17*bm);
1215 fw=STATIC_CAST(TUint8,17*wm);
1216 fadeMapFactor = fw - fb;
1218 for (ii=0;ii<16;ii+=5)
1220 iBlankWin->SetColor(TRgb::Gray16(ii));
1222 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1223 TBool retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1225 TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1229 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1231 TRgb col3 = TRgb::Gray16(ii).Internal();
1232 TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
1233 iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,fb,fw);
1235 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1236 retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
1238 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
1242 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1244 iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
1246 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1247 retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1249 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1253 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1261 void CTFade::Draw(TBool aAlternativeFade/*=EFalse*/)
1263 __ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
1264 TRgb grey=TRgb::Gray4(2);
1265 Draw(0,&grey,aAlternativeFade);
1266 Draw(1,NULL,aAlternativeFade);
1268 CompareWithBitmap(EFalse);
1269 if (aAlternativeFade)
1270 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
1272 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1273 CompareWithBitmap(ETrue);
1274 Draw(3,NULL,aAlternativeFade);
1276 CompareWithBitmap(ETrue);
1277 iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
1278 CompareWithBitmap(EFalse);
1281 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1282 void CTFade::GCDraw()
1284 __ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
1285 TRgb grey=TRgb::Gray4(2);
1289 for (ii=3;ii<70;ii+=13)
1293 GCDraw(0,&grey,ETrue);
1294 GCDraw(3,NULL,ETrue);
1295 for (ii=3;ii<70;ii+=13)
1296 GCDraw(2,&ii,ETrue);
1297 GCDraw(1,NULL,ETrue);
1299 CompareWindows(ETrue);
1301 #endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1303 void CTFade::ObscuredL()
1305 CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
1306 TRect windowRect(iWindowRect);
1307 windowRect.Shrink(30,30);
1308 blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
1310 __ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
1311 TRgb grey=TRgb::Gray4(2);
1315 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1316 blankWin->SetVisible(EFalse);
1317 CompareWithBitmap(ETrue);
1318 blankWin->SetVisible(ETrue);
1319 grey=TRgb::Gray4(1);
1321 for (TInt ii=1;ii<37;ii+=7)
1324 blankWin->SetVisible(EFalse);
1325 CompareWithBitmap(ETrue);
1326 blankWin->SetVisible(ETrue);
1327 iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
1328 blankWin->SetVisible(EFalse);
1329 CompareWithBitmap(EFalse);
1334 void CTFade::MovingL()
1336 CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
1337 TRect windowRect(iWindowRect);
1338 windowRect.Shrink(40,40);
1339 blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
1341 __ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
1342 TRgb grey=TRgb::Gray4(2);
1345 for (TInt ii=2;ii<60;ii+=11)
1348 blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
1349 iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1350 blankWin->SetPos(windowRect.iTl+TPoint(10,25));
1351 blankWin->SetVisible(EFalse);
1352 CompareWithBitmap(ETrue);
1353 blankWin->SetVisible(ETrue);
1354 blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
1355 iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
1356 blankWin->SetPos(windowRect.iTl+TPoint(-5,10));
1357 blankWin->SetVisible(EFalse);
1358 CompareWithBitmap(EFalse);
1363 void CTFade::SystemFadeL()
1365 if (MaxGrays()==0 && MaxColors()<256)
1368 CTBlankWindow* win[16];
1369 TInt height=iTestWinSize.iHeight/16;
1370 TRect rect(iWindowRect);
1371 rect.SetHeight(height);
1373 for (ii=0;ii<16;++ii) //Causes memory leakage under OOM
1375 win[ii]=new(ELeave) CTBlankWindow();
1376 win[ii]->SetUpL(rect.iTl,rect.Size(),TheClient->iGroup,*TheClient->iGc);
1377 win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
1378 win[ii]->SetColor(TRgb::Gray16(ii));
1379 rect.Move(0,height);
1382 rect.SetHeight(height);
1383 #if defined(SMALL_RECTS)
1384 TSize size(rect.Size());
1385 size.iWidth=Min(SIZE_X,size.iWidth);
1386 size.iHeight=Min(SIZE_Y,size.iHeight);
1393 TheClient->iWs.SetSystemFaded(ETrue);
1394 for (ii=0;ii<16;++ii)
1396 retBool = win[ii]->BaseWin()->IsFaded();
1399 INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1401 TestStrips(rect,height,0);
1404 TheClient->iWs.SetSystemFaded(EFalse);
1405 for (ii=0;ii<16;++ii)
1407 retBool = !win[ii]->BaseWin()->IsFaded();
1410 INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1412 TestStrips(rect,height,16);
1414 // Now with half non fading
1415 for (ii=8;ii<16;++ii)
1416 win[ii]->WinTreeNode()->SetNonFading(ETrue);
1419 TheClient->iWs.SetSystemFaded(ETrue);
1420 TestStrips(rect,height,8,ETrue);
1423 TheClient->iWs.SetSystemFaded(EFalse);
1424 TestStrips(rect,height,16);
1426 for (ii=0;ii<16;++ii)
1430 void CTFade::SystemAlternateFadeL()
1432 #if defined(__MARM__)
1435 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
1436 TSize size=iTestWinSize;
1437 #if defined(SMALL_RECTS)
1438 size.iWidth=Min(SIZE_X,size.iWidth);
1439 size.iHeight=Min(SIZE_Y,size.iHeight);
1441 if (MaxGrays()==0 && MaxColors()<256)
1443 TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
1455 TInt fadeMapFactor = 0;
1456 TInt fadeMapOffset = 0;
1464 case 1: //Shadowing or Quartz fading
1474 fb=STATIC_CAST(TUint8,17*bm);
1476 fw=STATIC_CAST(TUint8,17*wm);
1477 fadeMapFactor = fw - fb;
1479 for (ii=0;ii<16;ii+=5)
1481 iBlankWin->SetColor(TRgb::Gray16(ii));
1483 TheClient->iWs.Finish();
1484 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1485 retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1487 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1491 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1493 TheClient->iWs.SetSystemFaded(ETrue,fb,fw);
1496 TRgb col3 = TRgb::Gray16(ii).Internal();
1497 TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
1498 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1499 retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
1501 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
1505 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1507 TheClient->iWs.SetSystemFaded(EFalse);
1509 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1510 retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
1512 retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
1516 INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
1523 void CTFade::FadeBehindWhenMovedL()
1525 __ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
1526 TDisplayMode displayMode=iBlankWin->BaseWin()->DisplayMode();
1527 iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
1528 iBlankWin->SetColor(TRgb::Gray16(1));
1529 TSize size(iTestWinSize.iHeight/4,iTestWinSize.iWidth/4);
1530 CTBlankWindow* blankWinTemp=new(ELeave) CTBlankWindow();
1531 CleanupStack::PushL(blankWinTemp);
1532 blankWinTemp->SetUpL(TPoint(5,5),size,iBlankWin,*TheClient->iGc);
1533 blankWinTemp->BaseWin()->SetRequiredDisplayMode(EGray16);
1534 blankWinTemp->SetColor(TRgb::Gray16(15));
1535 blankWinTemp->BaseWin()->FadeBehind(ETrue);
1537 blankWinTemp->SetPos(TPoint(5,120));
1538 //Check whether the back window is faded or not
1539 TBool retBool = iBlankWin->BaseWin()->IsFaded();
1542 INFO_PRINTF3(_L("iBlankWin->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
1544 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
1545 CheckRect(iWindowRect.iTl+TPoint(5,5),iWindowRect.iTl+TPoint(75,5),size,_L("CTFade::FadeBehindWhenMovedL()"));
1547 TInt res = LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, TRect(iWindowRect.iTl+TPoint(75,5),size));
1551 //Check whether the area behind the moved window and any other area on same window are identical
1552 blankWinTemp->BaseWin()->FadeBehind(EFalse);
1553 iBlankWin->BaseWin()->SetRequiredDisplayMode(displayMode);
1554 CleanupStack::PopAndDestroy(blankWinTemp);
1557 void CTFade::FadeBehindTransparentWindowL()
1559 const TInt KNumberOfWindows = 3;
1560 CRedrawWin* win[KNumberOfWindows];
1561 TRect rect(iWindowRect);
1562 rect.Resize(-iWindowRect.Width()/3,-iWindowRect.Height()/3);
1563 rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/5);
1564 TRect rectWin[KNumberOfWindows];
1566 for (TInt ii=0; ii<KNumberOfWindows; ++ii) //Causes memory leakage under OOM
1569 win[ii]=new(ELeave) CRedrawWin(this);
1570 win[ii]->ConstructExtLD(*TheClient->iGroup,rectWin[ii].iTl,rectWin[ii].Size());
1571 win[ii]->AssignGC(*TheClient->iGc);
1572 win[ii]->Win()->EnableRedrawStore(EFalse);
1573 win[ii]->BaseWin()->SetRequiredDisplayMode(EColor16MA);
1576 win[ii]->Win()->SetBackgroundColor(TRgb(200,0,0,255));
1580 TEST(KErrNone == win[ii]->Win()->SetTransparencyAlphaChannel());
1581 if (iStep->TestStepResult() != EPass)
1583 INFO_PRINTF1(_L("Transparency Alpha channel failed to be enabled"));
1585 win[ii]->Win()->SetBackgroundColor(TRgb(40,100,0,0)); //RGB colour is of minor importance, as the window is fully transparent (Alpha=0)
1587 win[ii]->Activate();
1589 //Make sure each window is drawn to the screen now when the new background
1590 //colour have been set but before the call to SetFaded
1591 win[ii]->Win()->BeginRedraw();
1592 win[ii]->Win()->EndRedraw();
1594 rect.Resize(0,-iWindowRect.Height()/10);
1595 rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/20);
1597 TheClient->iWs.Flush();
1598 TheClient->iWs.Finish();
1600 win[0]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1601 win[1]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1602 win[2]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
1604 TheClient->iWs.Flush();
1605 TheClient->iWs.Finish();
1607 // As the windows ovelap on their left side, compare the top left corners of the faded windows in order to verify that
1608 // for the opaque window the directly on top faded area and the faded area under the transparent window (the area that
1609 // overlaps with the transparent windows) have the same colour.
1610 TRgb rgbWin[KNumberOfWindows];
1611 TheClient->iScreen->GetPixel(rgbWin[0], rectWin[0].iTl);
1612 TheClient->iScreen->GetPixel(rgbWin[1], rectWin[1].iTl);
1613 TheClient->iScreen->GetPixel(rgbWin[2], rectWin[2].iTl);
1615 TEST( ETrue == (rgbWin[0].Red()==rgbWin[1].Red())&&(rgbWin[0].Green()==rgbWin[1].Green())&&(rgbWin[0].Blue()==rgbWin[1].Blue()) );
1616 TEST( ETrue == (rgbWin[0].Red()==rgbWin[2].Red())&&(rgbWin[0].Green()==rgbWin[2].Green())&&(rgbWin[0].Blue()==rgbWin[2].Blue()) );
1618 for (TInt ii=0; ii<KNumberOfWindows; ++ii)
1624 #define BACKUPWIN 11
1625 #define REDRAWWIN 20
1626 void CTFade::RunTestCaseL(TInt /*aCurTestCase*/)
1628 ((CTFadeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
1629 switch(++iTest->iState)
1632 @SYMTestCaseID GRAPHICS-WSERV-0218
1636 @SYMTestCaseDesc Test fading colours in windows
1638 @SYMTestPriority High
1640 @SYMTestStatus Implemented
1642 @SYMTestActions Fade the colours in windows and check they fade correctly
1644 @SYMTestExpectedResults Colour fade correctly
1647 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0218"));
1648 iTest->LogSubTest(_L("Color Check"));
1649 CreateBlankWindowL();
1654 @SYMTestCaseID GRAPHICS-WSERV-0219
1658 @SYMTestCaseDesc Test fading in a blank window
1660 @SYMTestPriority High
1662 @SYMTestStatus Implemented
1664 @SYMTestActions Fade in a blank window and check the fading occurs correctly
1666 @SYMTestExpectedResults Fading in a blank window occurs correctly
1669 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0219"));
1670 iTest->LogSubTest(_L("Blank Window"));
1674 @SYMTestCaseID GRAPHICS-WSERV-0220
1678 @SYMTestCaseDesc Test fading in child windows
1680 @SYMTestPriority High
1682 @SYMTestStatus Implemented
1684 @SYMTestActions Fade in child windows and check the fading occurs correctly
1686 @SYMTestExpectedResults Fading in the child windows occurs correctly
1689 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0220"));
1690 iTest->LogSubTest(_L("Fade Children"));
1694 @SYMTestCaseID GRAPHICS-WSERV-0221
1698 @SYMTestCaseDesc Test fading in newly created child windows
1700 @SYMTestPriority High
1702 @SYMTestStatus Implemented
1704 @SYMTestActions Fade in newly created child windows and check the fading occurs correctly
1706 @SYMTestExpectedResults Fading in the newly created child windows occurs correctly
1709 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0221"));
1710 iTest->LogSubTest(_L("Fade Children newly created"));
1711 FadeChildrenAfterNewChildIsCreatedL();
1714 @SYMTestCaseID GRAPHICS-WSERV-0222
1718 @SYMTestCaseDesc Test fading in window behind another window
1720 @SYMTestPriority High
1722 @SYMTestStatus Implemented
1724 @SYMTestActions Fade in window behind another window and check the fading occurs correctly
1726 @SYMTestExpectedResults Fading in window occurs correctly
1729 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0222"));
1730 iTest->LogSubTest(_L("Fade Behind"));
1734 @SYMTestCaseID GRAPHICS-WSERV-0223
1738 @SYMTestCaseDesc Test differnt fading techniques in a window
1740 @SYMTestPriority High
1742 @SYMTestStatus Implemented
1744 @SYMTestActions Fade using different fading techniques in a window
1745 and check the fading occurs correctly
1747 @SYMTestExpectedResults Fading in window occurs correctly
1750 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0223"));
1751 #if(defined(__DISPLAY_MODE_64K_COLOR)) //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
1752 iTest->LogSubTest(_L("Alternative Fadings1"));
1755 LOG_MESSAGE(_L("Alternative Fadings1 test not run"));
1759 @SYMTestCaseID GRAPHICS-WSERV-0224
1763 @SYMTestCaseDesc Test differnt fading techniques in a window
1765 @SYMTestPriority High
1767 @SYMTestStatus Implemented
1769 @SYMTestActions Fade using different fading techniques in a window
1770 and check the fading occurs correctly
1772 @SYMTestExpectedResults Fading in window occurs correctly
1775 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0224"));
1776 #if(defined(__DISPLAY_MODE_64K_COLOR)) //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
1777 iTest->LogSubTest(_L("Alternative Fadings2"));
1780 LOG_MESSAGE(_L("Alternative Fadings2 test not run"));
1784 @SYMTestCaseID GRAPHICS-WSERV-0225
1788 @SYMTestCaseDesc Test differnt system wide fading techniques in a window
1790 @SYMTestPriority High
1792 @SYMTestStatus Implemented
1794 @SYMTestActions Fade using different system wide fading techniques in a window
1795 and check the fading occurs correctly
1797 @SYMTestExpectedResults Fading in system occurs correctly
1800 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0225"));
1801 iTest->LogSubTest(_L("System Fade"));
1803 SystemAlternateFadeL();
1806 @SYMTestCaseID GRAPHICS-WSERV-0226
1810 @SYMTestCaseDesc Test fading in window behind another window when the window has been moved
1812 @SYMTestPriority High
1814 @SYMTestStatus Implemented
1816 @SYMTestActions Fade in window behind another window and check the fading occurs correctly
1818 @SYMTestExpectedResults Fading in window occurs correctly
1821 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0226"));
1822 iTest->LogSubTest(_L("Fade behind moved"));
1823 FadeBehindWhenMovedL();
1826 @SYMTestCaseID GRAPHICS-WSERV-0227
1830 @SYMTestCaseDesc Destroy the blnk window used for fading
1832 @SYMTestPriority High
1834 @SYMTestStatus Implemented
1836 @SYMTestActions Destroy the blnk window used for fading and check it was deleted correctly
1838 @SYMTestExpectedResults The window is destroyed
1841 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0227"));
1842 DestroyBlankWindow();
1845 @SYMTestCaseID GRAPHICS-WSERV-0228
1849 @SYMTestCaseDesc Test backup window creation and drawing
1851 @SYMTestPriority High
1853 @SYMTestStatus Implemented
1855 @SYMTestActions Create a backup window and draw in it
1857 @SYMTestExpectedResults The drawing is correct in the window
1860 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0228"));
1861 iTest->LogSubTest(_L("BackupWin Draw"));
1863 CreateBackupWindowL(EFalse);
1867 @SYMTestCaseID GRAPHICS-WSERV-0229
1871 @SYMTestCaseDesc Test fading with backup window obscured
1873 @SYMTestPriority High
1875 @SYMTestStatus Implemented
1877 @SYMTestActions Test fading with the backup window obscured
1879 @SYMTestExpectedResults Fading occurs correctly with window obscured
1882 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0229"));
1883 iTest->LogSubTest(_L("BackupWin Obscured"));
1887 @SYMTestCaseID GRAPHICS-WSERV-0230
1891 @SYMTestCaseDesc Test fading with backup window being moved
1893 @SYMTestPriority High
1895 @SYMTestStatus Implemented
1897 @SYMTestActions Test fading with the backup window being moved
1899 @SYMTestExpectedResults Fading occurs correctly with window moved
1902 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0230"));
1903 iTest->LogSubTest(_L("BackupWin Moving"));
1905 DestroyDrawableWindow();
1908 @SYMTestCaseID GRAPHICS-WSERV-0231
1912 @SYMTestCaseDesc Test backup window creation and drawing
1914 @SYMTestPriority High
1916 @SYMTestStatus Implemented
1918 @SYMTestActions Create a backup window and draw in it
1920 @SYMTestExpectedResults The drawing is correct in the window
1923 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0231"));
1924 iTest->LogSubTest(_L("BackupWin Draw"));
1925 CreateBackupWindowL(ETrue);
1929 @SYMTestCaseID GRAPHICS-WSERV-0232
1933 @SYMTestCaseDesc Test fading with backup window obscured
1935 @SYMTestPriority High
1937 @SYMTestStatus Implemented
1939 @SYMTestActions Test fading with the backup window obscured
1941 @SYMTestExpectedResults Fading occurs correctly with window obscured
1944 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0232"));
1945 iTest->LogSubTest(_L("BackupWin Obscured"));
1949 @SYMTestCaseID GRAPHICS-WSERV-0233
1953 @SYMTestCaseDesc Test fading with backup window being moved
1955 @SYMTestPriority High
1957 @SYMTestStatus Implemented
1959 @SYMTestActions Test fading with the backup window being moved
1961 @SYMTestExpectedResults Fading occurs correctly with window moved
1964 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0233"));
1965 iTest->LogSubTest(_L("BackupWin Moving"));
1967 DestroyDrawableWindow();
1970 @SYMTestCaseID GRAPHICS-WSERV-0234
1974 @SYMTestCaseDesc Test redraw window creation and drawing
1976 @SYMTestPriority High
1978 @SYMTestStatus Implemented
1980 @SYMTestActions Create a redraw window and draw in it
1982 @SYMTestExpectedResults The drawing is correct in the window
1985 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0234"));
1986 iTest->LogSubTest(_L("RedrawWin Draw"));
1987 CreateRedrawWindowL();
1991 @SYMTestCaseID GRAPHICS-WSERV-0235
1995 @SYMTestCaseDesc Test fading with redraw window obscured
1997 @SYMTestPriority High
1999 @SYMTestStatus Implemented
2001 @SYMTestActions Test fading with the redraw window obscured
2003 @SYMTestExpectedResults Fading occurs correctly with window obscured
2006 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0235"));
2007 iTest->LogSubTest(_L("RedrawWin Obscured"));
2011 @SYMTestCaseID GRAPHICS-WSERV-0236
2015 @SYMTestCaseDesc Test fading with redraw window being moved
2017 @SYMTestPriority High
2019 @SYMTestStatus Implemented
2021 @SYMTestActions Test fading with the redraw window being moved
2023 @SYMTestExpectedResults Fading occurs correctly with window moved
2026 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0236"));
2027 iTest->LogSubTest(_L("RedrawWin Moving"));
2031 @SYMTestCaseID GRAPHICS-WSERV-0237
2035 @SYMTestCaseDesc Test different fading techniques within a redraw window
2037 @SYMTestPriority High
2039 @SYMTestStatus Implemented
2041 @SYMTestActions Test different fading techniques within a redraw window
2043 @SYMTestExpectedResults Fading occurs correctly for the different techniques
2046 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0237"));
2047 iTest->LogSubTest(_L("AlternativeFadeDraw"));
2052 @SYMTestCaseID GRAPHICS-WSERV-0238
2056 @SYMTestCaseDesc Test fading within a redraw window using the graphic context
2058 @SYMTestPriority High
2060 @SYMTestStatus Implemented
2062 @SYMTestActions Test fading within a redraw window using the graphic context
2064 @SYMTestExpectedResults Fading occurs correctly in the window
2067 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0238"));
2068 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
2069 iTest->LogSubTest(_L("GC Test"));
2071 DestroyDrawableWindow();
2077 @SYMTestCaseID GRAPHICS-WSERV-0538
2081 @SYMTestCaseDesc Test fading under transparent window
2083 @SYMTestPriority High
2085 @SYMTestStatus Implemented
2087 @SYMTestActions Construct opaque window lying under two transparent windows. Fade the opaque and the transparent windows.
2089 @SYMTestExpectedResults Each of the overlapping areas should be faded only once.
2093 ((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0538"));
2094 iTest->LogSubTest(_L("Fade behind transparent window"));
2095 CRedrawWin* win = new(ELeave) CRedrawWin(this);
2096 win->ConstructL(TRect(0,0,0,0));
2097 TInt transparency = win->Win()->SetTransparencyAlphaChannel();
2098 if (transparency!=KErrNotSupported)
2100 FadeBehindTransparentWindowL();
2104 WARN_PRINTF1(_L("Transparency not supported. Skipping test."));
2110 ((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
2111 iTest->LogSubTest(_L("Test complete\n"));
2112 #ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
2113 DestroyDrawableWindow();
2116 ((CTFadeStep*)iStep)->CloseTMSGraphicsStep();
2120 ((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
2123 ((CTFadeStep*)iStep)->RecordTestResultL();
2126 __WS_CONSTRUCT_STEP__(Fade)