|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @test |
|
19 @internalComponent - Internal Symbian test code |
|
20 */ |
|
21 |
|
22 #include "talphadrawing.h" |
|
23 #include <hal.h> |
|
24 |
|
25 // When enabled allows testing with a variable windows size rather than fixed size |
|
26 #define _TESTWITHVARIABLEWINDOWSIZE |
|
27 |
|
28 // Test bitmap file location |
|
29 _LIT(KAlphaTestBitmap,"z:\\system\\data\\uibench_24bit.mbm"); |
|
30 |
|
31 const TInt KIterationsToTest = 100; // Number of iterations to run tests |
|
32 const TInt KDelay = 100000; // 0.1 seconds |
|
33 const TInt KRotationGranulatity = 8;// Rotation array granularity |
|
34 |
|
35 /** |
|
36 Clear window to selected colour |
|
37 */ |
|
38 LOCAL_C void ClearWindow(RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc, TRgb aColor) |
|
39 { |
|
40 // clear so we can see bitmap version has completed |
|
41 aWindow.Invalidate(); |
|
42 aWindow.BeginRedraw(); |
|
43 aGc->Activate(aWindow); |
|
44 aGc->SetBrushColor(aColor); |
|
45 aGc->Clear(); |
|
46 aGc->Deactivate(); |
|
47 aWindow.EndRedraw(); |
|
48 aSession.Flush(); |
|
49 } |
|
50 |
|
51 /** |
|
52 Draws a b/w checkerboard onto a RWindow |
|
53 */ |
|
54 LOCAL_C void ChessBoard(RWsSession& aSession, RWindow& aWindow, CWindowGc* aGc) |
|
55 { |
|
56 const TSize size = aWindow.Size(); |
|
57 |
|
58 aGc->Activate(aWindow); |
|
59 aGc->SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
60 aGc->SetPenStyle(CGraphicsContext::ENullPen); |
|
61 |
|
62 aGc->SetBrushColor(KRgbBlack); |
|
63 aGc->Clear(); |
|
64 aGc->SetBrushColor(KRgbWhite); |
|
65 TInt x0 = 0; |
|
66 TPoint point; |
|
67 const TInt checkerSize = 32; |
|
68 for(point.iY=0; point.iY < size.iHeight; point.iY += checkerSize) |
|
69 { |
|
70 for(point.iX=x0; point.iX < size.iWidth; point.iX += checkerSize*2) |
|
71 { |
|
72 TRect rect(point, TSize(checkerSize, checkerSize)); |
|
73 aGc->DrawRect(rect); |
|
74 } |
|
75 x0 = checkerSize - x0; |
|
76 } |
|
77 aGc->Deactivate(); |
|
78 aSession.Flush(); |
|
79 } |
|
80 |
|
81 /** |
|
82 RBlankWindow on top layer gets set visible/invisible to measure timing of drawing the windows below |
|
83 */ |
|
84 void CTAlphaDrawing::DrawBlankWindowL (RWindow& /*aForeGndWin*/, TInt aIters) |
|
85 { |
|
86 // Create a blank window that is the size of the screen so that we can set this visible to hide the window underneath |
|
87 // and then hide it to force redraw of the window underneath |
|
88 RBlankWindow blankWindow = RBlankWindow(iWsSession); |
|
89 CleanupClosePushL(blankWindow); |
|
90 User::LeaveIfError(blankWindow.Construct(iWinGroup, (TInt)this+1)); |
|
91 blankWindow.SetSize(iScreenDevice->SizeInPixels()); |
|
92 blankWindow.SetColor(TRgb(0x3399ff)); |
|
93 blankWindow.Activate(); |
|
94 |
|
95 #ifdef _TESTWITHVARIABLEWINDOWSIZE |
|
96 // Create a small window that moves position |
|
97 RBlankWindow blankWindow2 = RBlankWindow(iWsSession); |
|
98 CleanupClosePushL(blankWindow2); |
|
99 User::LeaveIfError(blankWindow2.Construct(iWinGroup, (TInt)this+2)); |
|
100 blankWindow2.SetSize(TSize(10,10)); |
|
101 blankWindow2.SetColor(TRgb(0x99ff33)); |
|
102 TInt px = iScreenDevice->SizeInPixels().iWidth/2; |
|
103 TInt py = iScreenDevice->SizeInPixels().iHeight/2; |
|
104 blankWindow2.SetPosition(TPoint(px, py)); |
|
105 blankWindow2.Activate(); |
|
106 #endif |
|
107 |
|
108 TBool onoff=ETrue; |
|
109 |
|
110 iProfiler->InitResults(); |
|
111 for(TInt i=aIters; i>=0; i--) |
|
112 { |
|
113 blankWindow.SetVisible(onoff=!onoff); |
|
114 |
|
115 #ifdef _TESTWITHVARIABLEWINDOWSIZE |
|
116 blankWindow2.SetSize(TSize(10+i, 10+i)); |
|
117 blankWindow2.SetPosition(TPoint(px--, py--)); |
|
118 if (px<0) px=150; |
|
119 if (py<0) py=150; |
|
120 #endif |
|
121 |
|
122 iWsSession.Flush(); |
|
123 iProfiler->MarkResultSetL(); |
|
124 } |
|
125 |
|
126 #ifdef _TESTWITHVARIABLEWINDOWSIZE |
|
127 CleanupStack::PopAndDestroy(&blankWindow2); |
|
128 #endif |
|
129 CleanupStack::PopAndDestroy(&blankWindow); |
|
130 } |
|
131 |
|
132 /** |
|
133 Helper function to calculate processor cycles per pixel as a characteristic number for rendering speed |
|
134 */ |
|
135 TInt CTAlphaDrawing::CyclesPerPixel(TInt64 aDuration, TInt aIters, TInt aWidth, TInt aHeight, TInt aCPUSpeed) |
|
136 { |
|
137 TInt64 pixs=aWidth*aHeight; |
|
138 TInt64 cpuHz=aCPUSpeed; |
|
139 |
|
140 TInt64 ret=(aDuration*cpuHz)/pixs/1000/aIters; |
|
141 return ret; |
|
142 } |
|
143 |
|
144 /* |
|
145 Helper function that draws a window |
|
146 */ |
|
147 void CTAlphaDrawing::TestDrawWindowL(TDisplayMode aMode, TInt aIters, TTestCase aTestCase, const TDesC& aTestName) |
|
148 { |
|
149 RWindow foregndWindow = RWindow(iWsSession); |
|
150 User::LeaveIfError(foregndWindow.Construct(iWinGroup, (TInt)this+3)); |
|
151 |
|
152 CFbsBitmap * bmpModeDep = CreateSoftwareBitmapLC(iScreenDevice->SizeInPixels(), aMode); |
|
153 CopyBitmapL(bmpModeDep, iSourceImage); |
|
154 |
|
155 foregndWindow.BeginRedraw(); |
|
156 iWindowGc->Activate(foregndWindow); |
|
157 iWindowGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
158 iWindowGc->SetDrawMode(CGraphicsContext::EDrawModePEN); |
|
159 iWindowGc->DrawBitmap(iScreenDevice->SizeInPixels(), bmpModeDep, bmpModeDep->SizeInPixels()); |
|
160 iWindowGc->Deactivate(); |
|
161 foregndWindow.EndRedraw(); |
|
162 iWsSession.Flush(); |
|
163 |
|
164 switch (aTestCase) |
|
165 { |
|
166 case EUseOpaqueDraw: |
|
167 foregndWindow.SetNonTransparent(); |
|
168 break; |
|
169 case EUseTransparencyFactor: |
|
170 User::LeaveIfError(foregndWindow.SetTransparencyFactor(TRgb(0xbbbbbb,128))); |
|
171 break; |
|
172 } |
|
173 |
|
174 foregndWindow.Activate(); |
|
175 |
|
176 // Start performance test and analyse results |
|
177 DrawBlankWindowL(foregndWindow, aIters); |
|
178 iProfiler->ResultsAnalysis(aTestName, 0, aMode, 0, aIters); |
|
179 |
|
180 foregndWindow.Close(); |
|
181 |
|
182 CleanupStack::PopAndDestroy(bmpModeDep); |
|
183 User::After(KDelay); |
|
184 } |
|
185 |
|
186 /** |
|
187 @SYMTestCaseID |
|
188 GRAPHICS-UI-BENCH-0013 |
|
189 |
|
190 @SYMTestCaseDesc |
|
191 The test determines how long it takes to draw an opaque (non-transparent) window composition. |
|
192 |
|
193 @SYMTestActions |
|
194 Compare the results over time, and before and after changes to wserv code. |
|
195 |
|
196 @SYMTestExpectedResults |
|
197 Test should pass and display total test time and cycles per pixel |
|
198 */ |
|
199 void CTAlphaDrawing::DoTestDrawOpaqueWindowL(TDisplayMode aMode, TInt aIters) |
|
200 { |
|
201 TestDrawWindowL(aMode, aIters, EUseOpaqueDraw, _L("WinOpaque")); |
|
202 } |
|
203 |
|
204 /** |
|
205 @SYMTestCaseID |
|
206 GRAPHICS-UI-BENCH-0014 |
|
207 |
|
208 @SYMTestCaseDesc |
|
209 The test determines how long it takes to draw transparent window compositions with window SetTransparencyFactor. |
|
210 |
|
211 @SYMTestActions |
|
212 Compare the results over time, and before and after changes to wserv code. |
|
213 |
|
214 @SYMTestExpectedResults |
|
215 Test should pass and display total test time and cycles per pixel |
|
216 */ |
|
217 void CTAlphaDrawing::DoTestDrawTransparentWindowFactorL(TDisplayMode aMode, TInt aIters) |
|
218 { |
|
219 TestDrawWindowL(aMode, aIters, EUseTransparencyFactor, _L("WinTrFac")); |
|
220 } |
|
221 |
|
222 /** |
|
223 @SYMTestCaseID |
|
224 GRAPHICS-UI-BENCH-0015 |
|
225 |
|
226 @SYMTestCaseDesc |
|
227 The test determines how long it takes to draw transparent window compositions with SetTransparencyBitmap. |
|
228 |
|
229 @SYMTestActions |
|
230 Compare the results over time, and before and after changes to wserv code. |
|
231 |
|
232 @SYMTestExpectedResults |
|
233 Test should pass and display total test time and cycles per pixel |
|
234 */ |
|
235 void CTAlphaDrawing::DoTestDrawTransparentWindowBitmapL(TDisplayMode aMode, TInt aIters) |
|
236 { |
|
237 RWindow foregndWindow; |
|
238 foregndWindow = RWindow(iWsSession); |
|
239 User::LeaveIfError(foregndWindow.Construct(iWinGroup, (TInt)this+5)); |
|
240 |
|
241 CFbsBitmap * sourceAlpha = CreateSoftwareBitmapLC(iScreenDevice->SizeInPixels(), EGray256); |
|
242 VerticalGradientAlphaL(sourceAlpha, TRgb(0xffffffff), TRgb(0x00000000)); |
|
243 |
|
244 CFbsBitmap * bmpModeDep = CreateSoftwareBitmapLC(iScreenDevice->SizeInPixels(), aMode); |
|
245 CopyBitmapL(bmpModeDep, iSourceImage); |
|
246 |
|
247 foregndWindow.BeginRedraw(); |
|
248 iWindowGc->Activate(foregndWindow); |
|
249 iWindowGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
250 iWindowGc->SetDrawMode(CGraphicsContext::EDrawModePEN); |
|
251 iWindowGc->DrawBitmap(iScreenDevice->SizeInPixels(), bmpModeDep, bmpModeDep->SizeInPixels()); |
|
252 |
|
253 // Set transparency bitmap for this window |
|
254 User::LeaveIfError(foregndWindow.SetTransparencyBitmap(*sourceAlpha)); |
|
255 |
|
256 iWindowGc->Deactivate(); |
|
257 foregndWindow.EndRedraw(); |
|
258 iWsSession.Flush(); |
|
259 |
|
260 foregndWindow.Activate(); |
|
261 |
|
262 DrawBlankWindowL(foregndWindow,aIters); |
|
263 iProfiler->ResultsAnalysis(_L("WinTrBmp"), 0, aMode, 0, aIters); |
|
264 |
|
265 foregndWindow.Close(); |
|
266 |
|
267 CleanupStack::PopAndDestroy(2, sourceAlpha); |
|
268 User::After(KDelay); |
|
269 } |
|
270 |
|
271 /** |
|
272 @SYMTestCaseID GRAPHICS-UI-BENCH-0016 |
|
273 @SYMTestPriority High |
|
274 @SYMREQ 0000 |
|
275 @SYMTestCaseDesc |
|
276 Test test determines how long it takes to draw transparent window compositions with SetTransparencyAlphaChannel. |
|
277 |
|
278 @SYMTestActions |
|
279 Compare the results over time, and before and after changes to wserv code. |
|
280 |
|
281 @SYMTestExpectedResults |
|
282 Test should pass and display total test time and cycles per pixel |
|
283 */ |
|
284 void CTAlphaDrawing::DoTestDrawTransparentWindowAlphaChannelL(TDisplayMode aMode, TInt aIters) |
|
285 { |
|
286 RWindow foregndWindow; |
|
287 foregndWindow = RWindow(iWsSession); |
|
288 User::LeaveIfError(foregndWindow.Construct(iWinGroup, (TInt)this+6)); |
|
289 |
|
290 CFbsBitmap * sourceAlpha = CreateSoftwareBitmapLC(iSourceImage->SizeInPixels(), EGray256); |
|
291 VerticalGradientAlphaL(sourceAlpha, TRgb(0xffffffff), TRgb(0x00000000)); |
|
292 |
|
293 CFbsBitmap * bmpModeDep = CreateSoftwareBitmapLC(iScreenDevice->SizeInPixels(), aMode); |
|
294 CopyBitmapL(bmpModeDep, iSourceImage); |
|
295 |
|
296 TPoint point; |
|
297 TRect rect(iScreenDevice->SizeInPixels()); |
|
298 |
|
299 foregndWindow.BeginRedraw(); |
|
300 iWindowGc->Activate(foregndWindow); |
|
301 iWindowGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
302 iWindowGc->SetDrawMode(CGraphicsContext::EDrawModePEN); |
|
303 |
|
304 iWindowGc->DrawBitmapMasked(rect, bmpModeDep, bmpModeDep->SizeInPixels(), sourceAlpha, EFalse); |
|
305 |
|
306 User::LeaveIfError(foregndWindow.SetTransparencyAlphaChannel()); |
|
307 |
|
308 iWindowGc->Deactivate(); |
|
309 foregndWindow.EndRedraw(); |
|
310 iWsSession.Flush(); |
|
311 |
|
312 foregndWindow.Activate(); |
|
313 |
|
314 DrawBlankWindowL(foregndWindow,aIters); |
|
315 iProfiler->ResultsAnalysis(_L("WinTrAlphaCh"), 0, aMode, 0, aIters); |
|
316 |
|
317 foregndWindow.Close(); |
|
318 CleanupStack::PopAndDestroy(2, sourceAlpha); |
|
319 User::After(KDelay); |
|
320 } |
|
321 |
|
322 /** |
|
323 @SYMTestCaseID |
|
324 GRAPHICS-UI-BENCH-0017 |
|
325 |
|
326 @SYMTestCaseDesc |
|
327 Creates foreground window with alpha channel transparency. |
|
328 An image with alpha mask is bitblitted to this window. |
|
329 The test determines how long it takes to create a window |
|
330 |
|
331 @SYMTestActions |
|
332 Compare the results over time, and before and after changes to wserv code. |
|
333 |
|
334 @SYMTestExpectedResults |
|
335 Test should pass and display total test time and cycles per pixel |
|
336 */ |
|
337 void CTAlphaDrawing::DoTestCreateWindowL(TDisplayMode aMode, TInt aIters) |
|
338 { |
|
339 RWindow foregndWindow; |
|
340 |
|
341 CFbsBitmap * sourceAlpha = CreateSoftwareBitmapLC(iSourceImage->SizeInPixels(), EGray256); |
|
342 VerticalGradientAlphaL(sourceAlpha, TRgb(0xffffffff), TRgb(0x00000000)); |
|
343 |
|
344 CFbsBitmap * bmpModeDep = CreateSoftwareBitmapLC(iScreenDevice->SizeInPixels(), aMode); |
|
345 CopyBitmapL(bmpModeDep, iSourceImage); |
|
346 |
|
347 TPoint point; |
|
348 TRect rect(iScreenDevice->SizeInPixels()); |
|
349 iProfiler->InitResults(); |
|
350 for(TInt i=KIterationsToTest; i>=0; i--) |
|
351 { |
|
352 foregndWindow = RWindow(iWsSession); |
|
353 User::LeaveIfError(foregndWindow.Construct(iWinGroup, (TInt)this+7)); |
|
354 |
|
355 foregndWindow.BeginRedraw(); |
|
356 iWindowGc->Activate(foregndWindow); |
|
357 iWindowGc->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
358 iWindowGc->SetDrawMode(CGraphicsContext::EDrawModePEN); |
|
359 iWindowGc->DrawBitmapMasked(rect, bmpModeDep, bmpModeDep->SizeInPixels(), sourceAlpha, EFalse); |
|
360 |
|
361 TInt ret = foregndWindow.SetTransparencyAlphaChannel(); |
|
362 if (ret == KErrNotSupported) |
|
363 ERR_PRINTF1(_L("Transparency not enabled - Turn on transparency in wsini.ini file")); |
|
364 User::LeaveIfError(ret); |
|
365 |
|
366 iWindowGc->Deactivate(); |
|
367 foregndWindow.EndRedraw(); |
|
368 iWsSession.Flush(); |
|
369 |
|
370 foregndWindow.Activate(); |
|
371 |
|
372 iWsSession.Flush(); |
|
373 iProfiler->MarkResultSetL(); |
|
374 |
|
375 foregndWindow.Close(); |
|
376 } |
|
377 iProfiler->ResultsAnalysis(_L("WinCreation"), 0, aMode, 0, aIters); |
|
378 CleanupStack::PopAndDestroy(2, sourceAlpha); |
|
379 User::After(KDelay); |
|
380 } |
|
381 |
|
382 CTAlphaDrawing::~CTAlphaDrawing() |
|
383 { |
|
384 delete iSourceImage; |
|
385 delete iWindowGc; |
|
386 delete iScreenDevice; |
|
387 iBackgndWindow.Close(); |
|
388 iWinGroup.Close(); |
|
389 iWsSession.Close(); |
|
390 RFbsSession::Disconnect(); |
|
391 } |
|
392 |
|
393 CTAlphaDrawing::CTAlphaDrawing() |
|
394 { |
|
395 SetTestStepName(KTAlphaDrawing); |
|
396 } |
|
397 |
|
398 /** |
|
399 Override of base class virtual |
|
400 |
|
401 @return - TVerdict code |
|
402 */ |
|
403 TVerdict CTAlphaDrawing::doTestStepPreambleL() |
|
404 { |
|
405 CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL(); |
|
406 |
|
407 HAL::Get(HALData::ECPUSpeed,iCPUSpeed); |
|
408 |
|
409 User::LeaveIfError(RFbsSession::Connect()); |
|
410 User::LeaveIfError(iWsSession.Connect()); |
|
411 |
|
412 iScreenDevice = new (ELeave) CWsScreenDevice(iWsSession); |
|
413 User::LeaveIfError(iScreenDevice->Construct(0)); // screen number (0 is first screen) |
|
414 |
|
415 iSourceImage = LoadBitmapL(KAlphaTestBitmap,0); |
|
416 |
|
417 iWindowGc = new (ELeave) CWindowGc(iScreenDevice); |
|
418 User::LeaveIfError(iWindowGc->Construct()); |
|
419 |
|
420 TDisplayMode windowMode = iScreenDevice->DisplayMode(); |
|
421 |
|
422 iWinGroup = RWindowGroup(iWsSession); |
|
423 User::LeaveIfError(iWinGroup.Construct(1, EFalse)); |
|
424 |
|
425 iBackgndWindow = RWindow(iWsSession); |
|
426 User::LeaveIfError(iBackgndWindow.Construct(iWinGroup, (TInt)this+8)); |
|
427 iBackgndWindow.Activate(); |
|
428 |
|
429 iBackgndWindow.SetNonTransparent(); |
|
430 iBackgndWindow.Invalidate(); |
|
431 |
|
432 iWsSession.Flush(); |
|
433 return TestStepResult(); |
|
434 } |
|
435 |
|
436 /** |
|
437 Override of base class pure virtual |
|
438 Our implementation only gets called if the base class doTestStepPreambleL() did |
|
439 not leave. That being the case, the current test result value will be EPass. |
|
440 |
|
441 Creates background window with black & white checker board. |
|
442 This background windows is used for each test case in this file |
|
443 |
|
444 @return TVerdict code |
|
445 */ |
|
446 TVerdict CTAlphaDrawing::doTestStepL() |
|
447 { |
|
448 TInt iters = KIterationsToTest; |
|
449 |
|
450 INFO_PRINTF5(_L("TAlphaDrawing - Iterations:%d, CPUSpeed:%d kHz, Width: %d px, Height: %d px"),iters,iCPUSpeed,iScreenDevice->SizeInPixels().iWidth,iScreenDevice->SizeInPixels().iHeight); |
|
451 |
|
452 // tests to execute |
|
453 TBool iniok; TInt inival; |
|
454 iniok = GetIntFromConfig(_L("AlphaDrawingTests"), _L("testCreateWindowAlpha"), inival); |
|
455 TBool testCreateWindowAlpha = ((iniok==EFalse) || (inival > 0)); |
|
456 iniok = GetIntFromConfig(_L("AlphaDrawingTests"), _L("testDrawOpaqueWindow"), inival); |
|
457 TBool testDrawOpaqueWindow = ((iniok==EFalse) || (inival > 0)); |
|
458 iniok = GetIntFromConfig(_L("AlphaDrawingTests"), _L("testDrawTransparentFactorWindow"), inival); |
|
459 TBool testDrawTransparentFactorWindow = ((iniok==EFalse) || (inival > 0)); |
|
460 iniok = GetIntFromConfig(_L("AlphaDrawingTests"), _L("testDrawTransparentWindowPerPixel"), inival); |
|
461 TBool testDrawTransparentWindowPerPixel = ((iniok==EFalse) || (inival > 0)); |
|
462 iniok = GetIntFromConfig(_L("AlphaDrawingTests"), _L("testDrawTransparentWindowPerPixelAlpha"), inival); |
|
463 TBool testDrawTransparentWindowPerPixelAlpha = ((iniok==EFalse) || (inival > 0)); |
|
464 |
|
465 const TSize iWindowSize=iBackgndWindow.Size(); |
|
466 |
|
467 // Initalise test - clear window and create checker board on background windows |
|
468 ClearWindow(iWsSession, iBackgndWindow, iWindowGc, BLACK_SEMI_TRANSPARENT); |
|
469 ChessBoard(iWsSession, iBackgndWindow, iWindowGc); |
|
470 |
|
471 iWsSession.Flush(); |
|
472 |
|
473 TInt screenModesCnt=iScreenDevice->NumScreenModes(); |
|
474 CArrayFixFlat<TInt> * rotationList=NULL; |
|
475 |
|
476 rotationList = new (ELeave) CArrayFixFlat<TInt>(KRotationGranulatity); |
|
477 CleanupStack::PushL(rotationList); |
|
478 |
|
479 for (TInt scm=0; scm<screenModesCnt; scm++) |
|
480 { |
|
481 iScreenDevice->GetRotationsList(scm,rotationList); |
|
482 |
|
483 for (TInt rot = 0; rot < rotationList->Count(); rot++) |
|
484 { |
|
485 TPixelsAndRotation pxrot; |
|
486 pxrot.iPixelSize =iWindowSize; |
|
487 |
|
488 iRotation=(CFbsBitGc::TGraphicsOrientation)rotationList->At(rot); |
|
489 pxrot.iRotation =iRotation; |
|
490 |
|
491 iScreenDevice->SetScreenSizeAndRotation(pxrot); |
|
492 |
|
493 for(int m=0; m<1; m++) |
|
494 { |
|
495 // test drawing speed of window creation and destruction |
|
496 if ( testCreateWindowAlpha ) |
|
497 { |
|
498 SetTestStepID(_L("GRAPHICS-UI-BENCH-0017")); |
|
499 DoTestCreateWindowL(KValidDisplayModes[m],iters); |
|
500 RecordTestResultL(); |
|
501 } |
|
502 |
|
503 // test drawing speed of an opaque window composition |
|
504 if ( testDrawOpaqueWindow ) |
|
505 { |
|
506 SetTestStepID(_L("GRAPHICS-UI-BENCH-0013")); |
|
507 DoTestDrawOpaqueWindowL(KValidDisplayModes[m],iters); |
|
508 RecordTestResultL(); |
|
509 } |
|
510 |
|
511 // test drawing speed of a transparent window composition with a transparency factor |
|
512 if ( testDrawTransparentFactorWindow ) |
|
513 { |
|
514 SetTestStepID(_L("GRAPHICS-UI-BENCH-0014")); |
|
515 DoTestDrawTransparentWindowFactorL(KValidDisplayModes[m],iters); |
|
516 RecordTestResultL(); |
|
517 } |
|
518 |
|
519 // test drawing speed of a transparent window composition with a transparency bitmap |
|
520 if ( testDrawTransparentWindowPerPixel ) |
|
521 { |
|
522 SetTestStepID(_L("GRAPHICS-UI-BENCH-0015")); |
|
523 DoTestDrawTransparentWindowBitmapL(KValidDisplayModes[m],iters); |
|
524 RecordTestResultL(); |
|
525 } |
|
526 |
|
527 // test drawing speed of a transparent window composition with alpha channel transparency |
|
528 if ( testDrawTransparentWindowPerPixelAlpha ) |
|
529 { |
|
530 SetTestStepID(_L("GRAPHICS-UI-BENCH-0016")); |
|
531 DoTestDrawTransparentWindowAlphaChannelL(KValidDisplayModes[m],iters); |
|
532 RecordTestResultL(); |
|
533 } |
|
534 } // m...Modes |
|
535 } // rot ... Rotations |
|
536 } |
|
537 CleanupStack::PopAndDestroy(rotationList); |
|
538 TVerdict a = TestStepResult(); |
|
539 return TestStepResult(); |
|
540 } |