sl@0
|
1 |
// Copyright (c) 1998-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 Fading and UnFading of windows
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "TFADE.H"
|
sl@0
|
19 |
#define __DISPLAY_MODE_64K_COLOR
|
sl@0
|
20 |
|
sl@0
|
21 |
//CRedrawWin
|
sl@0
|
22 |
|
sl@0
|
23 |
CRedrawWin::CRedrawWin(CTFade *aTest) : CTWin(), iTest(aTest)
|
sl@0
|
24 |
{}
|
sl@0
|
25 |
|
sl@0
|
26 |
CRedrawWin::~CRedrawWin()
|
sl@0
|
27 |
{
|
sl@0
|
28 |
}
|
sl@0
|
29 |
|
sl@0
|
30 |
void CRedrawWin::ConstructL(TRect aArea)
|
sl@0
|
31 |
{
|
sl@0
|
32 |
|
sl@0
|
33 |
ConstructExtLD(*TheClient->iGroup,aArea.iTl,aArea.Size());
|
sl@0
|
34 |
AssignGC(*TheClient->iGc);
|
sl@0
|
35 |
Activate();
|
sl@0
|
36 |
iWin.BeginRedraw();
|
sl@0
|
37 |
iWin.EndRedraw();
|
sl@0
|
38 |
}
|
sl@0
|
39 |
|
sl@0
|
40 |
void CRedrawWin::Draw()
|
sl@0
|
41 |
{
|
sl@0
|
42 |
iTest->Drawing(iTest->Content(),iGc);
|
sl@0
|
43 |
}
|
sl@0
|
44 |
|
sl@0
|
45 |
|
sl@0
|
46 |
//CFadeTest
|
sl@0
|
47 |
|
sl@0
|
48 |
CTFade::CTFade(CTestStep* aStep) : CTWsGraphicsBase(aStep)
|
sl@0
|
49 |
{
|
sl@0
|
50 |
#if defined (__MARM_THUMB__)
|
sl@0
|
51 |
CanFade = false;
|
sl@0
|
52 |
CanFadeSet = false;
|
sl@0
|
53 |
#endif
|
sl@0
|
54 |
}
|
sl@0
|
55 |
|
sl@0
|
56 |
void CTFade::ConstructL()
|
sl@0
|
57 |
{
|
sl@0
|
58 |
iDeviceDisplayMode=TheClient->iScreen->DisplayMode();
|
sl@0
|
59 |
iTestWinSize=StdTestWindowSize();
|
sl@0
|
60 |
iFadeDrawMode = iDeviceDisplayMode;
|
sl@0
|
61 |
iTestWinCopy = new (ELeave) CFbsBitmap();
|
sl@0
|
62 |
iTestWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
|
sl@0
|
63 |
iCheckWinCopy = new (ELeave) CFbsBitmap();
|
sl@0
|
64 |
iCheckWinCopy->Create(iTestWinSize,TheClient->iScreen->DisplayMode());
|
sl@0
|
65 |
}
|
sl@0
|
66 |
|
sl@0
|
67 |
CTFade::~CTFade()
|
sl@0
|
68 |
{
|
sl@0
|
69 |
__ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
70 |
delete iTestWinCopy;
|
sl@0
|
71 |
delete iCheckWinCopy;
|
sl@0
|
72 |
}
|
sl@0
|
73 |
|
sl@0
|
74 |
TInt CTFade::Content()
|
sl@0
|
75 |
{
|
sl@0
|
76 |
return iContent;
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
void CTFade::CreateBlankWindowL()
|
sl@0
|
80 |
{
|
sl@0
|
81 |
__ASSERT_ALWAYS(!iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
82 |
TSize scrSize(TheClient->iScreen->SizeInPixels());
|
sl@0
|
83 |
iTestWinSize.SetSize(2*scrSize.iWidth/3-6,scrSize.iHeight-6);
|
sl@0
|
84 |
iBlankWin=new(ELeave) CTBlankWindow();
|
sl@0
|
85 |
iWindowRect.SetRect(TPoint(3+scrSize.iWidth/3,3),iTestWinSize);
|
sl@0
|
86 |
iBlankWin->SetUpL(iWindowRect.iTl,iTestWinSize,TheClient->iGroup,*TheClient->iGc);
|
sl@0
|
87 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
88 |
}
|
sl@0
|
89 |
|
sl@0
|
90 |
void CTFade::DestroyBlankWindow()
|
sl@0
|
91 |
{
|
sl@0
|
92 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
93 |
delete iBlankWin;
|
sl@0
|
94 |
iBlankWin=NULL;
|
sl@0
|
95 |
}
|
sl@0
|
96 |
|
sl@0
|
97 |
void CTFade::CreateBackupWindowL(TBool aMaintainBackup)
|
sl@0
|
98 |
{
|
sl@0
|
99 |
__ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
100 |
CTBackedUpWin* backUpWin=new(ELeave) CTBackedUpWin(MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
|
sl@0
|
101 |
iWin=backUpWin;
|
sl@0
|
102 |
iOwnWindow=ETrue;
|
sl@0
|
103 |
iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
|
sl@0
|
104 |
backUpWin->ConstructExtLD(*TheClient->iGroup,iWindowRect.iTl,iTestWinSize);
|
sl@0
|
105 |
if (aMaintainBackup)
|
sl@0
|
106 |
backUpWin->BackedUpWin()->MaintainBackup();
|
sl@0
|
107 |
backUpWin->Activate();
|
sl@0
|
108 |
TheClient->WaitForRedrawsToFinish(); //Without this bitmaps won't draw into the window
|
sl@0
|
109 |
}
|
sl@0
|
110 |
|
sl@0
|
111 |
void CTFade::CreateRedrawWindowL()
|
sl@0
|
112 |
{
|
sl@0
|
113 |
__ASSERT_ALWAYS(!iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
114 |
iWindowRect.SetRect(TPoint(2*iTestWinSize.iWidth+35,7),iTestWinSize);
|
sl@0
|
115 |
CRedrawWin* redrawWin=new(ELeave) CRedrawWin(this);
|
sl@0
|
116 |
redrawWin->ConstructL(iWindowRect);
|
sl@0
|
117 |
redrawWin->Win()->EnableRedrawStore(EFalse);
|
sl@0
|
118 |
iWin=redrawWin;
|
sl@0
|
119 |
iOwnWindow=ETrue;
|
sl@0
|
120 |
iWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
|
sl@0
|
121 |
}
|
sl@0
|
122 |
|
sl@0
|
123 |
void CTFade::DestroyDrawableWindow()
|
sl@0
|
124 |
{
|
sl@0
|
125 |
__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
126 |
if (iOwnWindow)
|
sl@0
|
127 |
delete iWin;
|
sl@0
|
128 |
iWin=NULL;
|
sl@0
|
129 |
}
|
sl@0
|
130 |
|
sl@0
|
131 |
void CTFade::CreateBitmapsL()
|
sl@0
|
132 |
{
|
sl@0
|
133 |
iTestWinSize=BaseWin->Size();
|
sl@0
|
134 |
iBaseRect.SetRect(BaseWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),iTestWinSize);
|
sl@0
|
135 |
iNormalBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
|
sl@0
|
136 |
iFadedBitmap.Create(iTestWinSize,MODE_LT_64K(iDeviceDisplayMode)?iFadeDrawMode:iDeviceDisplayMode);
|
sl@0
|
137 |
iNormalBitmapDevice=CFbsBitmapDevice::NewL(&iNormalBitmap);
|
sl@0
|
138 |
iFadedBitmapDevice=CFbsBitmapDevice::NewL(&iFadedBitmap);
|
sl@0
|
139 |
User::LeaveIfError(iNormalBitmapDevice->CreateContext(iNormalBitGc));
|
sl@0
|
140 |
User::LeaveIfError(iFadedBitmapDevice->CreateContext(iFadedBitGc));
|
sl@0
|
141 |
iFadedBitGc->SetFadeMode(ETrue);
|
sl@0
|
142 |
iBaseWinMode=BaseWin->BaseWin()->DisplayMode();
|
sl@0
|
143 |
BaseWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
|
sl@0
|
144 |
}
|
sl@0
|
145 |
|
sl@0
|
146 |
void CTFade::DestroyBitmaps()
|
sl@0
|
147 |
{
|
sl@0
|
148 |
delete iNormalBitGc;
|
sl@0
|
149 |
delete iFadedBitGc;
|
sl@0
|
150 |
delete iNormalBitmapDevice;
|
sl@0
|
151 |
delete iFadedBitmapDevice;
|
sl@0
|
152 |
BaseWin->BaseWin()->SetRequiredDisplayMode(iBaseWinMode);
|
sl@0
|
153 |
}
|
sl@0
|
154 |
|
sl@0
|
155 |
void CTFade::Drawing(TInt aDrawFunc, CBitmapContext *gc)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
TRgb grey=TRgb::Gray4(2);
|
sl@0
|
158 |
TInt ii;
|
sl@0
|
159 |
gc->Reset();
|
sl@0
|
160 |
switch (aDrawFunc)
|
sl@0
|
161 |
{
|
sl@0
|
162 |
case 1:
|
sl@0
|
163 |
case 2:
|
sl@0
|
164 |
Draw(0,&grey,gc);
|
sl@0
|
165 |
gc->Reset();
|
sl@0
|
166 |
Draw(1,NULL,gc);
|
sl@0
|
167 |
if (aDrawFunc==1)
|
sl@0
|
168 |
break;
|
sl@0
|
169 |
gc->Reset();
|
sl@0
|
170 |
Draw(3,NULL,gc);
|
sl@0
|
171 |
break;
|
sl@0
|
172 |
case 3:
|
sl@0
|
173 |
Draw(0,&grey,gc);
|
sl@0
|
174 |
gc->Reset();
|
sl@0
|
175 |
Draw(3,NULL,gc);
|
sl@0
|
176 |
break;
|
sl@0
|
177 |
case 4:
|
sl@0
|
178 |
grey=TRgb::Gray4(1);
|
sl@0
|
179 |
gc->Reset();
|
sl@0
|
180 |
Draw(0,&grey,gc);
|
sl@0
|
181 |
gc->Reset();
|
sl@0
|
182 |
for (ii=1;ii<37;ii+=7)
|
sl@0
|
183 |
Draw(2,&ii,gc);
|
sl@0
|
184 |
break;
|
sl@0
|
185 |
case 5:
|
sl@0
|
186 |
Draw(0,&grey,gc);
|
sl@0
|
187 |
gc->Reset();
|
sl@0
|
188 |
Draw(1,NULL,gc);
|
sl@0
|
189 |
gc->Reset();
|
sl@0
|
190 |
for (ii=2;ii<60;ii+=11)
|
sl@0
|
191 |
Draw(2,&ii,gc);
|
sl@0
|
192 |
break;
|
sl@0
|
193 |
case 6:
|
sl@0
|
194 |
case 7:
|
sl@0
|
195 |
Draw(0,&grey,gc);
|
sl@0
|
196 |
gc->Reset();
|
sl@0
|
197 |
Draw(3,NULL,gc);
|
sl@0
|
198 |
gc->Reset();
|
sl@0
|
199 |
for (ii=3;ii<70;ii+=13)
|
sl@0
|
200 |
Draw(2,&ii,gc);
|
sl@0
|
201 |
if (aDrawFunc==6)
|
sl@0
|
202 |
break;
|
sl@0
|
203 |
gc->Reset();
|
sl@0
|
204 |
Draw(1,NULL,gc);
|
sl@0
|
205 |
break;
|
sl@0
|
206 |
default:;
|
sl@0
|
207 |
}
|
sl@0
|
208 |
}
|
sl@0
|
209 |
|
sl@0
|
210 |
void CTFade::Draw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade/*=EFalse*/, TBool aFade/*=EFalse*/)
|
sl@0
|
211 |
{
|
sl@0
|
212 |
CWindowGc *gc=TheClient->iGc;
|
sl@0
|
213 |
gc->Activate(*iWin->DrawableWin());
|
sl@0
|
214 |
gc->Reset();
|
sl@0
|
215 |
if (aFade)
|
sl@0
|
216 |
gc->SetFaded(ETrue);
|
sl@0
|
217 |
iNormalBitGc->Reset();
|
sl@0
|
218 |
iFadedBitGc->Reset();
|
sl@0
|
219 |
iFadedBitGc->SetFadeMode(ETrue);
|
sl@0
|
220 |
if (aAlternativeFade)
|
sl@0
|
221 |
iFadedBitGc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
|
sl@0
|
222 |
Draw(aDrawFunc,aParam,gc);
|
sl@0
|
223 |
Draw(aDrawFunc,aParam,iNormalBitGc);
|
sl@0
|
224 |
Draw(aDrawFunc,aParam,iFadedBitGc);
|
sl@0
|
225 |
gc->Deactivate();
|
sl@0
|
226 |
if (aAlternativeFade)
|
sl@0
|
227 |
iFadedBitGc->SetFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
|
sl@0
|
228 |
}
|
sl@0
|
229 |
|
sl@0
|
230 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // CWindowGc fading is deprecated in NGA
|
sl@0
|
231 |
void CTFade::GCDraw(TInt aDrawFunc, TAny *aParam, TBool aAlternativeFade)
|
sl@0
|
232 |
{
|
sl@0
|
233 |
CWindowGc *gc=TheClient->iGc;
|
sl@0
|
234 |
gc->Activate(*iWin->DrawableWin());
|
sl@0
|
235 |
gc->Reset();
|
sl@0
|
236 |
Draw(aDrawFunc,aParam,gc);
|
sl@0
|
237 |
gc->Deactivate();
|
sl@0
|
238 |
gc->Activate(*BaseWin->DrawableWin());
|
sl@0
|
239 |
gc->Reset();
|
sl@0
|
240 |
gc->SetFaded(ETrue);
|
sl@0
|
241 |
if (aAlternativeFade)
|
sl@0
|
242 |
gc->SetFadingParameters(BLACK_ALTERNATE,WHITE_ALTERNATE);
|
sl@0
|
243 |
Draw(aDrawFunc,aParam,gc);
|
sl@0
|
244 |
gc->Deactivate();
|
sl@0
|
245 |
}
|
sl@0
|
246 |
#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
247 |
|
sl@0
|
248 |
void CTFade::Draw(TInt aDrawFunc, TAny *aParam, CBitmapContext *aGc)
|
sl@0
|
249 |
{
|
sl@0
|
250 |
switch(aDrawFunc)
|
sl@0
|
251 |
{
|
sl@0
|
252 |
case 0:
|
sl@0
|
253 |
aGc->SetBrushColor(*((TRgb *)aParam));
|
sl@0
|
254 |
aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
255 |
aGc->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
256 |
aGc->DrawRect(TRect(iTestWinSize));
|
sl@0
|
257 |
break;
|
sl@0
|
258 |
case 1:
|
sl@0
|
259 |
{
|
sl@0
|
260 |
TSize half(iTestWinSize.iWidth/2,iTestWinSize.iHeight/2);
|
sl@0
|
261 |
TRect rect(half);
|
sl@0
|
262 |
aGc->DrawEllipse(rect);
|
sl@0
|
263 |
aGc->DrawEllipse(TRect(TPoint(0,half.iHeight),half));
|
sl@0
|
264 |
aGc->SetOrigin(TPoint(half.iWidth,0));
|
sl@0
|
265 |
aGc->SetClippingRect(rect);
|
sl@0
|
266 |
aGc->DrawEllipse(rect);
|
sl@0
|
267 |
aGc->SetOrigin(TPoint(half.iWidth,half.iHeight));
|
sl@0
|
268 |
aGc->SetClippingRect(rect);
|
sl@0
|
269 |
aGc->DrawEllipse(rect);
|
sl@0
|
270 |
aGc->SetOrigin(TPoint());
|
sl@0
|
271 |
aGc->CancelClippingRect();
|
sl@0
|
272 |
}
|
sl@0
|
273 |
break;
|
sl@0
|
274 |
case 2:
|
sl@0
|
275 |
{
|
sl@0
|
276 |
TInt param= *((TInt *)aParam);
|
sl@0
|
277 |
if (param&0x1)
|
sl@0
|
278 |
aGc->DrawLine(TPoint(param+(param*27)%iTestWinSize.iWidth,0),
|
sl@0
|
279 |
TPoint(iTestWinSize.iWidth-((param<<1)+(param*19)%iTestWinSize.iWidth),iTestWinSize.iHeight));
|
sl@0
|
280 |
else
|
sl@0
|
281 |
aGc->DrawLine(TPoint(0, (param<<1)+(param*7)%iTestWinSize.iHeight),
|
sl@0
|
282 |
TPoint(iTestWinSize.iWidth,param+(param*13)%iTestWinSize.iHeight));
|
sl@0
|
283 |
}
|
sl@0
|
284 |
break;
|
sl@0
|
285 |
case 3:
|
sl@0
|
286 |
{
|
sl@0
|
287 |
TPoint pos;
|
sl@0
|
288 |
for(;pos.iX<iTestWinSize.iWidth;pos.iX+=10)
|
sl@0
|
289 |
aGc->DrawLine(pos,pos+TSize(0,iTestWinSize.iHeight));
|
sl@0
|
290 |
for(pos.iX=0;pos.iY<iTestWinSize.iHeight;pos.iY+=10)
|
sl@0
|
291 |
aGc->DrawLine(pos,pos+TSize(iTestWinSize.iWidth,0));
|
sl@0
|
292 |
}
|
sl@0
|
293 |
break;
|
sl@0
|
294 |
}
|
sl@0
|
295 |
}
|
sl@0
|
296 |
|
sl@0
|
297 |
void CTFade::CompareWithBitmap(TBool aFade)
|
sl@0
|
298 |
{
|
sl@0
|
299 |
TBool match;
|
sl@0
|
300 |
CWindowGc& gc=*TheClient->iGc;
|
sl@0
|
301 |
CFbsBitmap* bitmap;
|
sl@0
|
302 |
TheClient->iWs.Flush();
|
sl@0
|
303 |
if (aFade)
|
sl@0
|
304 |
bitmap=&iFadedBitmap;
|
sl@0
|
305 |
else
|
sl@0
|
306 |
bitmap=&iNormalBitmap;
|
sl@0
|
307 |
gc.Activate(*BaseWin->DrawableWin());
|
sl@0
|
308 |
gc.Reset();
|
sl@0
|
309 |
gc.BitBlt(TPoint(),bitmap);
|
sl@0
|
310 |
gc.Deactivate();
|
sl@0
|
311 |
TheClient->iWs.Flush();
|
sl@0
|
312 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
313 |
match=TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
|
sl@0
|
314 |
#else // In NGA comparison has to be lossy because fading can be implemented on hardware
|
sl@0
|
315 |
match=LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, iWindowRect);
|
sl@0
|
316 |
#endif
|
sl@0
|
317 |
TEST(match);
|
sl@0
|
318 |
if (!match)
|
sl@0
|
319 |
{
|
sl@0
|
320 |
_LIT(KLog,"Windows content don't match when they should");
|
sl@0
|
321 |
LOG_MESSAGE(KLog);
|
sl@0
|
322 |
}
|
sl@0
|
323 |
}
|
sl@0
|
324 |
|
sl@0
|
325 |
void CTFade::CompareWindows(TBool aAlternativeFade/*=EFalse*/)
|
sl@0
|
326 |
{
|
sl@0
|
327 |
if (aAlternativeFade)
|
sl@0
|
328 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
|
sl@0
|
329 |
else
|
sl@0
|
330 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
331 |
TheClient->iWs.Flush();
|
sl@0
|
332 |
TBool retVal = TheClient->iScreen->RectCompare(iBaseRect,iWindowRect);
|
sl@0
|
333 |
TEST(retVal);
|
sl@0
|
334 |
if (!retVal)
|
sl@0
|
335 |
INFO_PRINTF3(_L("TheClient->iScreen->RectCompare(iBaseRect,iWindowRect) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
336 |
|
sl@0
|
337 |
iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
338 |
TheClient->iWs.Flush();
|
sl@0
|
339 |
TheClient->WaitForRedrawsToFinish();
|
sl@0
|
340 |
}
|
sl@0
|
341 |
|
sl@0
|
342 |
#define FADE(n,col) n/2+col/2
|
sl@0
|
343 |
TInt CTFade::Fade4(TInt aGray4)
|
sl@0
|
344 |
{
|
sl@0
|
345 |
#if defined(__WINS__)
|
sl@0
|
346 |
return FADE(4,aGray4);
|
sl@0
|
347 |
#elif defined (__MARM_THUMB__)
|
sl@0
|
348 |
return (CanFade ? FADE(4,aGray4):aGray4);
|
sl@0
|
349 |
#elif defined (__MARM__)
|
sl@0
|
350 |
return FADE(4,aGray4);
|
sl@0
|
351 |
#else
|
sl@0
|
352 |
return aGray4;
|
sl@0
|
353 |
#endif
|
sl@0
|
354 |
}
|
sl@0
|
355 |
|
sl@0
|
356 |
TInt CTFade::Fade16(TInt aGray16)
|
sl@0
|
357 |
{
|
sl@0
|
358 |
#if defined(__WINS__)
|
sl@0
|
359 |
return FADE(16,aGray16);
|
sl@0
|
360 |
#elif defined (__MARM_THUMB__)
|
sl@0
|
361 |
return (CanFade ? FADE(16,aGray16):aGray16);
|
sl@0
|
362 |
#elif defined (__MARM__)
|
sl@0
|
363 |
return FADE(16,aGray16);
|
sl@0
|
364 |
#else
|
sl@0
|
365 |
return aGray16;
|
sl@0
|
366 |
#endif
|
sl@0
|
367 |
}
|
sl@0
|
368 |
|
sl@0
|
369 |
TRgb CTFade::FadeRgb(TRgb aColor)
|
sl@0
|
370 |
{
|
sl@0
|
371 |
switch (iFadeDrawMode)
|
sl@0
|
372 |
{
|
sl@0
|
373 |
case EColor16M:
|
sl@0
|
374 |
case EColor16MU:
|
sl@0
|
375 |
case EColor16MA:
|
sl@0
|
376 |
case EColor16MAP:
|
sl@0
|
377 |
break;
|
sl@0
|
378 |
default:
|
sl@0
|
379 |
aColor=TRgb::Color64K(aColor.Color64K());
|
sl@0
|
380 |
break;
|
sl@0
|
381 |
}
|
sl@0
|
382 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA // Color fading calculation differs in NGA
|
sl@0
|
383 |
TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL+1;
|
sl@0
|
384 |
#else
|
sl@0
|
385 |
TInt fadeMapFactor=WHITE_NORMAL-BLACK_NORMAL;
|
sl@0
|
386 |
#endif
|
sl@0
|
387 |
TInt fadeMapOffset=BLACK_NORMAL;
|
sl@0
|
388 |
TInt value = aColor.Internal();
|
sl@0
|
389 |
|
sl@0
|
390 |
TInt b = (((value & 0x000000ff) * fadeMapFactor) >> 8) + fadeMapOffset;
|
sl@0
|
391 |
TInt g = (((value & 0x0000ff00) * fadeMapFactor) >> 16) + fadeMapOffset;
|
sl@0
|
392 |
TInt r = (((value & 0x00ff0000) * fadeMapFactor) >> 24) + fadeMapOffset;
|
sl@0
|
393 |
return TRgb(r,g,b);
|
sl@0
|
394 |
}
|
sl@0
|
395 |
|
sl@0
|
396 |
TRgb CTFade::FadeRgb(TRgb aColor, TInt aFadeMapFactor, TInt aFadeMapOffset)
|
sl@0
|
397 |
{
|
sl@0
|
398 |
switch (iFadeDrawMode)
|
sl@0
|
399 |
{
|
sl@0
|
400 |
case EColor16M:
|
sl@0
|
401 |
case EColor16MU:
|
sl@0
|
402 |
case EColor16MA:
|
sl@0
|
403 |
case EColor16MAP:
|
sl@0
|
404 |
break;
|
sl@0
|
405 |
default:
|
sl@0
|
406 |
aColor=TRgb::Color64K(aColor.Color64K());
|
sl@0
|
407 |
break;
|
sl@0
|
408 |
}
|
sl@0
|
409 |
TInt value = aColor.Internal();
|
sl@0
|
410 |
|
sl@0
|
411 |
TInt b = (((value & 0x000000ff) * aFadeMapFactor) >> 8) + aFadeMapOffset;
|
sl@0
|
412 |
TInt g = (((value & 0x0000ff00) * aFadeMapFactor) >> 16) + aFadeMapOffset;
|
sl@0
|
413 |
TInt r = (((value & 0x00ff0000) * aFadeMapFactor) >> 24) + aFadeMapOffset;
|
sl@0
|
414 |
return TRgb(r,g,b);
|
sl@0
|
415 |
}
|
sl@0
|
416 |
|
sl@0
|
417 |
inline void CTFade::ViewDelay()
|
sl@0
|
418 |
//
|
sl@0
|
419 |
//This routine can provide a delay which will allow the user to see the colors changing
|
sl@0
|
420 |
//
|
sl@0
|
421 |
{
|
sl@0
|
422 |
TheClient->iWs.Finish();
|
sl@0
|
423 |
/*TheClient->iWs.Flush();
|
sl@0
|
424 |
User::After(1000000);*/ // 1 sec
|
sl@0
|
425 |
}
|
sl@0
|
426 |
|
sl@0
|
427 |
void CTFade::ColorTest()
|
sl@0
|
428 |
{
|
sl@0
|
429 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
430 |
TBool retVal;
|
sl@0
|
431 |
TSize size(iTestWinSize);
|
sl@0
|
432 |
#if defined(SMALL_RECTS)
|
sl@0
|
433 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
434 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
435 |
#endif
|
sl@0
|
436 |
TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
|
sl@0
|
437 |
TInt ii;
|
sl@0
|
438 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray4);
|
sl@0
|
439 |
TheClient->WaitForRedrawsToFinish(); //Force the screen into 4 gray mode
|
sl@0
|
440 |
TRgb fadedColor;
|
sl@0
|
441 |
for (ii=1;ii<4;ii+=2) //0 and 3 now give dithered colors when fading so causing this test to fail
|
sl@0
|
442 |
{
|
sl@0
|
443 |
iBlankWin->SetColor(TRgb::Gray4(ii));
|
sl@0
|
444 |
ViewDelay();
|
sl@0
|
445 |
INFO_PRINTF1(_L(" Testing Normal Color"));
|
sl@0
|
446 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
447 |
retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
|
sl@0
|
448 |
#else
|
sl@0
|
449 |
TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
|
sl@0
|
450 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
|
sl@0
|
451 |
#endif
|
sl@0
|
452 |
TEST(retVal);
|
sl@0
|
453 |
if (!retVal)
|
sl@0
|
454 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
455 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
456 |
ViewDelay();
|
sl@0
|
457 |
fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
|
sl@0
|
458 |
#if defined (__MARM_THUMB__)
|
sl@0
|
459 |
if (ii==1)
|
sl@0
|
460 |
{
|
sl@0
|
461 |
CanFade=!CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
|
sl@0
|
462 |
CanFadeSet=ETrue;
|
sl@0
|
463 |
fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray4(Fade4(ii)):FadeRgb(TRgb::Gray4(ii));
|
sl@0
|
464 |
}
|
sl@0
|
465 |
#endif
|
sl@0
|
466 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
467 |
retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
|
sl@0
|
468 |
#else
|
sl@0
|
469 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
|
sl@0
|
470 |
#endif
|
sl@0
|
471 |
TEST(retVal);
|
sl@0
|
472 |
if (!retVal)
|
sl@0
|
473 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
474 |
|
sl@0
|
475 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
476 |
ViewDelay();
|
sl@0
|
477 |
INFO_PRINTF1(_L(" Testing Unfaded Color"));
|
sl@0
|
478 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
479 |
retVal = CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen);
|
sl@0
|
480 |
#else
|
sl@0
|
481 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray4(ii));
|
sl@0
|
482 |
#endif
|
sl@0
|
483 |
TEST(retVal);
|
sl@0
|
484 |
if (!retVal)
|
sl@0
|
485 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray4(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
486 |
}
|
sl@0
|
487 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
488 |
|
sl@0
|
489 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
490 |
return;
|
sl@0
|
491 |
|
sl@0
|
492 |
INFO_PRINTF1(_L(" Doing 16 Gray Colors"));
|
sl@0
|
493 |
for (ii=0;ii<16;++ii)
|
sl@0
|
494 |
{
|
sl@0
|
495 |
iBlankWin->SetColor(TRgb::Gray16(ii));
|
sl@0
|
496 |
ViewDelay();
|
sl@0
|
497 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
498 |
retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
499 |
#else
|
sl@0
|
500 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
501 |
#endif
|
sl@0
|
502 |
TEST(retVal);
|
sl@0
|
503 |
if (!retVal)
|
sl@0
|
504 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
505 |
|
sl@0
|
506 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
507 |
ViewDelay();
|
sl@0
|
508 |
fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
|
sl@0
|
509 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
510 |
retVal = CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen);
|
sl@0
|
511 |
#else
|
sl@0
|
512 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
|
sl@0
|
513 |
#endif
|
sl@0
|
514 |
TEST(retVal);
|
sl@0
|
515 |
if (!retVal)
|
sl@0
|
516 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,fadedColor,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
517 |
|
sl@0
|
518 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
519 |
ViewDelay();
|
sl@0
|
520 |
|
sl@0
|
521 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
522 |
retVal = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
523 |
#else
|
sl@0
|
524 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
525 |
#endif
|
sl@0
|
526 |
TEST(retVal);
|
sl@0
|
527 |
if (!retVal)
|
sl@0
|
528 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
529 |
}
|
sl@0
|
530 |
}
|
sl@0
|
531 |
|
sl@0
|
532 |
void CTFade::BlankWindowL()
|
sl@0
|
533 |
{
|
sl@0
|
534 |
TBool retVal;
|
sl@0
|
535 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
536 |
return;
|
sl@0
|
537 |
|
sl@0
|
538 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
539 |
CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
|
sl@0
|
540 |
TRect testArea(iWindowRect);
|
sl@0
|
541 |
TRect windowRect(testArea);
|
sl@0
|
542 |
#if defined(SMALL_RECTS)
|
sl@0
|
543 |
TSize size(testArea.Size());
|
sl@0
|
544 |
size.iWidth=Min(2*SIZE_X,size.iWidth);
|
sl@0
|
545 |
size.iHeight=Min(2*SIZE_Y,size.iHeight);
|
sl@0
|
546 |
testArea.SetHeight(size.iHeight);
|
sl@0
|
547 |
testArea.iTl.iX=testArea.iBr.iX-size.iWidth;
|
sl@0
|
548 |
windowRect=testArea;
|
sl@0
|
549 |
windowRect.Shrink(size.iWidth/4,size.iHeight/4);
|
sl@0
|
550 |
#else
|
sl@0
|
551 |
windowRect.Shrink(30,30);
|
sl@0
|
552 |
#endif
|
sl@0
|
553 |
blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
|
sl@0
|
554 |
for (TInt col=2;col<16;col+=6)
|
sl@0
|
555 |
{
|
sl@0
|
556 |
iBlankWin->SetColor(TRgb::Gray16(col));
|
sl@0
|
557 |
TheClient->iScreen->CopyScreenToBitmap(iTestWinCopy, windowRect);
|
sl@0
|
558 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
559 |
blankWin->SetVisible(EFalse);
|
sl@0
|
560 |
TheClient->iWs.Finish();
|
sl@0
|
561 |
TRgb fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
|
sl@0
|
562 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
563 |
retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
|
sl@0
|
564 |
#else
|
sl@0
|
565 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
|
sl@0
|
566 |
#endif
|
sl@0
|
567 |
TEST(retVal);
|
sl@0
|
568 |
if (!retVal)
|
sl@0
|
569 |
INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
570 |
|
sl@0
|
571 |
blankWin->SetVisible(ETrue);
|
sl@0
|
572 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
573 |
blankWin->SetVisible(EFalse);
|
sl@0
|
574 |
TheClient->iWs.Finish();
|
sl@0
|
575 |
retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
|
sl@0
|
576 |
TEST(retVal);
|
sl@0
|
577 |
if (!retVal)
|
sl@0
|
578 |
INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
579 |
|
sl@0
|
580 |
blankWin->SetVisible(ETrue);
|
sl@0
|
581 |
iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
|
sl@0
|
582 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
583 |
blankWin->SetVisible(EFalse);
|
sl@0
|
584 |
iBlankWin->SetPos(iWindowRect.iTl);
|
sl@0
|
585 |
fadedColor=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(col)):FadeRgb(TRgb::Gray16(col));
|
sl@0
|
586 |
TheClient->iWs.Finish();
|
sl@0
|
587 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
588 |
retVal = CheckBlankWindow(testArea,fadedColor,TheClient->iScreen);
|
sl@0
|
589 |
#else
|
sl@0
|
590 |
retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor);
|
sl@0
|
591 |
#endif
|
sl@0
|
592 |
TEST(retVal);
|
sl@0
|
593 |
if (!retVal)
|
sl@0
|
594 |
INFO_PRINTF3(_L("LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, fadedColor) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
595 |
|
sl@0
|
596 |
blankWin->SetVisible(ETrue);
|
sl@0
|
597 |
iBlankWin->SetPos(iWindowRect.iTl+TPoint(15,-15));
|
sl@0
|
598 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
599 |
blankWin->SetVisible(EFalse);
|
sl@0
|
600 |
iBlankWin->SetPos(iWindowRect.iTl);
|
sl@0
|
601 |
TheClient->iWs.Finish();
|
sl@0
|
602 |
retVal = CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen);
|
sl@0
|
603 |
TEST(retVal);
|
sl@0
|
604 |
if (!retVal)
|
sl@0
|
605 |
INFO_PRINTF3(_L("CheckBlankWindow(testArea,TRgb::Gray16(col),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
606 |
|
sl@0
|
607 |
blankWin->SetVisible(ETrue);
|
sl@0
|
608 |
}
|
sl@0
|
609 |
delete blankWin;
|
sl@0
|
610 |
}
|
sl@0
|
611 |
|
sl@0
|
612 |
void CTFade::TestStrips(TRect aRect,TInt aHeight,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
|
sl@0
|
613 |
{
|
sl@0
|
614 |
TBool isFaded;
|
sl@0
|
615 |
TInt ii;
|
sl@0
|
616 |
TRgb col;
|
sl@0
|
617 |
for (ii=0;ii<16;++ii)
|
sl@0
|
618 |
{
|
sl@0
|
619 |
isFaded=((!aInvert)==(!(ii<aNumNotFaded)));
|
sl@0
|
620 |
if (isFaded)
|
sl@0
|
621 |
col=MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(ii)):FadeRgb(TRgb::Gray16(ii));
|
sl@0
|
622 |
else
|
sl@0
|
623 |
col=TRgb::Gray16(ii);
|
sl@0
|
624 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
625 |
TBool retVal = CheckBlankWindow(aRect,col,TheClient->iScreen);
|
sl@0
|
626 |
#else
|
sl@0
|
627 |
TBool retVal = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
|
sl@0
|
628 |
#endif
|
sl@0
|
629 |
TEST(retVal);
|
sl@0
|
630 |
if (!retVal)
|
sl@0
|
631 |
INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retVal);
|
sl@0
|
632 |
|
sl@0
|
633 |
aRect.Move(0,aHeight);
|
sl@0
|
634 |
}
|
sl@0
|
635 |
}
|
sl@0
|
636 |
|
sl@0
|
637 |
void CTFade::FadeChildrenL()
|
sl@0
|
638 |
{
|
sl@0
|
639 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
640 |
return;
|
sl@0
|
641 |
|
sl@0
|
642 |
TInt retVal;
|
sl@0
|
643 |
TBool retBool;
|
sl@0
|
644 |
|
sl@0
|
645 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
646 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
647 |
iBlankWin->SetColor(TRgb::Gray16(0));
|
sl@0
|
648 |
CTBlankWindow* win[16];
|
sl@0
|
649 |
win[0]=iBlankWin;
|
sl@0
|
650 |
TRect rect(iTestWinSize);
|
sl@0
|
651 |
TInt height=iTestWinSize.iHeight/16;
|
sl@0
|
652 |
rect.iTl.iY=height;
|
sl@0
|
653 |
TInt ii;
|
sl@0
|
654 |
for (ii=1;ii<16;++ii) //Causes memory leakage under OOM
|
sl@0
|
655 |
{
|
sl@0
|
656 |
win[ii]=new(ELeave) CTBlankWindow();
|
sl@0
|
657 |
win[ii]->SetUpL(rect.iTl,rect.Size(),win[ii-1],*TheClient->iGc);
|
sl@0
|
658 |
win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
659 |
win[ii]->SetColor(TRgb::Gray16(ii));
|
sl@0
|
660 |
rect.iBr.iY-=height;
|
sl@0
|
661 |
}
|
sl@0
|
662 |
rect=iWindowRect;
|
sl@0
|
663 |
rect.SetHeight(height);
|
sl@0
|
664 |
#if defined(SMALL_RECTS)
|
sl@0
|
665 |
TSize size(rect.Size());
|
sl@0
|
666 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
667 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
668 |
rect.SetSize(size);
|
sl@0
|
669 |
#endif
|
sl@0
|
670 |
for (ii=0;ii<15;++ii)
|
sl@0
|
671 |
{
|
sl@0
|
672 |
win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
673 |
retVal = win[ii]->BaseWin()->IsFaded();
|
sl@0
|
674 |
TEST(retVal==1);
|
sl@0
|
675 |
if (retVal!=1)
|
sl@0
|
676 |
INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
|
sl@0
|
677 |
|
sl@0
|
678 |
TestStrips(rect,height,ii);
|
sl@0
|
679 |
win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
680 |
retBool = !win[ii]->BaseWin()->IsFaded();
|
sl@0
|
681 |
TEST(retBool);
|
sl@0
|
682 |
if (!retBool)
|
sl@0
|
683 |
INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
684 |
|
sl@0
|
685 |
TestStrips(rect,height,16);
|
sl@0
|
686 |
}
|
sl@0
|
687 |
TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
688 |
TestStrips(rect,height,0);
|
sl@0
|
689 |
TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
690 |
TestStrips(rect,height,16);
|
sl@0
|
691 |
for (ii=0;ii<16;++ii)
|
sl@0
|
692 |
{
|
sl@0
|
693 |
win[ii]->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
694 |
retBool = !win[ii]->BaseWin()->IsFaded();
|
sl@0
|
695 |
TEST(retBool);
|
sl@0
|
696 |
if (!retBool)
|
sl@0
|
697 |
INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
698 |
|
sl@0
|
699 |
retVal = win[0]->BaseWin()->IsFaded();
|
sl@0
|
700 |
TEST(retVal==(ii>0));
|
sl@0
|
701 |
if (retVal!=(ii>0))
|
sl@0
|
702 |
INFO_PRINTF3(_L("win[0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0), retVal);
|
sl@0
|
703 |
|
sl@0
|
704 |
TestStrips(rect,height,ii,ETrue);
|
sl@0
|
705 |
win[ii]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
706 |
TestStrips(rect,height,16);
|
sl@0
|
707 |
}
|
sl@0
|
708 |
iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
709 |
TestStrips(rect,height,0);
|
sl@0
|
710 |
iBlankWin->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
711 |
TestStrips(rect,height,16);
|
sl@0
|
712 |
win[8]->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
713 |
TestStrips(rect,height,8);
|
sl@0
|
714 |
iBlankWin->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
715 |
TestStrips(rect,height,0);
|
sl@0
|
716 |
iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
717 |
TestStrips(rect,height,16);
|
sl@0
|
718 |
win[8]->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
719 |
TestStrips(rect,height,16);
|
sl@0
|
720 |
iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
721 |
TestStrips(rect,height,8,ETrue);
|
sl@0
|
722 |
win[8]->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
723 |
TestStrips(rect,height,0);
|
sl@0
|
724 |
iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
725 |
TestStrips(rect,height,16);
|
sl@0
|
726 |
for (ii=15;ii>0;--ii)
|
sl@0
|
727 |
delete win[ii];
|
sl@0
|
728 |
}
|
sl@0
|
729 |
|
sl@0
|
730 |
static void ResetAndDestroyWindows(TAny* aPtr)
|
sl@0
|
731 |
{
|
sl@0
|
732 |
RPointerArray<CTBlankWindow>& win = *(static_cast<RPointerArray<CTBlankWindow>*>(aPtr));
|
sl@0
|
733 |
win.Remove(0);
|
sl@0
|
734 |
win.ResetAndDestroy();
|
sl@0
|
735 |
win.Close();
|
sl@0
|
736 |
}
|
sl@0
|
737 |
|
sl@0
|
738 |
void CTFade::FadeChildrenAfterNewChildIsCreatedL()
|
sl@0
|
739 |
{
|
sl@0
|
740 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
741 |
return;
|
sl@0
|
742 |
|
sl@0
|
743 |
TBool retBool;
|
sl@0
|
744 |
TInt retVal;
|
sl@0
|
745 |
|
sl@0
|
746 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
747 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
|
sl@0
|
748 |
iBlankWin->SetColor(TRgb::Gray16(0));
|
sl@0
|
749 |
RPointerArray<CTBlankWindow> win;
|
sl@0
|
750 |
CleanupStack::PushL(TCleanupItem(ResetAndDestroyWindows, &win));
|
sl@0
|
751 |
TInt height=iTestWinSize.iHeight/NUMBER_OF_WINDOWS;
|
sl@0
|
752 |
CTBlankWindow* window=NULL;
|
sl@0
|
753 |
TInt ii;
|
sl@0
|
754 |
for (TInt firstLoop=0;firstLoop<NUMBER_OF_WINDOWS-1;)
|
sl@0
|
755 |
{
|
sl@0
|
756 |
win.ResetAndDestroy();
|
sl@0
|
757 |
TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
758 |
TRect rect(iTestWinSize);
|
sl@0
|
759 |
rect.iTl.iY=height;
|
sl@0
|
760 |
CTBlankWindow* parent=iBlankWin;
|
sl@0
|
761 |
for (TInt secondLoop=0;secondLoop<=firstLoop;)
|
sl@0
|
762 |
{
|
sl@0
|
763 |
window=new(ELeave) CTBlankWindow();
|
sl@0
|
764 |
CleanupStack::PushL(window);
|
sl@0
|
765 |
User::LeaveIfError(win.Append(window));
|
sl@0
|
766 |
CleanupStack::Pop(window);
|
sl@0
|
767 |
window->SetUpL(rect.iTl,rect.Size(),parent,*TheClient->iGc);
|
sl@0
|
768 |
window->BaseWin()->SetRequiredDisplayMode(iFadeDrawMode);
|
sl@0
|
769 |
window->SetColor(TRgb::Gray16(++secondLoop));
|
sl@0
|
770 |
rect.iBr.iY-=height;
|
sl@0
|
771 |
parent=window;
|
sl@0
|
772 |
retBool = window->BaseWin()->IsFaded();
|
sl@0
|
773 |
TEST(retBool);
|
sl@0
|
774 |
if (!retBool)
|
sl@0
|
775 |
INFO_PRINTF3(_L("window->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
776 |
|
sl@0
|
777 |
}
|
sl@0
|
778 |
++firstLoop;
|
sl@0
|
779 |
TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
780 |
const TInt count=win.Count();
|
sl@0
|
781 |
for(TInt index=0;index<count;++index)
|
sl@0
|
782 |
{
|
sl@0
|
783 |
retBool = win[index]->BaseWin()->IsFaded();
|
sl@0
|
784 |
TEST(!retBool);
|
sl@0
|
785 |
if (retBool)
|
sl@0
|
786 |
INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), EFalse, retBool);
|
sl@0
|
787 |
|
sl@0
|
788 |
}
|
sl@0
|
789 |
}
|
sl@0
|
790 |
User::LeaveIfError(win.Insert(iBlankWin,0));
|
sl@0
|
791 |
TRect testRect=iWindowRect;
|
sl@0
|
792 |
testRect.SetHeight(height);
|
sl@0
|
793 |
#if defined(SMALL_RECTS)
|
sl@0
|
794 |
TSize size(testRect.Size());
|
sl@0
|
795 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
796 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
797 |
testRect.SetSize(size);
|
sl@0
|
798 |
#endif
|
sl@0
|
799 |
for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
|
sl@0
|
800 |
{
|
sl@0
|
801 |
win[ii]->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
802 |
retVal = win[ii]->BaseWin()->IsFaded();
|
sl@0
|
803 |
TEST(retVal==1);
|
sl@0
|
804 |
if (retVal!=1)
|
sl@0
|
805 |
INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), 1, retVal);
|
sl@0
|
806 |
|
sl@0
|
807 |
TestStrips(testRect,height,ii);
|
sl@0
|
808 |
win[ii]->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
809 |
retBool = !win[ii]->BaseWin()->IsFaded();
|
sl@0
|
810 |
TEST(retBool);
|
sl@0
|
811 |
if (!retBool)
|
sl@0
|
812 |
INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);
|
sl@0
|
813 |
|
sl@0
|
814 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
815 |
}
|
sl@0
|
816 |
TheClient->iGroup->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
817 |
TestStrips(testRect,height,0);
|
sl@0
|
818 |
TheClient->iGroup->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
819 |
TestStrips(testRect,height,16);
|
sl@0
|
820 |
for (ii=0;ii<NUMBER_OF_WINDOWS;++ii)
|
sl@0
|
821 |
{
|
sl@0
|
822 |
win[ii]->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
823 |
retBool = !win[ii]->BaseWin()->IsFaded();
|
sl@0
|
824 |
TEST(retBool);
|
sl@0
|
825 |
if (!retBool)
|
sl@0
|
826 |
INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), EFalse, retBool);
|
sl@0
|
827 |
|
sl@0
|
828 |
retVal = win[0]->BaseWin()->IsFaded();
|
sl@0
|
829 |
TEST(retVal==(ii>0));
|
sl@0
|
830 |
if (retVal!=(ii>0))
|
sl@0
|
831 |
INFO_PRINTF3(_L("win[index]->BaseWin()->IsFaded return value - Expected: %d, Actual: %d"), (ii>0), retVal);
|
sl@0
|
832 |
|
sl@0
|
833 |
TestStrips(testRect,height,ii,ETrue);
|
sl@0
|
834 |
win[ii]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
835 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
836 |
}
|
sl@0
|
837 |
iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
838 |
TestStrips(testRect,height,0);
|
sl@0
|
839 |
iBlankWin->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
840 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
841 |
win[8]->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
842 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS/2);
|
sl@0
|
843 |
iBlankWin->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
844 |
TestStrips(testRect,height,0);
|
sl@0
|
845 |
iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
846 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
847 |
win[8]->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
848 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
849 |
iBlankWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
850 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS/2,ETrue);
|
sl@0
|
851 |
win[8]->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
852 |
TestStrips(testRect,height,0);
|
sl@0
|
853 |
iBlankWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeIncludeChildren);
|
sl@0
|
854 |
TestStrips(testRect,height,NUMBER_OF_WINDOWS);
|
sl@0
|
855 |
|
sl@0
|
856 |
CleanupStack::PopAndDestroy(&win);
|
sl@0
|
857 |
}
|
sl@0
|
858 |
|
sl@0
|
859 |
void CTFade::TestBlocks(TRect aRect,TSize aSize,TInt aNumNotFaded,TBool aInvert/*=EFalse*/)
|
sl@0
|
860 |
{
|
sl@0
|
861 |
TInt count=0;
|
sl@0
|
862 |
TInt ii,jj;
|
sl@0
|
863 |
TRgb col;
|
sl@0
|
864 |
for (ii=0;ii<4;++ii)
|
sl@0
|
865 |
{
|
sl@0
|
866 |
for (jj=0;jj<4;++jj)
|
sl@0
|
867 |
{
|
sl@0
|
868 |
if ((!aInvert)!=(!(count<aNumNotFaded)))
|
sl@0
|
869 |
col=TRgb::Gray16(count);
|
sl@0
|
870 |
else
|
sl@0
|
871 |
{
|
sl@0
|
872 |
col = TRgb::Gray16(count);
|
sl@0
|
873 |
col = MODE_LT_64K(iDeviceDisplayMode)?TRgb::Gray16(Fade16(count)):FadeRgb(col);
|
sl@0
|
874 |
}
|
sl@0
|
875 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
876 |
TBool retBool = CheckBlankWindow(aRect,col,TheClient->iScreen);
|
sl@0
|
877 |
#else
|
sl@0
|
878 |
TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, aRect, col);
|
sl@0
|
879 |
#endif
|
sl@0
|
880 |
TEST(retBool);
|
sl@0
|
881 |
if (!retBool)
|
sl@0
|
882 |
INFO_PRINTF3(_L("CheckBlankWindow(aRect,col,TheClient->iScreen) return value - Expected: %d, Actual: %d"), EFalse, retBool);
|
sl@0
|
883 |
|
sl@0
|
884 |
aRect.Move(0,aSize.iHeight);
|
sl@0
|
885 |
count++;
|
sl@0
|
886 |
}
|
sl@0
|
887 |
aRect.Move(aSize.iWidth,-jj*aSize.iHeight);
|
sl@0
|
888 |
}
|
sl@0
|
889 |
}
|
sl@0
|
890 |
|
sl@0
|
891 |
void CTFade::FadeBehindL()
|
sl@0
|
892 |
{
|
sl@0
|
893 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
894 |
return;
|
sl@0
|
895 |
|
sl@0
|
896 |
TBool retBool;
|
sl@0
|
897 |
TInt retVal;
|
sl@0
|
898 |
|
sl@0
|
899 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
900 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
901 |
iBlankWin->SetColor(TRgb::Gray16(0));
|
sl@0
|
902 |
CTBlankWindow* win[4][4];
|
sl@0
|
903 |
win[0][0]=iBlankWin;
|
sl@0
|
904 |
TSize size=iTestWinSize;
|
sl@0
|
905 |
TInt height=iTestWinSize.iHeight/4;
|
sl@0
|
906 |
TInt width=iTestWinSize.iWidth/4;
|
sl@0
|
907 |
TRect rect(iWindowRect.iTl,TSize(width,height));
|
sl@0
|
908 |
TSize rectSize(rect.Size());
|
sl@0
|
909 |
TPoint offset(0,height);
|
sl@0
|
910 |
TPoint topLeft;
|
sl@0
|
911 |
TInt ii,jj;
|
sl@0
|
912 |
CTWinBase* parent;
|
sl@0
|
913 |
#if defined(SMALL_RECTS)
|
sl@0
|
914 |
TSize rSize(rectSize);
|
sl@0
|
915 |
rSize.iWidth=Min(SIZE_X,rSize.iWidth);
|
sl@0
|
916 |
rSize.iHeight=Min(SIZE_Y,rSize.iHeight);
|
sl@0
|
917 |
rect.SetSize(rSize);
|
sl@0
|
918 |
#endif
|
sl@0
|
919 |
for (ii=0;ii<4;++ii) //Causes memory leakage under OOM
|
sl@0
|
920 |
{
|
sl@0
|
921 |
parent=TheClient->iGroup;
|
sl@0
|
922 |
topLeft=iWindowRect.iTl+TPoint(ii*width,0);
|
sl@0
|
923 |
size.iHeight=iTestWinSize.iHeight;
|
sl@0
|
924 |
for (jj=0;jj<4;++jj)
|
sl@0
|
925 |
{
|
sl@0
|
926 |
if (ii+jj>0)
|
sl@0
|
927 |
{
|
sl@0
|
928 |
win[ii][jj]=new(ELeave) CTBlankWindow();
|
sl@0
|
929 |
win[ii][jj]->SetUpL(topLeft,size,parent,*TheClient->iGc);
|
sl@0
|
930 |
win[ii][jj]->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
931 |
win[ii][jj]->SetColor(TRgb::Gray16(4*ii+jj));
|
sl@0
|
932 |
}
|
sl@0
|
933 |
size.iHeight-=height;
|
sl@0
|
934 |
topLeft=offset;
|
sl@0
|
935 |
parent=win[ii][jj];
|
sl@0
|
936 |
}
|
sl@0
|
937 |
size.iWidth-=width;
|
sl@0
|
938 |
}
|
sl@0
|
939 |
for (ii=0;ii<4;++ii)
|
sl@0
|
940 |
{
|
sl@0
|
941 |
for (jj=0;jj<4;++jj)
|
sl@0
|
942 |
{
|
sl@0
|
943 |
win[ii][jj]->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
944 |
retVal = win[0][0]->BaseWin()->IsFaded();
|
sl@0
|
945 |
TEST(retVal==(ii>0||jj>0));
|
sl@0
|
946 |
if (retVal!=(ii>0||jj>0))
|
sl@0
|
947 |
INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), (ii>0||jj>0), retVal);
|
sl@0
|
948 |
|
sl@0
|
949 |
retBool = !win[ii][jj]->BaseWin()->IsFaded();
|
sl@0
|
950 |
TEST(retBool);
|
sl@0
|
951 |
if (!retBool)
|
sl@0
|
952 |
INFO_PRINTF3(_L("!win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
953 |
|
sl@0
|
954 |
TestBlocks(rect,rectSize,4*ii+jj,ETrue);
|
sl@0
|
955 |
win[ii][jj]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
956 |
TestBlocks(rect,rectSize,16);
|
sl@0
|
957 |
}
|
sl@0
|
958 |
}
|
sl@0
|
959 |
for (ii=0;ii<4;++ii)
|
sl@0
|
960 |
{
|
sl@0
|
961 |
for (jj=0;jj<4;++jj)
|
sl@0
|
962 |
{
|
sl@0
|
963 |
win[ii][jj]->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
964 |
TestBlocks(rect,rectSize,4*ii+jj,ETrue);
|
sl@0
|
965 |
}
|
sl@0
|
966 |
retVal = win[ii][0]->BaseWin()->IsFaded();
|
sl@0
|
967 |
TEST(retVal==3);
|
sl@0
|
968 |
if (retVal!=3)
|
sl@0
|
969 |
INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);
|
sl@0
|
970 |
}
|
sl@0
|
971 |
for (ii=3;ii>=0;--ii)
|
sl@0
|
972 |
{
|
sl@0
|
973 |
retVal = win[ii][0]->BaseWin()->IsFaded();
|
sl@0
|
974 |
TEST(retVal==3);
|
sl@0
|
975 |
if (retVal!=3)
|
sl@0
|
976 |
INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 3, retVal);
|
sl@0
|
977 |
|
sl@0
|
978 |
for (jj=3;jj>=0;--jj)
|
sl@0
|
979 |
{
|
sl@0
|
980 |
TestBlocks(rect,rectSize,4*ii+jj,ETrue);
|
sl@0
|
981 |
win[ii][jj]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
982 |
}
|
sl@0
|
983 |
}
|
sl@0
|
984 |
TestBlocks(rect,rectSize,0,ETrue);
|
sl@0
|
985 |
for (ii=0;ii<4;++ii)
|
sl@0
|
986 |
{
|
sl@0
|
987 |
for (jj=0;jj<4;++jj)
|
sl@0
|
988 |
{
|
sl@0
|
989 |
win[ii][jj]->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
990 |
}
|
sl@0
|
991 |
}
|
sl@0
|
992 |
TInt fadeCount;
|
sl@0
|
993 |
for (ii=0;ii<4;++ii)
|
sl@0
|
994 |
{
|
sl@0
|
995 |
for (jj=0;jj<4;++jj)
|
sl@0
|
996 |
{
|
sl@0
|
997 |
fadeCount=15-(4*ii+jj);
|
sl@0
|
998 |
retVal = win[0][0]->BaseWin()->IsFaded();
|
sl@0
|
999 |
TEST(retVal==Min(15,fadeCount+1));
|
sl@0
|
1000 |
if (retVal!=Min(15,fadeCount+1))
|
sl@0
|
1001 |
INFO_PRINTF3(_L("win[0][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Min(15,fadeCount+1), retVal);
|
sl@0
|
1002 |
|
sl@0
|
1003 |
retVal = win[ii][jj]->BaseWin()->IsFaded();
|
sl@0
|
1004 |
TEST(retVal==Max(0,fadeCount));
|
sl@0
|
1005 |
if (retVal!=Max(0,fadeCount))
|
sl@0
|
1006 |
INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);
|
sl@0
|
1007 |
|
sl@0
|
1008 |
TestBlocks(rect,rectSize,15,ETrue);
|
sl@0
|
1009 |
win[ii][jj]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
1010 |
retVal = win[ii][jj]->BaseWin()->IsFaded();
|
sl@0
|
1011 |
TEST(retVal==Max(0,fadeCount));
|
sl@0
|
1012 |
if (retVal!=Max(0,fadeCount))
|
sl@0
|
1013 |
INFO_PRINTF3(_L("win[ii][jj]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), Max(0,fadeCount), retVal);
|
sl@0
|
1014 |
|
sl@0
|
1015 |
}
|
sl@0
|
1016 |
}
|
sl@0
|
1017 |
TestBlocks(rect,rectSize,0,ETrue);
|
sl@0
|
1018 |
if (Fade16(15)==15)
|
sl@0
|
1019 |
{
|
sl@0
|
1020 |
win[3][3]->BaseWin()->FadeBehind(ETrue); //All faded as the only unfaded one is white
|
sl@0
|
1021 |
for (ii=3;ii>=0;--ii)
|
sl@0
|
1022 |
{
|
sl@0
|
1023 |
retVal = win[ii][0]->BaseWin()->IsFaded();
|
sl@0
|
1024 |
TEST(retVal==1);
|
sl@0
|
1025 |
if (retVal!=1)
|
sl@0
|
1026 |
INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
|
sl@0
|
1027 |
|
sl@0
|
1028 |
retBool = !win[ii][1]->BaseWin()->IsNonFading();
|
sl@0
|
1029 |
TEST(retBool);
|
sl@0
|
1030 |
if (!retBool)
|
sl@0
|
1031 |
INFO_PRINTF3(_L("!win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1032 |
|
sl@0
|
1033 |
win[ii][0]->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
1034 |
retBool = win[ii][1]->BaseWin()->IsNonFading();
|
sl@0
|
1035 |
TEST(retBool);
|
sl@0
|
1036 |
if (!retBool)
|
sl@0
|
1037 |
INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1038 |
|
sl@0
|
1039 |
TestBlocks(rect,rectSize,4*ii,ETrue);
|
sl@0
|
1040 |
}
|
sl@0
|
1041 |
for (ii=3;ii>=0;--ii)
|
sl@0
|
1042 |
{
|
sl@0
|
1043 |
retVal = win[ii][0]->BaseWin()->IsFaded();
|
sl@0
|
1044 |
TEST(retVal==1);
|
sl@0
|
1045 |
if (retVal!=1)
|
sl@0
|
1046 |
INFO_PRINTF3(_L("win[ii][0]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), 1, retVal);
|
sl@0
|
1047 |
|
sl@0
|
1048 |
retBool = win[ii][1]->BaseWin()->IsNonFading();
|
sl@0
|
1049 |
TEST(retBool);
|
sl@0
|
1050 |
if (!retBool)
|
sl@0
|
1051 |
INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1052 |
|
sl@0
|
1053 |
win[ii][0]->WinTreeNode()->SetNonFading(EFalse);
|
sl@0
|
1054 |
retBool = !win[ii][1]->BaseWin()->IsNonFading();
|
sl@0
|
1055 |
TEST(retBool);
|
sl@0
|
1056 |
if (!retBool)
|
sl@0
|
1057 |
INFO_PRINTF3(_L("win[ii][1]->BaseWin()->IsNonFading() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1058 |
|
sl@0
|
1059 |
TestBlocks(rect,rectSize,4*ii);
|
sl@0
|
1060 |
}
|
sl@0
|
1061 |
win[3][3]->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
1062 |
}
|
sl@0
|
1063 |
for (ii=3;ii>=0;--ii)
|
sl@0
|
1064 |
{
|
sl@0
|
1065 |
for (jj=3;jj>=0;--jj)
|
sl@0
|
1066 |
{
|
sl@0
|
1067 |
if (ii+jj>0)
|
sl@0
|
1068 |
delete win[ii][jj];
|
sl@0
|
1069 |
}
|
sl@0
|
1070 |
}
|
sl@0
|
1071 |
}
|
sl@0
|
1072 |
|
sl@0
|
1073 |
void CTFade::ColorTest2()
|
sl@0
|
1074 |
{
|
sl@0
|
1075 |
#if defined(__MARM__)
|
sl@0
|
1076 |
return;
|
sl@0
|
1077 |
#else
|
sl@0
|
1078 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1079 |
TSize size=iTestWinSize;
|
sl@0
|
1080 |
#if defined(SMALL_RECTS)
|
sl@0
|
1081 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
1082 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
1083 |
#endif
|
sl@0
|
1084 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
1085 |
return;
|
sl@0
|
1086 |
TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
|
sl@0
|
1087 |
TUint8 bm;
|
sl@0
|
1088 |
TUint8 wm;
|
sl@0
|
1089 |
TInt test=0;
|
sl@0
|
1090 |
TInt ii;
|
sl@0
|
1091 |
FOREVER
|
sl@0
|
1092 |
{
|
sl@0
|
1093 |
TInt fadeMapFactor = 0;
|
sl@0
|
1094 |
TInt fadeMapOffset = 0;
|
sl@0
|
1095 |
|
sl@0
|
1096 |
switch (test)
|
sl@0
|
1097 |
{
|
sl@0
|
1098 |
case 0: //Nothing
|
sl@0
|
1099 |
bm=0;
|
sl@0
|
1100 |
wm=15;
|
sl@0
|
1101 |
break;
|
sl@0
|
1102 |
case 1: //Shadowing or Quartz fading
|
sl@0
|
1103 |
bm=0;
|
sl@0
|
1104 |
wm=7;
|
sl@0
|
1105 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1106 |
TheClient->iWs.SetDefaultFadingParameters(0,127);
|
sl@0
|
1107 |
fadeMapFactor = 128;
|
sl@0
|
1108 |
#else
|
sl@0
|
1109 |
TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),127);
|
sl@0
|
1110 |
fadeMapFactor = 127-STATIC_CAST(TUint8,bm*17);
|
sl@0
|
1111 |
#endif
|
sl@0
|
1112 |
break;
|
sl@0
|
1113 |
default:
|
sl@0
|
1114 |
TheClient->iWs.SetDefaultFadingParameters(BLACK_NORMAL,WHITE_NORMAL);
|
sl@0
|
1115 |
return;
|
sl@0
|
1116 |
}
|
sl@0
|
1117 |
if (wm!=7)
|
sl@0
|
1118 |
{
|
sl@0
|
1119 |
fadeMapOffset = STATIC_CAST(TUint8,bm*17);
|
sl@0
|
1120 |
fadeMapFactor = STATIC_CAST(TUint8,wm*17) - fadeMapOffset;
|
sl@0
|
1121 |
TheClient->iWs.SetDefaultFadingParameters(STATIC_CAST(TUint8,bm*17),STATIC_CAST(TUint8,wm*17));
|
sl@0
|
1122 |
}
|
sl@0
|
1123 |
|
sl@0
|
1124 |
for (ii=0;ii<16;ii+=5)
|
sl@0
|
1125 |
{
|
sl@0
|
1126 |
iBlankWin->SetColor(TRgb::Gray16(ii));
|
sl@0
|
1127 |
ViewDelay();
|
sl@0
|
1128 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1129 |
TBool retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1130 |
#else
|
sl@0
|
1131 |
TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1132 |
#endif
|
sl@0
|
1133 |
TEST(retBool);
|
sl@0
|
1134 |
if (!retBool)
|
sl@0
|
1135 |
{
|
sl@0
|
1136 |
_LIT(KLog,"Setting color on blank window failed mappings=%d color=%d");
|
sl@0
|
1137 |
LOG_MESSAGE3(KLog,test,ii);
|
sl@0
|
1138 |
}
|
sl@0
|
1139 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1140 |
ViewDelay();
|
sl@0
|
1141 |
|
sl@0
|
1142 |
TRgb col1 = FadeRgb(TRgb::Gray16(ii), fadeMapFactor, fadeMapOffset);
|
sl@0
|
1143 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1144 |
retBool=CheckBlankWindow(windowRect,col1,TheClient->iScreen);
|
sl@0
|
1145 |
#else
|
sl@0
|
1146 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
|
sl@0
|
1147 |
#endif
|
sl@0
|
1148 |
TEST(retBool);
|
sl@0
|
1149 |
if (!retBool)
|
sl@0
|
1150 |
{
|
sl@0
|
1151 |
_LIT(KLog,"Fading the window gave wrong color mappings=%d color=%d");
|
sl@0
|
1152 |
LOG_MESSAGE3(KLog,test,ii);
|
sl@0
|
1153 |
}
|
sl@0
|
1154 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1155 |
ViewDelay();
|
sl@0
|
1156 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1157 |
retBool=CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1158 |
#else
|
sl@0
|
1159 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1160 |
#endif
|
sl@0
|
1161 |
TEST(retBool);
|
sl@0
|
1162 |
if (!retBool)
|
sl@0
|
1163 |
{
|
sl@0
|
1164 |
_LIT(KLog,"Unfading the window gave wrong color mappings=%d color=%d");
|
sl@0
|
1165 |
LOG_MESSAGE3(KLog,test,ii);
|
sl@0
|
1166 |
}
|
sl@0
|
1167 |
}
|
sl@0
|
1168 |
++test;
|
sl@0
|
1169 |
}
|
sl@0
|
1170 |
#endif //__MARM__
|
sl@0
|
1171 |
}
|
sl@0
|
1172 |
|
sl@0
|
1173 |
void CTFade::FadeTest()
|
sl@0
|
1174 |
{
|
sl@0
|
1175 |
#if defined(__MARM__)
|
sl@0
|
1176 |
return;
|
sl@0
|
1177 |
#else
|
sl@0
|
1178 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1179 |
TSize size=iTestWinSize;
|
sl@0
|
1180 |
#if defined(SMALL_RECTS)
|
sl@0
|
1181 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
1182 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
1183 |
#endif
|
sl@0
|
1184 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
1185 |
return;
|
sl@0
|
1186 |
TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
|
sl@0
|
1187 |
TUint8 bm;
|
sl@0
|
1188 |
TUint8 wm;
|
sl@0
|
1189 |
TUint8 fb;
|
sl@0
|
1190 |
TUint8 fw;
|
sl@0
|
1191 |
TInt test=0;
|
sl@0
|
1192 |
TInt ii;
|
sl@0
|
1193 |
FOREVER
|
sl@0
|
1194 |
{
|
sl@0
|
1195 |
TInt fadeMapFactor = 0;
|
sl@0
|
1196 |
TInt fadeMapOffset = 0;
|
sl@0
|
1197 |
fw=0;
|
sl@0
|
1198 |
switch (test)
|
sl@0
|
1199 |
{
|
sl@0
|
1200 |
case 0: //Nothing
|
sl@0
|
1201 |
bm=0;
|
sl@0
|
1202 |
wm=15;
|
sl@0
|
1203 |
break;
|
sl@0
|
1204 |
case 1: //Shadowing or Quartz fading
|
sl@0
|
1205 |
|
sl@0
|
1206 |
bm=0;
|
sl@0
|
1207 |
wm=7;
|
sl@0
|
1208 |
fw=127;
|
sl@0
|
1209 |
break;
|
sl@0
|
1210 |
default:
|
sl@0
|
1211 |
return;
|
sl@0
|
1212 |
}
|
sl@0
|
1213 |
fb=STATIC_CAST(TUint8,17*bm);
|
sl@0
|
1214 |
if (!fw)
|
sl@0
|
1215 |
fw=STATIC_CAST(TUint8,17*wm);
|
sl@0
|
1216 |
fadeMapFactor = fw - fb;
|
sl@0
|
1217 |
fadeMapOffset = fb;
|
sl@0
|
1218 |
for (ii=0;ii<16;ii+=5)
|
sl@0
|
1219 |
{
|
sl@0
|
1220 |
iBlankWin->SetColor(TRgb::Gray16(ii));
|
sl@0
|
1221 |
ViewDelay();
|
sl@0
|
1222 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1223 |
TBool retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1224 |
#else
|
sl@0
|
1225 |
TBool retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1226 |
#endif
|
sl@0
|
1227 |
TEST(retBool);
|
sl@0
|
1228 |
if (!retBool)
|
sl@0
|
1229 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1230 |
|
sl@0
|
1231 |
TRgb col3 = TRgb::Gray16(ii).Internal();
|
sl@0
|
1232 |
TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
|
sl@0
|
1233 |
iBlankWin->BaseWin()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,fb,fw);
|
sl@0
|
1234 |
ViewDelay();
|
sl@0
|
1235 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1236 |
retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
|
sl@0
|
1237 |
#else
|
sl@0
|
1238 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
|
sl@0
|
1239 |
#endif
|
sl@0
|
1240 |
TEST(retBool);
|
sl@0
|
1241 |
if (!retBool)
|
sl@0
|
1242 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1243 |
|
sl@0
|
1244 |
iBlankWin->BaseWin()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1245 |
ViewDelay();
|
sl@0
|
1246 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1247 |
retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1248 |
#else
|
sl@0
|
1249 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1250 |
#endif
|
sl@0
|
1251 |
TEST(retBool);
|
sl@0
|
1252 |
if (!retBool)
|
sl@0
|
1253 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1254 |
|
sl@0
|
1255 |
}
|
sl@0
|
1256 |
++test;
|
sl@0
|
1257 |
}
|
sl@0
|
1258 |
#endif //__MARM__
|
sl@0
|
1259 |
}
|
sl@0
|
1260 |
|
sl@0
|
1261 |
void CTFade::Draw(TBool aAlternativeFade/*=EFalse*/)
|
sl@0
|
1262 |
{
|
sl@0
|
1263 |
__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1264 |
TRgb grey=TRgb::Gray4(2);
|
sl@0
|
1265 |
Draw(0,&grey,aAlternativeFade);
|
sl@0
|
1266 |
Draw(1,NULL,aAlternativeFade);
|
sl@0
|
1267 |
iContent=1;
|
sl@0
|
1268 |
CompareWithBitmap(EFalse);
|
sl@0
|
1269 |
if (aAlternativeFade)
|
sl@0
|
1270 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly,BLACK_ALTERNATE,WHITE_ALTERNATE);
|
sl@0
|
1271 |
else
|
sl@0
|
1272 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1273 |
CompareWithBitmap(ETrue);
|
sl@0
|
1274 |
Draw(3,NULL,aAlternativeFade);
|
sl@0
|
1275 |
iContent=2;
|
sl@0
|
1276 |
CompareWithBitmap(ETrue);
|
sl@0
|
1277 |
iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1278 |
CompareWithBitmap(EFalse);
|
sl@0
|
1279 |
}
|
sl@0
|
1280 |
|
sl@0
|
1281 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1282 |
void CTFade::GCDraw()
|
sl@0
|
1283 |
{
|
sl@0
|
1284 |
__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1285 |
TRgb grey=TRgb::Gray4(2);
|
sl@0
|
1286 |
TInt ii;
|
sl@0
|
1287 |
GCDraw(0,&grey);
|
sl@0
|
1288 |
GCDraw(3,NULL);
|
sl@0
|
1289 |
for (ii=3;ii<70;ii+=13)
|
sl@0
|
1290 |
GCDraw(2,&ii);
|
sl@0
|
1291 |
iContent=6;
|
sl@0
|
1292 |
CompareWindows();
|
sl@0
|
1293 |
GCDraw(0,&grey,ETrue);
|
sl@0
|
1294 |
GCDraw(3,NULL,ETrue);
|
sl@0
|
1295 |
for (ii=3;ii<70;ii+=13)
|
sl@0
|
1296 |
GCDraw(2,&ii,ETrue);
|
sl@0
|
1297 |
GCDraw(1,NULL,ETrue);
|
sl@0
|
1298 |
iContent=7;
|
sl@0
|
1299 |
CompareWindows(ETrue);
|
sl@0
|
1300 |
}
|
sl@0
|
1301 |
#endif // TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1302 |
|
sl@0
|
1303 |
void CTFade::ObscuredL()
|
sl@0
|
1304 |
{
|
sl@0
|
1305 |
CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
|
sl@0
|
1306 |
TRect windowRect(iWindowRect);
|
sl@0
|
1307 |
windowRect.Shrink(30,30);
|
sl@0
|
1308 |
blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
|
sl@0
|
1309 |
|
sl@0
|
1310 |
__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1311 |
TRgb grey=TRgb::Gray4(2);
|
sl@0
|
1312 |
Draw(0,&grey);
|
sl@0
|
1313 |
Draw(3,NULL);
|
sl@0
|
1314 |
iContent=3;
|
sl@0
|
1315 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1316 |
blankWin->SetVisible(EFalse);
|
sl@0
|
1317 |
CompareWithBitmap(ETrue);
|
sl@0
|
1318 |
blankWin->SetVisible(ETrue);
|
sl@0
|
1319 |
grey=TRgb::Gray4(1);
|
sl@0
|
1320 |
Draw(0,&grey);
|
sl@0
|
1321 |
for (TInt ii=1;ii<37;ii+=7)
|
sl@0
|
1322 |
Draw(2,&ii);
|
sl@0
|
1323 |
iContent=4;
|
sl@0
|
1324 |
blankWin->SetVisible(EFalse);
|
sl@0
|
1325 |
CompareWithBitmap(ETrue);
|
sl@0
|
1326 |
blankWin->SetVisible(ETrue);
|
sl@0
|
1327 |
iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1328 |
blankWin->SetVisible(EFalse);
|
sl@0
|
1329 |
CompareWithBitmap(EFalse);
|
sl@0
|
1330 |
|
sl@0
|
1331 |
delete blankWin;
|
sl@0
|
1332 |
}
|
sl@0
|
1333 |
|
sl@0
|
1334 |
void CTFade::MovingL()
|
sl@0
|
1335 |
{
|
sl@0
|
1336 |
CTBlankWindow* blankWin=new(ELeave) CTBlankWindow();
|
sl@0
|
1337 |
TRect windowRect(iWindowRect);
|
sl@0
|
1338 |
windowRect.Shrink(40,40);
|
sl@0
|
1339 |
blankWin->SetUpL(windowRect.iTl,windowRect.Size(),TheClient->iGroup,*TheClient->iGc);
|
sl@0
|
1340 |
|
sl@0
|
1341 |
__ASSERT_ALWAYS(iWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1342 |
TRgb grey=TRgb::Gray4(2);
|
sl@0
|
1343 |
Draw(0,&grey);
|
sl@0
|
1344 |
Draw(1,NULL);
|
sl@0
|
1345 |
for (TInt ii=2;ii<60;ii+=11)
|
sl@0
|
1346 |
Draw(2,&ii);
|
sl@0
|
1347 |
iContent=5;
|
sl@0
|
1348 |
blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
|
sl@0
|
1349 |
iWin->WinTreeNode()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1350 |
blankWin->SetPos(windowRect.iTl+TPoint(10,25));
|
sl@0
|
1351 |
blankWin->SetVisible(EFalse);
|
sl@0
|
1352 |
CompareWithBitmap(ETrue);
|
sl@0
|
1353 |
blankWin->SetVisible(ETrue);
|
sl@0
|
1354 |
blankWin->SetPos(windowRect.iTl+TPoint(25,-25));
|
sl@0
|
1355 |
iWin->WinTreeNode()->SetFaded(EFalse,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1356 |
blankWin->SetPos(windowRect.iTl+TPoint(-5,10));
|
sl@0
|
1357 |
blankWin->SetVisible(EFalse);
|
sl@0
|
1358 |
CompareWithBitmap(EFalse);
|
sl@0
|
1359 |
|
sl@0
|
1360 |
delete blankWin;
|
sl@0
|
1361 |
}
|
sl@0
|
1362 |
|
sl@0
|
1363 |
void CTFade::SystemFadeL()
|
sl@0
|
1364 |
{
|
sl@0
|
1365 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
1366 |
return;
|
sl@0
|
1367 |
|
sl@0
|
1368 |
CTBlankWindow* win[16];
|
sl@0
|
1369 |
TInt height=iTestWinSize.iHeight/16;
|
sl@0
|
1370 |
TRect rect(iWindowRect);
|
sl@0
|
1371 |
rect.SetHeight(height);
|
sl@0
|
1372 |
TInt ii;
|
sl@0
|
1373 |
for (ii=0;ii<16;++ii) //Causes memory leakage under OOM
|
sl@0
|
1374 |
{
|
sl@0
|
1375 |
win[ii]=new(ELeave) CTBlankWindow();
|
sl@0
|
1376 |
win[ii]->SetUpL(rect.iTl,rect.Size(),TheClient->iGroup,*TheClient->iGc);
|
sl@0
|
1377 |
win[ii]->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
1378 |
win[ii]->SetColor(TRgb::Gray16(ii));
|
sl@0
|
1379 |
rect.Move(0,height);
|
sl@0
|
1380 |
}
|
sl@0
|
1381 |
rect=iWindowRect;
|
sl@0
|
1382 |
rect.SetHeight(height);
|
sl@0
|
1383 |
#if defined(SMALL_RECTS)
|
sl@0
|
1384 |
TSize size(rect.Size());
|
sl@0
|
1385 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
1386 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
1387 |
rect.SetSize(size);
|
sl@0
|
1388 |
#endif
|
sl@0
|
1389 |
|
sl@0
|
1390 |
TBool retBool;
|
sl@0
|
1391 |
|
sl@0
|
1392 |
// system fade on
|
sl@0
|
1393 |
TheClient->iWs.SetSystemFaded(ETrue);
|
sl@0
|
1394 |
for (ii=0;ii<16;++ii)
|
sl@0
|
1395 |
{
|
sl@0
|
1396 |
retBool = win[ii]->BaseWin()->IsFaded();
|
sl@0
|
1397 |
TEST(retBool);
|
sl@0
|
1398 |
if (!retBool)
|
sl@0
|
1399 |
INFO_PRINTF3(_L("win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1400 |
}
|
sl@0
|
1401 |
TestStrips(rect,height,0);
|
sl@0
|
1402 |
|
sl@0
|
1403 |
// system fade off
|
sl@0
|
1404 |
TheClient->iWs.SetSystemFaded(EFalse);
|
sl@0
|
1405 |
for (ii=0;ii<16;++ii)
|
sl@0
|
1406 |
{
|
sl@0
|
1407 |
retBool = !win[ii]->BaseWin()->IsFaded();
|
sl@0
|
1408 |
TEST(retBool);
|
sl@0
|
1409 |
if (!retBool)
|
sl@0
|
1410 |
INFO_PRINTF3(_L("!win[ii]->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1411 |
}
|
sl@0
|
1412 |
TestStrips(rect,height,16);
|
sl@0
|
1413 |
|
sl@0
|
1414 |
// Now with half non fading
|
sl@0
|
1415 |
for (ii=8;ii<16;++ii)
|
sl@0
|
1416 |
win[ii]->WinTreeNode()->SetNonFading(ETrue);
|
sl@0
|
1417 |
|
sl@0
|
1418 |
// system fade on
|
sl@0
|
1419 |
TheClient->iWs.SetSystemFaded(ETrue);
|
sl@0
|
1420 |
TestStrips(rect,height,8,ETrue);
|
sl@0
|
1421 |
|
sl@0
|
1422 |
// system fade off
|
sl@0
|
1423 |
TheClient->iWs.SetSystemFaded(EFalse);
|
sl@0
|
1424 |
TestStrips(rect,height,16);
|
sl@0
|
1425 |
|
sl@0
|
1426 |
for (ii=0;ii<16;++ii)
|
sl@0
|
1427 |
delete win[ii];
|
sl@0
|
1428 |
}
|
sl@0
|
1429 |
|
sl@0
|
1430 |
void CTFade::SystemAlternateFadeL()
|
sl@0
|
1431 |
{
|
sl@0
|
1432 |
#if defined(__MARM__)
|
sl@0
|
1433 |
return;
|
sl@0
|
1434 |
#else
|
sl@0
|
1435 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1436 |
TSize size=iTestWinSize;
|
sl@0
|
1437 |
#if defined(SMALL_RECTS)
|
sl@0
|
1438 |
size.iWidth=Min(SIZE_X,size.iWidth);
|
sl@0
|
1439 |
size.iHeight=Min(SIZE_Y,size.iHeight);
|
sl@0
|
1440 |
#endif
|
sl@0
|
1441 |
if (MaxGrays()==0 && MaxColors()<256)
|
sl@0
|
1442 |
return;
|
sl@0
|
1443 |
TRect windowRect(iBlankWin->BaseWin()->InquireOffset(*TheClient->iGroup->WinTreeNode()),size);
|
sl@0
|
1444 |
TUint8 bm;
|
sl@0
|
1445 |
TUint8 wm;
|
sl@0
|
1446 |
TUint8 fb;
|
sl@0
|
1447 |
TUint8 fw;
|
sl@0
|
1448 |
TInt wb;
|
sl@0
|
1449 |
TInt add;
|
sl@0
|
1450 |
TInt test=0;
|
sl@0
|
1451 |
TInt ii;
|
sl@0
|
1452 |
TBool retBool;
|
sl@0
|
1453 |
FOREVER
|
sl@0
|
1454 |
{
|
sl@0
|
1455 |
TInt fadeMapFactor = 0;
|
sl@0
|
1456 |
TInt fadeMapOffset = 0;
|
sl@0
|
1457 |
fw=0;
|
sl@0
|
1458 |
switch (test)
|
sl@0
|
1459 |
{
|
sl@0
|
1460 |
case 0: //Nothing
|
sl@0
|
1461 |
bm=0;
|
sl@0
|
1462 |
wm=15;
|
sl@0
|
1463 |
break;
|
sl@0
|
1464 |
case 1: //Shadowing or Quartz fading
|
sl@0
|
1465 |
bm=0;
|
sl@0
|
1466 |
wm=7;
|
sl@0
|
1467 |
fw=127;
|
sl@0
|
1468 |
break;
|
sl@0
|
1469 |
default:
|
sl@0
|
1470 |
return;
|
sl@0
|
1471 |
}
|
sl@0
|
1472 |
wb=wm-bm;
|
sl@0
|
1473 |
add=15*bm+7;
|
sl@0
|
1474 |
fb=STATIC_CAST(TUint8,17*bm);
|
sl@0
|
1475 |
if (!fw)
|
sl@0
|
1476 |
fw=STATIC_CAST(TUint8,17*wm);
|
sl@0
|
1477 |
fadeMapFactor = fw - fb;
|
sl@0
|
1478 |
fadeMapOffset = fb;
|
sl@0
|
1479 |
for (ii=0;ii<16;ii+=5)
|
sl@0
|
1480 |
{
|
sl@0
|
1481 |
iBlankWin->SetColor(TRgb::Gray16(ii));
|
sl@0
|
1482 |
ViewDelay();
|
sl@0
|
1483 |
TheClient->iWs.Finish();
|
sl@0
|
1484 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1485 |
retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1486 |
#else
|
sl@0
|
1487 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1488 |
#endif
|
sl@0
|
1489 |
TEST(retBool);
|
sl@0
|
1490 |
if (!retBool)
|
sl@0
|
1491 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1492 |
|
sl@0
|
1493 |
TheClient->iWs.SetSystemFaded(ETrue,fb,fw);
|
sl@0
|
1494 |
ViewDelay();
|
sl@0
|
1495 |
|
sl@0
|
1496 |
TRgb col3 = TRgb::Gray16(ii).Internal();
|
sl@0
|
1497 |
TRgb col1 = FadeRgb(col3, fadeMapFactor, fadeMapOffset);
|
sl@0
|
1498 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1499 |
retBool = CheckBlankWindow(windowRect,col1,TheClient->iScreen);
|
sl@0
|
1500 |
#else
|
sl@0
|
1501 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, col1);
|
sl@0
|
1502 |
#endif
|
sl@0
|
1503 |
TEST(retBool);
|
sl@0
|
1504 |
if (!retBool)
|
sl@0
|
1505 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16((ii*wb+add)/15),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1506 |
|
sl@0
|
1507 |
TheClient->iWs.SetSystemFaded(EFalse);
|
sl@0
|
1508 |
ViewDelay();
|
sl@0
|
1509 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1510 |
retBool = CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen);
|
sl@0
|
1511 |
#else
|
sl@0
|
1512 |
retBool = LossyCheckBlankWindow(*TheClient->iScreen, *iTestWinCopy, windowRect, TRgb::Gray16(ii));
|
sl@0
|
1513 |
#endif
|
sl@0
|
1514 |
TEST(retBool);
|
sl@0
|
1515 |
if (!retBool)
|
sl@0
|
1516 |
INFO_PRINTF3(_L("CheckBlankWindow(windowRect,TRgb::Gray16(ii),TheClient->iScreen) return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1517 |
}
|
sl@0
|
1518 |
++test;
|
sl@0
|
1519 |
}
|
sl@0
|
1520 |
#endif //__MARM__
|
sl@0
|
1521 |
}
|
sl@0
|
1522 |
|
sl@0
|
1523 |
void CTFade::FadeBehindWhenMovedL()
|
sl@0
|
1524 |
{
|
sl@0
|
1525 |
__ASSERT_ALWAYS(iBlankWin,AutoPanic(EAutoFadeWindow));
|
sl@0
|
1526 |
TDisplayMode displayMode=iBlankWin->BaseWin()->DisplayMode();
|
sl@0
|
1527 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
1528 |
iBlankWin->SetColor(TRgb::Gray16(1));
|
sl@0
|
1529 |
TSize size(iTestWinSize.iHeight/4,iTestWinSize.iWidth/4);
|
sl@0
|
1530 |
CTBlankWindow* blankWinTemp=new(ELeave) CTBlankWindow();
|
sl@0
|
1531 |
CleanupStack::PushL(blankWinTemp);
|
sl@0
|
1532 |
blankWinTemp->SetUpL(TPoint(5,5),size,iBlankWin,*TheClient->iGc);
|
sl@0
|
1533 |
blankWinTemp->BaseWin()->SetRequiredDisplayMode(EGray16);
|
sl@0
|
1534 |
blankWinTemp->SetColor(TRgb::Gray16(15));
|
sl@0
|
1535 |
blankWinTemp->BaseWin()->FadeBehind(ETrue);
|
sl@0
|
1536 |
TheClient->Flush();
|
sl@0
|
1537 |
blankWinTemp->SetPos(TPoint(5,120));
|
sl@0
|
1538 |
//Check whether the back window is faded or not
|
sl@0
|
1539 |
TBool retBool = iBlankWin->BaseWin()->IsFaded();
|
sl@0
|
1540 |
TEST(retBool);
|
sl@0
|
1541 |
if (!retBool)
|
sl@0
|
1542 |
INFO_PRINTF3(_L("iBlankWin->BaseWin()->IsFaded() return value - Expected: %d, Actual: %d"), ETrue, retBool);
|
sl@0
|
1543 |
|
sl@0
|
1544 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
1545 |
CheckRect(iWindowRect.iTl+TPoint(5,5),iWindowRect.iTl+TPoint(75,5),size,_L("CTFade::FadeBehindWhenMovedL()"));
|
sl@0
|
1546 |
#else
|
sl@0
|
1547 |
TInt res = LossyCompareWindow(*TheClient->iScreen, *iTestWinCopy, *iCheckWinCopy, TRect(iWindowRect.iTl+TPoint(75,5),size));
|
sl@0
|
1548 |
TEST(res);
|
sl@0
|
1549 |
#endif
|
sl@0
|
1550 |
|
sl@0
|
1551 |
//Check whether the area behind the moved window and any other area on same window are identical
|
sl@0
|
1552 |
blankWinTemp->BaseWin()->FadeBehind(EFalse);
|
sl@0
|
1553 |
iBlankWin->BaseWin()->SetRequiredDisplayMode(displayMode);
|
sl@0
|
1554 |
CleanupStack::PopAndDestroy(blankWinTemp);
|
sl@0
|
1555 |
}
|
sl@0
|
1556 |
|
sl@0
|
1557 |
void CTFade::FadeBehindTransparentWindowL()
|
sl@0
|
1558 |
{
|
sl@0
|
1559 |
const TInt KNumberOfWindows = 3;
|
sl@0
|
1560 |
CRedrawWin* win[KNumberOfWindows];
|
sl@0
|
1561 |
TRect rect(iWindowRect);
|
sl@0
|
1562 |
rect.Resize(-iWindowRect.Width()/3,-iWindowRect.Height()/3);
|
sl@0
|
1563 |
rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/5);
|
sl@0
|
1564 |
TRect rectWin[KNumberOfWindows];
|
sl@0
|
1565 |
|
sl@0
|
1566 |
for (TInt ii=0; ii<KNumberOfWindows; ++ii) //Causes memory leakage under OOM
|
sl@0
|
1567 |
{
|
sl@0
|
1568 |
rectWin[ii] = rect;
|
sl@0
|
1569 |
win[ii]=new(ELeave) CRedrawWin(this);
|
sl@0
|
1570 |
win[ii]->ConstructExtLD(*TheClient->iGroup,rectWin[ii].iTl,rectWin[ii].Size());
|
sl@0
|
1571 |
win[ii]->AssignGC(*TheClient->iGc);
|
sl@0
|
1572 |
win[ii]->Win()->EnableRedrawStore(EFalse);
|
sl@0
|
1573 |
win[ii]->BaseWin()->SetRequiredDisplayMode(EColor16MA);
|
sl@0
|
1574 |
if (ii==0)
|
sl@0
|
1575 |
{
|
sl@0
|
1576 |
win[ii]->Win()->SetBackgroundColor(TRgb(200,0,0,255));
|
sl@0
|
1577 |
}
|
sl@0
|
1578 |
else
|
sl@0
|
1579 |
{
|
sl@0
|
1580 |
TEST(KErrNone == win[ii]->Win()->SetTransparencyAlphaChannel());
|
sl@0
|
1581 |
if (iStep->TestStepResult() != EPass)
|
sl@0
|
1582 |
{
|
sl@0
|
1583 |
INFO_PRINTF1(_L("Transparency Alpha channel failed to be enabled"));
|
sl@0
|
1584 |
}
|
sl@0
|
1585 |
win[ii]->Win()->SetBackgroundColor(TRgb(40,100,0,0)); //RGB colour is of minor importance, as the window is fully transparent (Alpha=0)
|
sl@0
|
1586 |
}
|
sl@0
|
1587 |
win[ii]->Activate();
|
sl@0
|
1588 |
|
sl@0
|
1589 |
//Make sure each window is drawn to the screen now when the new background
|
sl@0
|
1590 |
//colour have been set but before the call to SetFaded
|
sl@0
|
1591 |
win[ii]->Win()->BeginRedraw();
|
sl@0
|
1592 |
win[ii]->Win()->EndRedraw();
|
sl@0
|
1593 |
|
sl@0
|
1594 |
rect.Resize(0,-iWindowRect.Height()/10);
|
sl@0
|
1595 |
rect.Move(iWindowRect.Width()/10,iWindowRect.Height()/20);
|
sl@0
|
1596 |
}
|
sl@0
|
1597 |
TheClient->iWs.Flush();
|
sl@0
|
1598 |
TheClient->iWs.Finish();
|
sl@0
|
1599 |
|
sl@0
|
1600 |
win[0]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1601 |
win[1]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1602 |
win[2]->Win()->SetFaded(ETrue,RWindowTreeNode::EFadeWindowOnly);
|
sl@0
|
1603 |
|
sl@0
|
1604 |
TheClient->iWs.Flush();
|
sl@0
|
1605 |
TheClient->iWs.Finish();
|
sl@0
|
1606 |
|
sl@0
|
1607 |
// As the windows ovelap on their left side, compare the top left corners of the faded windows in order to verify that
|
sl@0
|
1608 |
// for the opaque window the directly on top faded area and the faded area under the transparent window (the area that
|
sl@0
|
1609 |
// overlaps with the transparent windows) have the same colour.
|
sl@0
|
1610 |
TRgb rgbWin[KNumberOfWindows];
|
sl@0
|
1611 |
TheClient->iScreen->GetPixel(rgbWin[0], rectWin[0].iTl);
|
sl@0
|
1612 |
TheClient->iScreen->GetPixel(rgbWin[1], rectWin[1].iTl);
|
sl@0
|
1613 |
TheClient->iScreen->GetPixel(rgbWin[2], rectWin[2].iTl);
|
sl@0
|
1614 |
|
sl@0
|
1615 |
TEST( ETrue == (rgbWin[0].Red()==rgbWin[1].Red())&&(rgbWin[0].Green()==rgbWin[1].Green())&&(rgbWin[0].Blue()==rgbWin[1].Blue()) );
|
sl@0
|
1616 |
TEST( ETrue == (rgbWin[0].Red()==rgbWin[2].Red())&&(rgbWin[0].Green()==rgbWin[2].Green())&&(rgbWin[0].Blue()==rgbWin[2].Blue()) );
|
sl@0
|
1617 |
|
sl@0
|
1618 |
for (TInt ii=0; ii<KNumberOfWindows; ++ii)
|
sl@0
|
1619 |
{
|
sl@0
|
1620 |
delete win[ii];
|
sl@0
|
1621 |
}
|
sl@0
|
1622 |
}
|
sl@0
|
1623 |
|
sl@0
|
1624 |
#define BACKUPWIN 11
|
sl@0
|
1625 |
#define REDRAWWIN 20
|
sl@0
|
1626 |
void CTFade::RunTestCaseL(TInt /*aCurTestCase*/)
|
sl@0
|
1627 |
{
|
sl@0
|
1628 |
((CTFadeStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
|
sl@0
|
1629 |
switch(++iTest->iState)
|
sl@0
|
1630 |
{
|
sl@0
|
1631 |
/**
|
sl@0
|
1632 |
@SYMTestCaseID GRAPHICS-WSERV-0218
|
sl@0
|
1633 |
|
sl@0
|
1634 |
@SYMDEF DEF081259
|
sl@0
|
1635 |
|
sl@0
|
1636 |
@SYMTestCaseDesc Test fading colours in windows
|
sl@0
|
1637 |
|
sl@0
|
1638 |
@SYMTestPriority High
|
sl@0
|
1639 |
|
sl@0
|
1640 |
@SYMTestStatus Implemented
|
sl@0
|
1641 |
|
sl@0
|
1642 |
@SYMTestActions Fade the colours in windows and check they fade correctly
|
sl@0
|
1643 |
|
sl@0
|
1644 |
@SYMTestExpectedResults Colour fade correctly
|
sl@0
|
1645 |
*/
|
sl@0
|
1646 |
case 1:
|
sl@0
|
1647 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0218"));
|
sl@0
|
1648 |
iTest->LogSubTest(_L("Color Check"));
|
sl@0
|
1649 |
CreateBlankWindowL();
|
sl@0
|
1650 |
ColorTest();
|
sl@0
|
1651 |
//iTest->iState=5;
|
sl@0
|
1652 |
break;
|
sl@0
|
1653 |
/**
|
sl@0
|
1654 |
@SYMTestCaseID GRAPHICS-WSERV-0219
|
sl@0
|
1655 |
|
sl@0
|
1656 |
@SYMDEF DEF081259
|
sl@0
|
1657 |
|
sl@0
|
1658 |
@SYMTestCaseDesc Test fading in a blank window
|
sl@0
|
1659 |
|
sl@0
|
1660 |
@SYMTestPriority High
|
sl@0
|
1661 |
|
sl@0
|
1662 |
@SYMTestStatus Implemented
|
sl@0
|
1663 |
|
sl@0
|
1664 |
@SYMTestActions Fade in a blank window and check the fading occurs correctly
|
sl@0
|
1665 |
|
sl@0
|
1666 |
@SYMTestExpectedResults Fading in a blank window occurs correctly
|
sl@0
|
1667 |
*/
|
sl@0
|
1668 |
case 2:
|
sl@0
|
1669 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0219"));
|
sl@0
|
1670 |
iTest->LogSubTest(_L("Blank Window"));
|
sl@0
|
1671 |
BlankWindowL();
|
sl@0
|
1672 |
break;
|
sl@0
|
1673 |
/**
|
sl@0
|
1674 |
@SYMTestCaseID GRAPHICS-WSERV-0220
|
sl@0
|
1675 |
|
sl@0
|
1676 |
@SYMDEF DEF081259
|
sl@0
|
1677 |
|
sl@0
|
1678 |
@SYMTestCaseDesc Test fading in child windows
|
sl@0
|
1679 |
|
sl@0
|
1680 |
@SYMTestPriority High
|
sl@0
|
1681 |
|
sl@0
|
1682 |
@SYMTestStatus Implemented
|
sl@0
|
1683 |
|
sl@0
|
1684 |
@SYMTestActions Fade in child windows and check the fading occurs correctly
|
sl@0
|
1685 |
|
sl@0
|
1686 |
@SYMTestExpectedResults Fading in the child windows occurs correctly
|
sl@0
|
1687 |
*/
|
sl@0
|
1688 |
case 3:
|
sl@0
|
1689 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0220"));
|
sl@0
|
1690 |
iTest->LogSubTest(_L("Fade Children"));
|
sl@0
|
1691 |
FadeChildrenL();
|
sl@0
|
1692 |
break;
|
sl@0
|
1693 |
/**
|
sl@0
|
1694 |
@SYMTestCaseID GRAPHICS-WSERV-0221
|
sl@0
|
1695 |
|
sl@0
|
1696 |
@SYMDEF DEF081259
|
sl@0
|
1697 |
|
sl@0
|
1698 |
@SYMTestCaseDesc Test fading in newly created child windows
|
sl@0
|
1699 |
|
sl@0
|
1700 |
@SYMTestPriority High
|
sl@0
|
1701 |
|
sl@0
|
1702 |
@SYMTestStatus Implemented
|
sl@0
|
1703 |
|
sl@0
|
1704 |
@SYMTestActions Fade in newly created child windows and check the fading occurs correctly
|
sl@0
|
1705 |
|
sl@0
|
1706 |
@SYMTestExpectedResults Fading in the newly created child windows occurs correctly
|
sl@0
|
1707 |
*/
|
sl@0
|
1708 |
case 4:
|
sl@0
|
1709 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0221"));
|
sl@0
|
1710 |
iTest->LogSubTest(_L("Fade Children newly created"));
|
sl@0
|
1711 |
FadeChildrenAfterNewChildIsCreatedL();
|
sl@0
|
1712 |
break;
|
sl@0
|
1713 |
/**
|
sl@0
|
1714 |
@SYMTestCaseID GRAPHICS-WSERV-0222
|
sl@0
|
1715 |
|
sl@0
|
1716 |
@SYMDEF DEF081259
|
sl@0
|
1717 |
|
sl@0
|
1718 |
@SYMTestCaseDesc Test fading in window behind another window
|
sl@0
|
1719 |
|
sl@0
|
1720 |
@SYMTestPriority High
|
sl@0
|
1721 |
|
sl@0
|
1722 |
@SYMTestStatus Implemented
|
sl@0
|
1723 |
|
sl@0
|
1724 |
@SYMTestActions Fade in window behind another window and check the fading occurs correctly
|
sl@0
|
1725 |
|
sl@0
|
1726 |
@SYMTestExpectedResults Fading in window occurs correctly
|
sl@0
|
1727 |
*/
|
sl@0
|
1728 |
case 5:
|
sl@0
|
1729 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0222"));
|
sl@0
|
1730 |
iTest->LogSubTest(_L("Fade Behind"));
|
sl@0
|
1731 |
FadeBehindL();
|
sl@0
|
1732 |
break;
|
sl@0
|
1733 |
/**
|
sl@0
|
1734 |
@SYMTestCaseID GRAPHICS-WSERV-0223
|
sl@0
|
1735 |
|
sl@0
|
1736 |
@SYMDEF DEF081259
|
sl@0
|
1737 |
|
sl@0
|
1738 |
@SYMTestCaseDesc Test differnt fading techniques in a window
|
sl@0
|
1739 |
|
sl@0
|
1740 |
@SYMTestPriority High
|
sl@0
|
1741 |
|
sl@0
|
1742 |
@SYMTestStatus Implemented
|
sl@0
|
1743 |
|
sl@0
|
1744 |
@SYMTestActions Fade using different fading techniques in a window
|
sl@0
|
1745 |
and check the fading occurs correctly
|
sl@0
|
1746 |
|
sl@0
|
1747 |
@SYMTestExpectedResults Fading in window occurs correctly
|
sl@0
|
1748 |
*/
|
sl@0
|
1749 |
case 6:
|
sl@0
|
1750 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0223"));
|
sl@0
|
1751 |
#if(defined(__DISPLAY_MODE_64K_COLOR)) //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
|
sl@0
|
1752 |
iTest->LogSubTest(_L("Alternative Fadings1"));
|
sl@0
|
1753 |
ColorTest2();
|
sl@0
|
1754 |
#else
|
sl@0
|
1755 |
LOG_MESSAGE(_L("Alternative Fadings1 test not run"));
|
sl@0
|
1756 |
#endif
|
sl@0
|
1757 |
break;
|
sl@0
|
1758 |
/**
|
sl@0
|
1759 |
@SYMTestCaseID GRAPHICS-WSERV-0224
|
sl@0
|
1760 |
|
sl@0
|
1761 |
@SYMDEF DEF081259
|
sl@0
|
1762 |
|
sl@0
|
1763 |
@SYMTestCaseDesc Test differnt fading techniques in a window
|
sl@0
|
1764 |
|
sl@0
|
1765 |
@SYMTestPriority High
|
sl@0
|
1766 |
|
sl@0
|
1767 |
@SYMTestStatus Implemented
|
sl@0
|
1768 |
|
sl@0
|
1769 |
@SYMTestActions Fade using different fading techniques in a window
|
sl@0
|
1770 |
and check the fading occurs correctly
|
sl@0
|
1771 |
|
sl@0
|
1772 |
@SYMTestExpectedResults Fading in window occurs correctly
|
sl@0
|
1773 |
*/
|
sl@0
|
1774 |
case 7:
|
sl@0
|
1775 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0224"));
|
sl@0
|
1776 |
#if(defined(__DISPLAY_MODE_64K_COLOR)) //The test case Alternative Fadings1&2 & System Fade are not executed for EColor64k
|
sl@0
|
1777 |
iTest->LogSubTest(_L("Alternative Fadings2"));
|
sl@0
|
1778 |
FadeTest();
|
sl@0
|
1779 |
#else
|
sl@0
|
1780 |
LOG_MESSAGE(_L("Alternative Fadings2 test not run"));
|
sl@0
|
1781 |
#endif
|
sl@0
|
1782 |
break;
|
sl@0
|
1783 |
/**
|
sl@0
|
1784 |
@SYMTestCaseID GRAPHICS-WSERV-0225
|
sl@0
|
1785 |
|
sl@0
|
1786 |
@SYMDEF DEF081259
|
sl@0
|
1787 |
|
sl@0
|
1788 |
@SYMTestCaseDesc Test differnt system wide fading techniques in a window
|
sl@0
|
1789 |
|
sl@0
|
1790 |
@SYMTestPriority High
|
sl@0
|
1791 |
|
sl@0
|
1792 |
@SYMTestStatus Implemented
|
sl@0
|
1793 |
|
sl@0
|
1794 |
@SYMTestActions Fade using different system wide fading techniques in a window
|
sl@0
|
1795 |
and check the fading occurs correctly
|
sl@0
|
1796 |
|
sl@0
|
1797 |
@SYMTestExpectedResults Fading in system occurs correctly
|
sl@0
|
1798 |
*/
|
sl@0
|
1799 |
case 8:
|
sl@0
|
1800 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0225"));
|
sl@0
|
1801 |
iTest->LogSubTest(_L("System Fade"));
|
sl@0
|
1802 |
SystemFadeL();
|
sl@0
|
1803 |
SystemAlternateFadeL();
|
sl@0
|
1804 |
break;
|
sl@0
|
1805 |
/**
|
sl@0
|
1806 |
@SYMTestCaseID GRAPHICS-WSERV-0226
|
sl@0
|
1807 |
|
sl@0
|
1808 |
@SYMDEF DEF081259
|
sl@0
|
1809 |
|
sl@0
|
1810 |
@SYMTestCaseDesc Test fading in window behind another window when the window has been moved
|
sl@0
|
1811 |
|
sl@0
|
1812 |
@SYMTestPriority High
|
sl@0
|
1813 |
|
sl@0
|
1814 |
@SYMTestStatus Implemented
|
sl@0
|
1815 |
|
sl@0
|
1816 |
@SYMTestActions Fade in window behind another window and check the fading occurs correctly
|
sl@0
|
1817 |
|
sl@0
|
1818 |
@SYMTestExpectedResults Fading in window occurs correctly
|
sl@0
|
1819 |
*/
|
sl@0
|
1820 |
case 9:
|
sl@0
|
1821 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0226"));
|
sl@0
|
1822 |
iTest->LogSubTest(_L("Fade behind moved"));
|
sl@0
|
1823 |
FadeBehindWhenMovedL();
|
sl@0
|
1824 |
break;
|
sl@0
|
1825 |
/**
|
sl@0
|
1826 |
@SYMTestCaseID GRAPHICS-WSERV-0227
|
sl@0
|
1827 |
|
sl@0
|
1828 |
@SYMDEF DEF081259
|
sl@0
|
1829 |
|
sl@0
|
1830 |
@SYMTestCaseDesc Destroy the blnk window used for fading
|
sl@0
|
1831 |
|
sl@0
|
1832 |
@SYMTestPriority High
|
sl@0
|
1833 |
|
sl@0
|
1834 |
@SYMTestStatus Implemented
|
sl@0
|
1835 |
|
sl@0
|
1836 |
@SYMTestActions Destroy the blnk window used for fading and check it was deleted correctly
|
sl@0
|
1837 |
|
sl@0
|
1838 |
@SYMTestExpectedResults The window is destroyed
|
sl@0
|
1839 |
*/
|
sl@0
|
1840 |
case 10:
|
sl@0
|
1841 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0227"));
|
sl@0
|
1842 |
DestroyBlankWindow();
|
sl@0
|
1843 |
break;
|
sl@0
|
1844 |
/**
|
sl@0
|
1845 |
@SYMTestCaseID GRAPHICS-WSERV-0228
|
sl@0
|
1846 |
|
sl@0
|
1847 |
@SYMDEF DEF081259
|
sl@0
|
1848 |
|
sl@0
|
1849 |
@SYMTestCaseDesc Test backup window creation and drawing
|
sl@0
|
1850 |
|
sl@0
|
1851 |
@SYMTestPriority High
|
sl@0
|
1852 |
|
sl@0
|
1853 |
@SYMTestStatus Implemented
|
sl@0
|
1854 |
|
sl@0
|
1855 |
@SYMTestActions Create a backup window and draw in it
|
sl@0
|
1856 |
|
sl@0
|
1857 |
@SYMTestExpectedResults The drawing is correct in the window
|
sl@0
|
1858 |
*/
|
sl@0
|
1859 |
case BACKUPWIN:
|
sl@0
|
1860 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0228"));
|
sl@0
|
1861 |
iTest->LogSubTest(_L("BackupWin Draw"));
|
sl@0
|
1862 |
CreateBitmapsL();
|
sl@0
|
1863 |
CreateBackupWindowL(EFalse);
|
sl@0
|
1864 |
Draw();
|
sl@0
|
1865 |
break;
|
sl@0
|
1866 |
/**
|
sl@0
|
1867 |
@SYMTestCaseID GRAPHICS-WSERV-0229
|
sl@0
|
1868 |
|
sl@0
|
1869 |
@SYMDEF DEF081259
|
sl@0
|
1870 |
|
sl@0
|
1871 |
@SYMTestCaseDesc Test fading with backup window obscured
|
sl@0
|
1872 |
|
sl@0
|
1873 |
@SYMTestPriority High
|
sl@0
|
1874 |
|
sl@0
|
1875 |
@SYMTestStatus Implemented
|
sl@0
|
1876 |
|
sl@0
|
1877 |
@SYMTestActions Test fading with the backup window obscured
|
sl@0
|
1878 |
|
sl@0
|
1879 |
@SYMTestExpectedResults Fading occurs correctly with window obscured
|
sl@0
|
1880 |
*/
|
sl@0
|
1881 |
case BACKUPWIN+1:
|
sl@0
|
1882 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0229"));
|
sl@0
|
1883 |
iTest->LogSubTest(_L("BackupWin Obscured"));
|
sl@0
|
1884 |
ObscuredL();
|
sl@0
|
1885 |
break;
|
sl@0
|
1886 |
/**
|
sl@0
|
1887 |
@SYMTestCaseID GRAPHICS-WSERV-0230
|
sl@0
|
1888 |
|
sl@0
|
1889 |
@SYMDEF DEF081259
|
sl@0
|
1890 |
|
sl@0
|
1891 |
@SYMTestCaseDesc Test fading with backup window being moved
|
sl@0
|
1892 |
|
sl@0
|
1893 |
@SYMTestPriority High
|
sl@0
|
1894 |
|
sl@0
|
1895 |
@SYMTestStatus Implemented
|
sl@0
|
1896 |
|
sl@0
|
1897 |
@SYMTestActions Test fading with the backup window being moved
|
sl@0
|
1898 |
|
sl@0
|
1899 |
@SYMTestExpectedResults Fading occurs correctly with window moved
|
sl@0
|
1900 |
*/
|
sl@0
|
1901 |
case BACKUPWIN+2:
|
sl@0
|
1902 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0230"));
|
sl@0
|
1903 |
iTest->LogSubTest(_L("BackupWin Moving"));
|
sl@0
|
1904 |
MovingL();
|
sl@0
|
1905 |
DestroyDrawableWindow();
|
sl@0
|
1906 |
break;
|
sl@0
|
1907 |
/**
|
sl@0
|
1908 |
@SYMTestCaseID GRAPHICS-WSERV-0231
|
sl@0
|
1909 |
|
sl@0
|
1910 |
@SYMDEF DEF081259
|
sl@0
|
1911 |
|
sl@0
|
1912 |
@SYMTestCaseDesc Test backup window creation and drawing
|
sl@0
|
1913 |
|
sl@0
|
1914 |
@SYMTestPriority High
|
sl@0
|
1915 |
|
sl@0
|
1916 |
@SYMTestStatus Implemented
|
sl@0
|
1917 |
|
sl@0
|
1918 |
@SYMTestActions Create a backup window and draw in it
|
sl@0
|
1919 |
|
sl@0
|
1920 |
@SYMTestExpectedResults The drawing is correct in the window
|
sl@0
|
1921 |
*/
|
sl@0
|
1922 |
case BACKUPWIN+3:
|
sl@0
|
1923 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0231"));
|
sl@0
|
1924 |
iTest->LogSubTest(_L("BackupWin Draw"));
|
sl@0
|
1925 |
CreateBackupWindowL(ETrue);
|
sl@0
|
1926 |
Draw();
|
sl@0
|
1927 |
break;
|
sl@0
|
1928 |
/**
|
sl@0
|
1929 |
@SYMTestCaseID GRAPHICS-WSERV-0232
|
sl@0
|
1930 |
|
sl@0
|
1931 |
@SYMDEF DEF081259
|
sl@0
|
1932 |
|
sl@0
|
1933 |
@SYMTestCaseDesc Test fading with backup window obscured
|
sl@0
|
1934 |
|
sl@0
|
1935 |
@SYMTestPriority High
|
sl@0
|
1936 |
|
sl@0
|
1937 |
@SYMTestStatus Implemented
|
sl@0
|
1938 |
|
sl@0
|
1939 |
@SYMTestActions Test fading with the backup window obscured
|
sl@0
|
1940 |
|
sl@0
|
1941 |
@SYMTestExpectedResults Fading occurs correctly with window obscured
|
sl@0
|
1942 |
*/
|
sl@0
|
1943 |
case BACKUPWIN+4:
|
sl@0
|
1944 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0232"));
|
sl@0
|
1945 |
iTest->LogSubTest(_L("BackupWin Obscured"));
|
sl@0
|
1946 |
ObscuredL();
|
sl@0
|
1947 |
break;
|
sl@0
|
1948 |
/**
|
sl@0
|
1949 |
@SYMTestCaseID GRAPHICS-WSERV-0233
|
sl@0
|
1950 |
|
sl@0
|
1951 |
@SYMDEF DEF081259
|
sl@0
|
1952 |
|
sl@0
|
1953 |
@SYMTestCaseDesc Test fading with backup window being moved
|
sl@0
|
1954 |
|
sl@0
|
1955 |
@SYMTestPriority High
|
sl@0
|
1956 |
|
sl@0
|
1957 |
@SYMTestStatus Implemented
|
sl@0
|
1958 |
|
sl@0
|
1959 |
@SYMTestActions Test fading with the backup window being moved
|
sl@0
|
1960 |
|
sl@0
|
1961 |
@SYMTestExpectedResults Fading occurs correctly with window moved
|
sl@0
|
1962 |
*/
|
sl@0
|
1963 |
case BACKUPWIN+5:
|
sl@0
|
1964 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0233"));
|
sl@0
|
1965 |
iTest->LogSubTest(_L("BackupWin Moving"));
|
sl@0
|
1966 |
MovingL();
|
sl@0
|
1967 |
DestroyDrawableWindow();
|
sl@0
|
1968 |
break;
|
sl@0
|
1969 |
/**
|
sl@0
|
1970 |
@SYMTestCaseID GRAPHICS-WSERV-0234
|
sl@0
|
1971 |
|
sl@0
|
1972 |
@SYMDEF DEF081259
|
sl@0
|
1973 |
|
sl@0
|
1974 |
@SYMTestCaseDesc Test redraw window creation and drawing
|
sl@0
|
1975 |
|
sl@0
|
1976 |
@SYMTestPriority High
|
sl@0
|
1977 |
|
sl@0
|
1978 |
@SYMTestStatus Implemented
|
sl@0
|
1979 |
|
sl@0
|
1980 |
@SYMTestActions Create a redraw window and draw in it
|
sl@0
|
1981 |
|
sl@0
|
1982 |
@SYMTestExpectedResults The drawing is correct in the window
|
sl@0
|
1983 |
*/
|
sl@0
|
1984 |
case REDRAWWIN:
|
sl@0
|
1985 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0234"));
|
sl@0
|
1986 |
iTest->LogSubTest(_L("RedrawWin Draw"));
|
sl@0
|
1987 |
CreateRedrawWindowL();
|
sl@0
|
1988 |
Draw();
|
sl@0
|
1989 |
break;
|
sl@0
|
1990 |
/**
|
sl@0
|
1991 |
@SYMTestCaseID GRAPHICS-WSERV-0235
|
sl@0
|
1992 |
|
sl@0
|
1993 |
@SYMDEF DEF081259
|
sl@0
|
1994 |
|
sl@0
|
1995 |
@SYMTestCaseDesc Test fading with redraw window obscured
|
sl@0
|
1996 |
|
sl@0
|
1997 |
@SYMTestPriority High
|
sl@0
|
1998 |
|
sl@0
|
1999 |
@SYMTestStatus Implemented
|
sl@0
|
2000 |
|
sl@0
|
2001 |
@SYMTestActions Test fading with the redraw window obscured
|
sl@0
|
2002 |
|
sl@0
|
2003 |
@SYMTestExpectedResults Fading occurs correctly with window obscured
|
sl@0
|
2004 |
*/
|
sl@0
|
2005 |
case REDRAWWIN+1:
|
sl@0
|
2006 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0235"));
|
sl@0
|
2007 |
iTest->LogSubTest(_L("RedrawWin Obscured"));
|
sl@0
|
2008 |
ObscuredL();
|
sl@0
|
2009 |
break;
|
sl@0
|
2010 |
/**
|
sl@0
|
2011 |
@SYMTestCaseID GRAPHICS-WSERV-0236
|
sl@0
|
2012 |
|
sl@0
|
2013 |
@SYMDEF DEF081259
|
sl@0
|
2014 |
|
sl@0
|
2015 |
@SYMTestCaseDesc Test fading with redraw window being moved
|
sl@0
|
2016 |
|
sl@0
|
2017 |
@SYMTestPriority High
|
sl@0
|
2018 |
|
sl@0
|
2019 |
@SYMTestStatus Implemented
|
sl@0
|
2020 |
|
sl@0
|
2021 |
@SYMTestActions Test fading with the redraw window being moved
|
sl@0
|
2022 |
|
sl@0
|
2023 |
@SYMTestExpectedResults Fading occurs correctly with window moved
|
sl@0
|
2024 |
*/
|
sl@0
|
2025 |
case REDRAWWIN+2:
|
sl@0
|
2026 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0236"));
|
sl@0
|
2027 |
iTest->LogSubTest(_L("RedrawWin Moving"));
|
sl@0
|
2028 |
MovingL();
|
sl@0
|
2029 |
break;
|
sl@0
|
2030 |
/**
|
sl@0
|
2031 |
@SYMTestCaseID GRAPHICS-WSERV-0237
|
sl@0
|
2032 |
|
sl@0
|
2033 |
@SYMDEF DEF081259
|
sl@0
|
2034 |
|
sl@0
|
2035 |
@SYMTestCaseDesc Test different fading techniques within a redraw window
|
sl@0
|
2036 |
|
sl@0
|
2037 |
@SYMTestPriority High
|
sl@0
|
2038 |
|
sl@0
|
2039 |
@SYMTestStatus Implemented
|
sl@0
|
2040 |
|
sl@0
|
2041 |
@SYMTestActions Test different fading techniques within a redraw window
|
sl@0
|
2042 |
|
sl@0
|
2043 |
@SYMTestExpectedResults Fading occurs correctly for the different techniques
|
sl@0
|
2044 |
*/
|
sl@0
|
2045 |
case REDRAWWIN+3:
|
sl@0
|
2046 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0237"));
|
sl@0
|
2047 |
iTest->LogSubTest(_L("AlternativeFadeDraw"));
|
sl@0
|
2048 |
Draw(ETrue);
|
sl@0
|
2049 |
break;
|
sl@0
|
2050 |
|
sl@0
|
2051 |
/**
|
sl@0
|
2052 |
@SYMTestCaseID GRAPHICS-WSERV-0238
|
sl@0
|
2053 |
|
sl@0
|
2054 |
@SYMDEF DEF081259
|
sl@0
|
2055 |
|
sl@0
|
2056 |
@SYMTestCaseDesc Test fading within a redraw window using the graphic context
|
sl@0
|
2057 |
|
sl@0
|
2058 |
@SYMTestPriority High
|
sl@0
|
2059 |
|
sl@0
|
2060 |
@SYMTestStatus Implemented
|
sl@0
|
2061 |
|
sl@0
|
2062 |
@SYMTestActions Test fading within a redraw window using the graphic context
|
sl@0
|
2063 |
|
sl@0
|
2064 |
@SYMTestExpectedResults Fading occurs correctly in the window
|
sl@0
|
2065 |
*/
|
sl@0
|
2066 |
case REDRAWWIN+4:
|
sl@0
|
2067 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0238"));
|
sl@0
|
2068 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NONNGA
|
sl@0
|
2069 |
iTest->LogSubTest(_L("GC Test"));
|
sl@0
|
2070 |
GCDraw();
|
sl@0
|
2071 |
DestroyDrawableWindow();
|
sl@0
|
2072 |
DestroyBitmaps();
|
sl@0
|
2073 |
#endif
|
sl@0
|
2074 |
break;
|
sl@0
|
2075 |
|
sl@0
|
2076 |
/**
|
sl@0
|
2077 |
@SYMTestCaseID GRAPHICS-WSERV-0538
|
sl@0
|
2078 |
|
sl@0
|
2079 |
@SYMDEF DEF120965
|
sl@0
|
2080 |
|
sl@0
|
2081 |
@SYMTestCaseDesc Test fading under transparent window
|
sl@0
|
2082 |
|
sl@0
|
2083 |
@SYMTestPriority High
|
sl@0
|
2084 |
|
sl@0
|
2085 |
@SYMTestStatus Implemented
|
sl@0
|
2086 |
|
sl@0
|
2087 |
@SYMTestActions Construct opaque window lying under two transparent windows. Fade the opaque and the transparent windows.
|
sl@0
|
2088 |
|
sl@0
|
2089 |
@SYMTestExpectedResults Each of the overlapping areas should be faded only once.
|
sl@0
|
2090 |
*/
|
sl@0
|
2091 |
case REDRAWWIN+5:
|
sl@0
|
2092 |
{
|
sl@0
|
2093 |
((CTFadeStep*)iStep)->SetTestStepID(_L("GRAPHICS-WSERV-0538"));
|
sl@0
|
2094 |
iTest->LogSubTest(_L("Fade behind transparent window"));
|
sl@0
|
2095 |
CRedrawWin* win = new(ELeave) CRedrawWin(this);
|
sl@0
|
2096 |
win->ConstructL(TRect(0,0,0,0));
|
sl@0
|
2097 |
TInt transparency = win->Win()->SetTransparencyAlphaChannel();
|
sl@0
|
2098 |
if (transparency!=KErrNotSupported)
|
sl@0
|
2099 |
{
|
sl@0
|
2100 |
FadeBehindTransparentWindowL();
|
sl@0
|
2101 |
}
|
sl@0
|
2102 |
else
|
sl@0
|
2103 |
{
|
sl@0
|
2104 |
WARN_PRINTF1(_L("Transparency not supported. Skipping test."));
|
sl@0
|
2105 |
}
|
sl@0
|
2106 |
delete win;
|
sl@0
|
2107 |
break;
|
sl@0
|
2108 |
}
|
sl@0
|
2109 |
case REDRAWWIN+6:
|
sl@0
|
2110 |
((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
2111 |
iTest->LogSubTest(_L("Test complete\n"));
|
sl@0
|
2112 |
#ifdef TEST_GRAPHICS_WSERV_TAUTOSERVER_NGA
|
sl@0
|
2113 |
DestroyDrawableWindow();
|
sl@0
|
2114 |
DestroyBitmaps();
|
sl@0
|
2115 |
#endif
|
sl@0
|
2116 |
((CTFadeStep*)iStep)->CloseTMSGraphicsStep();
|
sl@0
|
2117 |
TestComplete();
|
sl@0
|
2118 |
break;
|
sl@0
|
2119 |
default:
|
sl@0
|
2120 |
((CTFadeStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
|
sl@0
|
2121 |
break;
|
sl@0
|
2122 |
}
|
sl@0
|
2123 |
((CTFadeStep*)iStep)->RecordTestResultL();
|
sl@0
|
2124 |
}
|
sl@0
|
2125 |
|
sl@0
|
2126 |
__WS_CONSTRUCT_STEP__(Fade)
|