Update contrib.
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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #include <bitdrawinterfaceid.h>
20 #include <bitdrawsurface.h>
26 #ifdef SYMBIAN_GRAPHICS_GCE
32 #include "TDirectScreenBitmap.h"
39 class CCommonInterfaces
42 virtual ~CCommonInterfaces();
44 TBool ScreenClearPartial();
45 TBool DrawColor(const TRect& aRect,const TRgb& aColour);
46 CCommonInterfaces(const TRect& aRect, const TDisplayMode& aDispMode,CDirectScreenBitmap* aDSBitmap);
48 void EndDraw(TRequestStatus& aStatus);
49 void EndDraw(const TRect& aRect, TRequestStatus& aStatus);
50 void Drawing(const TRect& aRect);
51 void DrawColour64KPixel(TInt aX,TInt aY, const TRgb& aColour);
55 TDisplayMode iDispMode;
56 CDirectScreenBitmap* iDSBitmap;
57 TAcceleratedBitmapInfo iBitmapInfo;
61 CCommonInterfaces::CCommonInterfaces(const TRect& aRect, const TDisplayMode& aDispMode,CDirectScreenBitmap* aDSBitmap):iRect(aRect),iDispMode(aDispMode),iDSBitmap(aDSBitmap),iDrawingRed(ETrue)
65 CCommonInterfaces::~CCommonInterfaces()
70 /** If the display mode of iBitmapInfo is not expected, return EFalse
71 * or render to the back buffer and returns ETrue
73 TBool CCommonInterfaces::DrawColor(const TRect& aRect,const TRgb& aColour)
75 TRect local = TRect(aRect.iTl-iRect.iTl, aRect.Size());
79 if (iBitmapInfo.iDisplayMode != iDispMode)
83 for (TInt y = local.iTl.iY; y < local.iBr.iY; y++)
85 for (TInt x = local.iTl.iX; x < local.iBr.iX; x++)
90 pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
91 pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
94 pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
95 pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color64K();
98 pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
99 pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MU();
102 pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
103 pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MA();
106 pBuffer16 = (TUint16*)iBitmapInfo.iAddress;
107 pBuffer16[y*iBitmapInfo.iLinePitch/2+x] = aColour._Color4K();
110 pBuffer32 = (TUint32*)iBitmapInfo.iAddress;
111 pBuffer32[y*iBitmapInfo.iLinePitch/4+x] = aColour._Color16MAP();
121 TBool CCommonInterfaces::ScreenClear()
123 iDSBitmap->BeginUpdate(iBitmapInfo);
124 TBool ret= DrawColor(iRect, KRgbWhite);
127 TRequestStatus requestStatus;
128 iDSBitmap->EndUpdate(requestStatus);
133 TBool CCommonInterfaces::ScreenClearPartial()
135 iDSBitmap->BeginUpdate(iBitmapInfo);
136 TBool ret= DrawColor(iRect, KRgbWhite);
139 TRequestStatus requestStatus;
140 iDSBitmap->EndUpdate(iRect,requestStatus);
145 void CCommonInterfaces::BeginDraw()
147 iDSBitmap->BeginUpdate(iBitmapInfo);
150 void CCommonInterfaces::EndDraw(TRequestStatus& aStatus)
152 iDSBitmap->EndUpdate(aStatus);
155 void CCommonInterfaces::EndDraw(const TRect& aRect, TRequestStatus& aStatus)
157 iDSBitmap->EndUpdate(aRect,aStatus);
161 void CCommonInterfaces::Drawing(const TRect& aRect)
165 DrawColor(aRect,KRgbRed);
166 iDrawingRed = EFalse;
170 DrawColor(aRect,KRgbBlack);
175 void CCommonInterfaces::DrawColour64KPixel(TInt aX,TInt aY, const TRgb& aColour)
177 TUint16 *pBuffer = (TUint16*)iBitmapInfo.iAddress;
178 pBuffer[aY*iBitmapInfo.iLinePitch/2+aX] = aColour._Color64K();
181 class CRendering : public CActive, public CCommonInterfaces
184 static CRendering* NewL(const TRect& aRect, const TDisplayMode& aDispMode, CDirectScreenBitmap* aDSBitmap,CDirectScreenBitmap::TSettingsFlags aSettings);
187 virtual ~CRendering();
188 protected: // from CActive
195 CRendering(const TRect& aRect, const TDisplayMode& aDispMode,CDirectScreenBitmap* aDSBitmap,CDirectScreenBitmap::TSettingsFlags aSettings);
200 TAcceleratedBitmapInfo iBitmapInfo;
202 CDirectScreenBitmap::TSettingsFlags iSettings;
206 CRendering* CRendering::NewL(const TRect& aRect, const TDisplayMode& aDispMode,CDirectScreenBitmap* aDSBitmap, CDirectScreenBitmap::TSettingsFlags aSettings)
208 CRendering * rendering = new (ELeave) CRendering(aRect, aDispMode, aDSBitmap, aSettings);
209 CleanupStack::PushL(rendering);
210 rendering->ConstructL();
211 CleanupStack::Pop(rendering);
215 CRendering::~CRendering()
217 // "Cancel" is a meaningless call, since the service
218 // (video driver's screen update process) is not cancellable.
219 // When destroying this active object, you must make sure,
220 // that the last update request (CDirectScreenBitmap::EndUpdate()) is completed.
221 // Assuming that LCD refresh rate is not less than 60 Hz,
222 // the wait time should be more than 1/60 secs.
223 // (Otherwise a stay signal comes.)
224 User::After(WAIT_TIME); // to let the GCE return a valid request notification back to CDSB
225 // or surface update panics with EUpdateServPanicDataIntegrity
229 CRendering::CRendering(const TRect& aRect, const TDisplayMode& aDispMode, CDirectScreenBitmap* aDSBitmap,CDirectScreenBitmap::TSettingsFlags aSettings)
230 :CActive( CActive::EPriorityStandard ),CCommonInterfaces(aRect,aDispMode,aDSBitmap),iFrames(0),iSettings(aSettings)
235 void CRendering::ConstructL()
237 CActiveScheduler::Add( this );
238 // clear the screen, and also check the display mode of iBitmapInfo is the same as expected
239 // If not, stop creating the CRendering object.
240 TBool ret = (iSettings & CDirectScreenBitmap::EIncrementalUpdate) ? ScreenClearPartial() : ScreenClear();
243 User::Leave(KErrGeneral);
247 void CRendering::RunL()
249 // Video driver finished to draw the last frame on the screen
250 // You may initiate rendering the next frame from here,
251 // but it would be slow, since there is a delay between CDirectScreenBitmap::EndUpdate()
252 // and the completition of screen refresh by the video driver
259 CActiveScheduler::Stop();
263 void CRendering::DoCancel()
265 // Cancel not implemented in service provider, so we can't do anything here
269 void CRendering::EndDraw()
275 CCommonInterfaces::EndDraw(iStatus);
279 void CRendering::ProcessFrame()
287 //A largely visual test to demonstrate regional refreshing of DirectScreenBitmaps and the correct display function
289 class CTDirectScreenBitmap : public CTGraphicsBase
292 ~CTDirectScreenBitmap();
293 void ConstructL(const TRect &aScreenRect, const CDirectScreenBitmap::TSettingsFlags aSettings,TInt aScreenNo=0);
295 void DoRefreshCycle(void);
296 void TestOrientRefresh(CFbsDrawDevice *aDev);
297 void TestRefreshingWindowsL();
298 void ExhaustiveTestMergeL(TBool aInSrcPreMul,TBool aInDestPreMul,TBool aOutDestPreMul,TInt aStepSize=1,TInt aChannelControl=1);
299 void ExhaustiveTestMergePerDispModeL(TDisplayMode aDrawDeviceDispMode, TBool aInSrcPreMul,TBool aInDestPreMul,TBool aOutDestPreMul,TInt aStepSize=1,TInt aChannelControl=1,TInt aOtherChannels=0,TDisplayMode aTestMode=EColor16MA);
300 void LogColourEvent(TInt aPreMulDestPixColor,TInt aNonPreMulDestPixColor,TInt aPreMulSrcPixelColor,TInt aNonPreMulSrcPixelColor,TReal aVal1,TReal aVal2,TReal aVal3,TRefByValue<const TDesC> aMsg,TBool aErr);
301 void TestContinuousRefreshingL();
302 void TestRefreshingTimeL();
304 void TestRefreshingWindowsPerDisplayModeL(TDisplayMode aDisplayMode);
305 void TestContinuousRefreshingPerDisplayModeL(const TDisplayMode& aDisplayMode);
307 void MeasureFrame(const TRect &aScreenRect);
308 CDirectScreenBitmap::TSettingsFlags iSettings;
309 CDirectScreenBitmap* iDirectScreenBitmap;
310 TAcceleratedBitmapInfo iBitmapInfo;
311 TRequestStatus iRequestStatus;
319 CCommonInterfaces* iInterface;
320 CRendering* iRendering;
322 CTDirectScreenBitmap();
323 CTDirectScreenBitmap(CTestStep* aStep);
325 //from CTGraphicsStep
326 virtual void RunTestCaseL(TInt aCurTestCase);
328 TDisplayMode iDispMode;
329 TInt iFreq; // For measuring the average time per frame
337 The runtime code currently contains a special case when dest starts unmultipled and ends premultiplied.
338 When src alpha is 0 the dest colour is simply passed through, not converted from unmultiplied to premultiplied.
339 That causes this fn to record errors, that will get ignored
340 for all source mask (srcMask==0), and most values of bkgrdChannel.
342 class TIgnoreSpecialCases
345 TIgnoreSpecialCases (TBool aInSrcPreMul,TBool aInDestPreMul,TBool aOutDestPreMul) ;
346 bool operator()(TInt aPreMulDestPixColor,TInt aNonPreMulDestPixColor,TInt aSrcMask,TInt aSrcChannel);
348 TInt ExpectedIgnoreCount(TInt aFreq);
354 CTDirectScreenBitmap::CTDirectScreenBitmap(CTestStep* aStep) :
355 CTGraphicsBase(aStep),iMeasure(0)
359 CTDirectScreenBitmap::~CTDirectScreenBitmap()
364 //Construct the DirectScreenBitmap and sub-rects for test of the refresh.
365 //Constructs a DirectScreenBitmap for EDoubleBuffer and EIncrementalUpdate
366 void CTDirectScreenBitmap::ConstructL(const TRect &aScreenRect, const CDirectScreenBitmap::TSettingsFlags aSettings, TInt aScreenType)
369 iScreenType = aScreenType;
371 if (iScreenType==CDirectScreenBitmap::EDoubleBuffer || iScreenType==CDirectScreenBitmap::EIncrementalUpdate)
373 Screenno=iScreenType;
374 iDirectScreenBitmap = CDirectScreenBitmap::NewL(Screenno);
378 iDirectScreenBitmap = CDirectScreenBitmap::NewL();
380 iSettings = aSettings;
381 TInt create=iDirectScreenBitmap->Create(aScreenRect, aSettings);
382 if (create==KErrNone)
384 iFullRect = aScreenRect;
385 TPoint Pos = aScreenRect.iTl;
386 TSize hSize = TSize(aScreenRect.Width()/2, aScreenRect.Height()/2);
387 TSize hSizeX = TSize(aScreenRect.Width()/2, 0);
388 TSize hSizeY = TSize(0, aScreenRect.Height()/2);
389 TSize qSize = TSize(aScreenRect.Width()/4, aScreenRect.Height()/4);
391 iTopLeft = TRect(Pos, hSize);
392 iTopRight = TRect(Pos + hSizeX, hSize);
393 iBotLeft = TRect(Pos + hSizeY, hSize);
394 iBotRight = TRect(Pos + hSize, hSize);
395 iMiddle = TRect(Pos + hSize - qSize, hSize);
397 iInterface = new (ELeave) CCommonInterfaces(iFullRect, iDispMode, iDirectScreenBitmap);
398 iRendering = CRendering::NewL(iFullRect,iDispMode,iDirectScreenBitmap,iSettings);
406 void CTDirectScreenBitmap::Close()
408 User::After(WAIT_TIME);
409 delete iDirectScreenBitmap;
410 iDirectScreenBitmap = NULL;
418 //A refresh cycle fills a 2x2 region of RGBW rects and draws it to the screen. If the mode is incremental
419 //The different colour rects are updated seperately to test the sub-region update.
420 void CTDirectScreenBitmap::DoRefreshCycle(void)
422 if ((iSettings & CDirectScreenBitmap::EIncrementalUpdate)&&(!iInterface->ScreenClearPartial()))
424 INFO_PRINTF1(_L("The display mode of the iBitmapInfo is not expected"));
426 else if (!(iSettings & CDirectScreenBitmap::EIncrementalUpdate)&&(!iInterface->ScreenClear()))
428 INFO_PRINTF1(_L("The display mode of the iBitmapInfo is not expected"));
432 iInterface->BeginDraw();
433 iInterface->DrawColor(iTopLeft,KRgbRed);
434 iInterface->DrawColor(iTopRight,KRgbGreen);
435 iInterface->DrawColor(iBotLeft,KRgbBlue);
436 iInterface->DrawColor(iBotRight,KRgbBlack);
438 if (!(iSettings & CDirectScreenBitmap::EIncrementalUpdate))
440 iInterface->EndDraw(iRequestStatus);
441 User::After(WAIT_TIME);
445 iInterface->EndDraw(iTopLeft, iRequestStatus);
446 User::After(WAIT_TIME);
447 iInterface->BeginDraw();
448 iInterface->EndDraw(iTopRight, iRequestStatus);
449 User::After(WAIT_TIME);
450 iInterface->BeginDraw();
451 iInterface->EndDraw(iBotLeft, iRequestStatus);
452 User::After(WAIT_TIME);
453 iInterface->BeginDraw();
454 iInterface->EndDraw(iBotRight, iRequestStatus);
455 User::After(WAIT_TIME);
457 iInterface->DrawColor(iMiddle,KRgbCyan);
458 iInterface->BeginDraw();
459 iInterface->EndDraw(iMiddle, iRequestStatus);
460 User::After(WAIT_TIME);
463 __ASSERT_DEBUG(iInterface->ScreenClear(), User::Invariant());
467 //Tests the Orientation and Refresh operations
468 void CTDirectScreenBitmap::TestOrientRefresh(CFbsDrawDevice *aDev)
471 MSurfaceId* surfaceIdInterface;
472 if (KErrNone != aDev->GetInterface(KSurfaceInterfaceID, reinterpret_cast <TAny*&> (surfaceIdInterface)))
475 TBool orientations[4];
476 aDev->OrientationsAvailable(orientations);
477 if ((!orientations[0])&&(!orientations[1])&&(!orientations[2])&&(!orientations[3]))
479 INFO_PRINTF1(_L("TestOrientRefresh(): All 4 orientations not supported? (error for non-gce)"));
481 for (TUint i = 0; i<4; i++)
485 if (aDev->SetOrientation((CFbsDrawDevice::TOrientation)i))
495 aDev->SetOrientation((CFbsDrawDevice::TOrientation)0);
500 TInt orientationAvailable = surfaceIdInterface->DeviceOrientationsAvailable();
501 for (TUint32 i = (TUint32)EDeviceOrientationNormal; i <= (TUint32)EDeviceOrientation270CW; i *= 2)
503 if (orientationAvailable&i)
505 surfaceIdInterface->SetDeviceOrientation((TDeviceOrientation)i);
509 surfaceIdInterface->SetDeviceOrientation(EDeviceOrientationNormal);
515 @SYMTestCaseID GRAPHICS-CTDirectScreenBitmap-TestRefreshingWindowsL-0001
517 @SYMTestCaseDesc Test orientation and Tests refreshing windows for various display modes
518 on all type of screens( full screen non-incremental, full screen double buffer, full screen incremental,
519 sub-region non incremental, sub region double-buffer, sub region incremental).
520 @SYMTestPriority Critical
521 @SYMTestStatus Implemented
522 @SYMTestActions Create a screen device for all type of screens. Set and test screen orientation
523 and finally test refreshing windows.
524 @SYMTestExpectedResults
525 The orientation and windows refresh test shall succeed on all screen type for various display mode
527 void CTDirectScreenBitmap::TestRefreshingWindowsL()
529 TestRefreshingWindowsPerDisplayModeL(EColor64K);
530 TestRefreshingWindowsPerDisplayModeL(EColor16M);
531 TestRefreshingWindowsPerDisplayModeL(EColor16MU);
532 TestRefreshingWindowsPerDisplayModeL(EColor16MA);
533 TestRefreshingWindowsPerDisplayModeL(EColor4K);
534 TestRefreshingWindowsPerDisplayModeL(EColor16MAP);
538 Perform TestRefreshingWindowsL test as describe above for individual display mode type.
539 @param aDisplayMode : relate to the window color mode to be displayed
541 void CTDirectScreenBitmap::TestRefreshingWindowsPerDisplayModeL(TDisplayMode aDisplayMode)
543 CFbsDrawDevice *pDev = NULL;
544 iDispMode = aDisplayMode;
546 TRAPD(err,pDev = CFbsDrawDevice::NewScreenDeviceL(0, aDisplayMode));
549 INFO_PRINTF2(_L("Note: Failed to create screen device for display mode %i - not supported on this config?"),aDisplayMode);
554 INFO_PRINTF2(_L("Testing RefreshingWindows for display mode %i"),aDisplayMode);
555 CleanupDeletePushL(pDev);
558 TSize screenSize = pDev->SizeInPixels();
561 directRect = TRect(TPoint(), screenSize);
562 //Full screen non-incremental run
563 INFO_PRINTF1(_L("Full screen non-incremental"));
564 TRAPD(err,ConstructL(directRect, CDirectScreenBitmap::ENone));
567 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
571 TestOrientRefresh(pDev);
574 //Full screen double buffer
575 INFO_PRINTF1(_L("Full screen double-buffer"));
576 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EDoubleBuffer,1));
579 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
583 TestOrientRefresh(pDev);
586 //Full screen incremental run
587 INFO_PRINTF1(_L("Full screen incremental"));
588 TRAP(err,ConstructL(directRect, CDirectScreenBitmap::EIncrementalUpdate,2));
591 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
595 TestOrientRefresh(pDev);
598 //Quarter screen non-incremental run
599 INFO_PRINTF1(_L("Sub region non-incremental"));
600 directRect = TRect(TPoint(screenSize.iWidth/2, screenSize.iHeight/2), TSize(screenSize.iWidth/2, screenSize.iHeight/2));
601 TRAP(err, ConstructL(directRect, CDirectScreenBitmap::ENone));
604 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
608 TestOrientRefresh(pDev);
611 //Quarter screen double buffer
612 INFO_PRINTF1(_L("Sub region double-buffer"));
613 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EDoubleBuffer,1));
616 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
620 TestOrientRefresh(pDev);
623 //Quarter screen incremental run
624 INFO_PRINTF1(_L("Sub region incremental"));
625 TRAP(err,ConstructL(directRect, CDirectScreenBitmap::EIncrementalUpdate,2));
628 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
632 TestOrientRefresh(pDev);
635 CleanupStack::PopAndDestroy(pDev);
639 void CTDirectScreenBitmap::TestContinuousRefreshingL()
641 TestContinuousRefreshingPerDisplayModeL(EColor64K);
642 TestContinuousRefreshingPerDisplayModeL(EColor16M);
643 TestContinuousRefreshingPerDisplayModeL(EColor16MU);
644 TestContinuousRefreshingPerDisplayModeL(EColor16MA);
645 TestContinuousRefreshingPerDisplayModeL(EColor4K);
646 TestContinuousRefreshingPerDisplayModeL(EColor16MAP);
649 void CTDirectScreenBitmap::TestContinuousRefreshingPerDisplayModeL(const TDisplayMode& aDisplayMode)
652 CFbsDrawDevice *pDev = NULL;
653 iDispMode = aDisplayMode;
655 TRAPD(err,pDev = CFbsDrawDevice::NewScreenDeviceL(0, aDisplayMode));
658 INFO_PRINTF2(_L("Note: Failed to create screen device for display mode %i - not supported on this config?"),iDispMode);
663 INFO_PRINTF2(_L("Testing Continuous Refreshing for display mode %i"),iDispMode);
664 CleanupDeletePushL(pDev);
665 User::LeaveIfError(pDev->InitScreen());
667 TSize screenSize = pDev->SizeInPixels();
670 // Quarter screen ENone
671 INFO_PRINTF1(_L("Consecutively update frames at left bottom corner and setting ENone"));
672 directRect = TRect(TPoint(0, screenSize.iHeight/2), TSize(screenSize.iWidth/2, screenSize.iHeight/2));
673 TRAPD(err,ConstructL(directRect, CDirectScreenBitmap::ENone));
676 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
680 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
683 // Quarter screen EDoubleBuffer
684 INFO_PRINTF1(_L("Consecutively update frames at up right corner and setting EDoubleBuffer"));
685 directRect = TRect(TPoint(screenSize.iWidth/2, 0), TSize(screenSize.iWidth/2, screenSize.iHeight/2));
686 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EDoubleBuffer,1));
689 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
693 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
696 // Quarter screen EIncremental
697 INFO_PRINTF1(_L("Consecutively update frames at right bottom corner and setting EIncremental"));
698 directRect = TRect(TPoint(screenSize.iWidth/2, screenSize.iHeight/2), TSize(screenSize.iWidth/2, screenSize.iHeight/2));
699 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EIncrementalUpdate,2));
702 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
706 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
710 // Full screen EIncremental
711 INFO_PRINTF1(_L("Consecutively update frames at full screen and setting EIncremental"));
712 directRect = TRect(TPoint(0,0), screenSize);
713 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EIncrementalUpdate,2));
716 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
720 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
725 INFO_PRINTF1(_L("Consecutively update frames at full screen and setting ENone"));
726 directRect = TRect(TPoint(0,0), screenSize);
727 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::ENone));
730 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
734 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
738 // Full screen EDoubleBuffering
739 INFO_PRINTF1(_L("Consecutively update frames at full screen and setting EDoubleBuffering"));
740 directRect = TRect(TPoint(0,0), screenSize);
741 TRAP(err,ConstructL(directRect,CDirectScreenBitmap::EDoubleBuffer,1));
744 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
748 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
751 CleanupStack::PopAndDestroy(pDev);
755 void CTDirectScreenBitmap::UpdateFrame()
757 iRendering->ProcessFrame();
758 CActiveScheduler::Start();
761 void CTDirectScreenBitmap::MeasureFrame(const TRect &aScreenRect)
767 __ASSERT_DEBUG(iInterface->ScreenClear(), User::Invariant());
768 iInterface->BeginDraw();
769 iInterface->Drawing(aScreenRect);
770 TRequestStatus status;
771 iTimeBefore = User::FastCounter();
772 iInterface->EndDraw(status);
773 iTimeAfter = User::FastCounter();
774 iMeasure += 1000 * ((TReal)(iTimeAfter - iTimeBefore)) / ((TReal) iFreq);
778 void CTDirectScreenBitmap::TestRefreshingTimeL()
780 // As other display modes have been tested in other test cases
781 // Only EColor16MAP is tested here
782 CFbsDrawDevice *pDev = NULL;
783 TDisplayMode aDisplayMode = EColor16MAP;
784 iDispMode = aDisplayMode;
786 TRAPD(err,pDev = CFbsDrawDevice::NewScreenDeviceL(0, aDisplayMode));
789 INFO_PRINTF2(_L("Note: Failed to create screen device for display mode %i - not supported on this config?"),iDispMode);
793 INFO_PRINTF2(_L("Testing Continuous Refreshing for display mode %i"),iDispMode);
794 CleanupDeletePushL(pDev);
795 User::LeaveIfError(pDev->InitScreen());
796 TSize screenSize = pDev->SizeInPixels();
799 // Quarter screen ENone
800 INFO_PRINTF1(_L("Consecutively update frames at left bottom corner and setting ENone"));
801 directRect = TRect(TPoint(0, screenSize.iHeight/2), TSize(screenSize.iWidth/2, screenSize.iHeight/2));
802 TRAPD(err,ConstructL(directRect, CDirectScreenBitmap::ENone));
805 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
809 // use the same iDirectScreenBitmap as CTDirectScreenBitmap
810 User::LeaveIfError(HAL::Get(HALData::EFastCounterFrequency, iFreq));
812 MeasureFrame(directRect);
814 INFO_PRINTF2(_L("The total time to render 200 frames is %f"),iMeasure);
817 CleanupStack::PopAndDestroy(pDev);
822 // TIgnoreSpecialCases
824 The runtime code currently contains a special case when dest starts unmultipled and ends premultiplied.
825 When src alpha is 0 the dest colour is simply passed through, not converted from unmultiplied to premultiplied.
826 That causes this fn to record errors, that will get ignored for all Source Mask (srcMask==0), and most values of background channel(bkgrdChannel).
828 TIgnoreSpecialCases ::TIgnoreSpecialCases (TBool /*aInSrcPreMul*/,TBool aInDestPreMul,TBool aOutDestPreMul)
830 iDoIgnore=(!aInDestPreMul && aOutDestPreMul);
835 The function returns true if the error should be ignored and keeps the count of the no. of errors ignored.
837 bool TIgnoreSpecialCases ::operator()(TInt /*aPreMulDestPixColor*/,TInt /*aNonPreMulDestPixColor*/,TInt aSrcMask,TInt /*aSrcChannel*/)
839 if (!iDoIgnore || aSrcMask!=0)
848 The function returns the no. of errors ignored.
850 TInt TIgnoreSpecialCases ::IgnoreCount()
852 return iIgnoredCount;
856 If the special-case is generating ignored errors then it should generate at least this many
857 If not generating errors then the count should be zero. Any other value should be noted to the log.
859 TInt TIgnoreSpecialCases ::ExpectedIgnoreCount(TInt aFreq)
861 TInt samples=240/aFreq;
862 return samples*samples*200*2; //This is an approximation.
866 This function is used to write to the log file
867 @param aNonPreMulDestPixColor non pre multiplied destination pixel colour
868 @param aPreMulSrcPixelColor pre multiplied source pixel colour
869 @param aNonPreMulSrcPixelColor non pre multiplied source pixel colour
870 @param aVal1 it contains the value of the first variable of the message to be displayed
871 @param aVal2 it contains the value of the second variable of the message to be displayed
872 @param aVal3 it contains the value of the third variable of the message to be displayed
873 @param aMsg it contains the message to be printed to the log file
874 @param aErr if true then the test case fails, if false test passes. log is printed in both the case. TEST does not abort, just reports test case failure
876 void CTDirectScreenBitmap::LogColourEvent(TInt aPreMulDestPixColor,TInt aNonPreMulDestPixColor,TInt aPreMulSrcPixelColor,TInt aNonPreMulSrcPixelColor,TReal aVal1,TReal aVal2,TReal aVal3,TRefByValue<const TDesC> aMsg,TBool aErr)
878 TEST(aErr==EFalse); // if aErr=True, then the previous test step failed.
879 INFO_PRINTF4(aMsg,aVal1,aVal2,aVal3);
880 if (aNonPreMulSrcPixelColor<0)
882 INFO_PRINTF4(_L("Processing source colours for MDest=%i, CDest=%i, MSrc=%i"),aPreMulDestPixColor,aNonPreMulDestPixColor,aPreMulSrcPixelColor);
886 INFO_PRINTF5(_L("Processing colour set MDest=%i, CDest=%i, MSrc=%i, CSrc=%i"),aPreMulDestPixColor,aNonPreMulDestPixColor,aPreMulSrcPixelColor,aNonPreMulSrcPixelColor);
891 @SYMTestCaseID GRAPHICS-CTDirectScreenBitmap-ExhaustiveTestMergeL-0001
893 @SYMTestCaseDesc Test that the alpha merge methods work accurately
894 @SYMTestPriority High
895 @SYMTestStatus Implemented
896 @SYMTestActions Create an alpha capable bitmap and throw sample values at the merge function
897 @SYMTestExpectedResults
898 1a) The merge resultant alpha values do not wrap through 256
899 1b) The merge resultant alpha values closely match an equivalent floating-point calculation
900 2a) The merge resultant colours do not wrap through 256
901 2b) The merge resultant colours do not exceed the resultant alpha if premultiplied output is expected
902 2c) The merge resultant colours closely match an equivalent floating-point calculation
904 Exhaustive test of Blend function for every pixel value. Tests combinations of source and destination
905 colour and alpha for a particular colour channel (0=red, 1= green, 2=blue). This method emulates the merge
906 operation in floating piont and compares the result with the real merge function. Generally the method is
907 intended to error-test premultiplied or non-multiplied, or permutations, based on the flags aInSrcPreMul,
908 aInDestPreMul,aOutDestPreMul.
909 @param aInSrcPreMul if true the source pixel colour will be clipped and treated as premultiplied
910 @param aInDestPreMul if true the destination pixel colour will be clipped and treated as premultiplied
911 @param aOutDestPreMul if true the calculated pixel colour will be clipped and treated as premultiplied
912 @param aStepSize specifies how many brightness levels are skipped. 1,3,5,15,17 are good values
913 @param aChannelControl which channel is controlled (0=red, 1= green, 2=blue)
914 @param aOtherChannels value used for other channels. In PM modes this will be clipped to the mask value
915 @param aTestMode mode of bitmap device. I presume it is consistant with the PreMul flags above
917 void CTDirectScreenBitmap::ExhaustiveTestMergeL(TBool aInSrcPreMul,TBool aInDestPreMul,TBool aOutDestPreMul,
918 TInt aStepSize,TInt aChannelControl)
920 ExhaustiveTestMergePerDispModeL(EColor64K,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
921 ExhaustiveTestMergePerDispModeL(EColor4K,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
922 ExhaustiveTestMergePerDispModeL(EColor16M,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
923 ExhaustiveTestMergePerDispModeL(EColor16MU,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
924 ExhaustiveTestMergePerDispModeL(EColor16MA,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
925 ExhaustiveTestMergePerDispModeL(EColor16MAP,aInSrcPreMul,aInDestPreMul, aOutDestPreMul, aStepSize,aChannelControl);
930 void CTDirectScreenBitmap::ExhaustiveTestMergePerDispModeL(TDisplayMode aDrawDeviceDispMode, TBool aInSrcPreMul,TBool aInDestPreMul,TBool aOutDestPreMul,
931 TInt aStepSize,TInt aChannelControl,TInt aOtherChannels,
932 TDisplayMode aTestMode)
934 CFbsDrawDevice *pDev = NULL;
935 iDispMode = aDrawDeviceDispMode;
936 TRAPD(err,pDev = CFbsDrawDevice::NewScreenDeviceL(0,aDrawDeviceDispMode));
939 INFO_PRINTF2(_L("Note: Failed to create screen device for display mode %i - not supported on this config?"),iDispMode);
943 INFO_PRINTF2(_L("Test Exhaustive Merge for display mode %i "),iDispMode);
944 User::LeaveIfError(pDev->InitScreen());
945 pDev->SetAutoUpdate(ETrue);
946 TSize screenSize = pDev->SizeInPixels();
948 //Full screen non-incremental run
949 TRect directRect(TPoint(0, 0), screenSize);
950 INFO_PRINTF1(_L("PDEF099416: Test of pixel merge over full colour and alpha range"));
952 TRAPD(err, ConstructL(directRect, CDirectScreenBitmap::ENone));
956 INFO_PRINTF1(_L("The Direct Screen Bitmap object is not created"));
960 if (!iInterface->ScreenClear())
962 INFO_PRINTF1(_L("The display mode of the iBitmapInfo is not expected"));
968 TSize bitmapSize(256,1);
969 TUint32 bitmapMem[256];
970 TUint32 srcLine[256];
971 CFbsDrawDevice* bmd = CFbsDrawDevice::NewBitmapDeviceL(bitmapSize, aTestMode, CFbsBitmap::ScanLineLength(256, aTestMode));
972 CleanupStack::PushL(bmd);
974 bmd->SetAutoUpdate(EFalse);
975 bmd->SetBits(bitmapMem);
976 //Eveything printed to the screen is just to show the error levels graphically.
977 //Patterns are very interesting sometimes
978 if (screenSize.iHeight>200 && screenSize.iWidth>600)
980 iInterface->BeginDraw();
981 iInterface->DrawColor(TRect(260,0,290,30),TRgb(255,0,0));
982 iInterface->DrawColor(TRect(260,30,290,60),TRgb(100,0,0));
983 iInterface->DrawColor(TRect(260,60,290,90),TRgb(100,0,0));
984 iInterface->DrawColor(TRect(260,100,290,130),TRgb(0,255,0));
985 iInterface->DrawColor(TRect(260,130,290,160),TRgb(0,200,0));
986 iInterface->DrawColor(TRect(260,160,290,190),TRgb(0,100,0));
987 iInterface->DrawColor(TRect(560,100,590,130),TRgb(0,0,255));
988 iInterface->DrawColor(TRect(560,130,590,160),TRgb(0,0,200));
989 iInterface->DrawColor(TRect(560,160,590,190),TRgb(0,0,100));
990 iInterface->EndDraw(iRequestStatus);
994 if (aChannelControl<1)
996 channelMask=0x0000FF;
1000 if(aChannelControl==1)
1002 channelMask=0x00FF00;
1006 channelMask=0xFF0000;
1009 const TInt otherMask=0xFFFFFF^channelMask;
1010 const TInt channelMul=channelMask&0x01010101;
1011 const TInt addFactor=aOtherChannels & otherMask; //Use to set the other colour channels with a fixed test value
1014 INFO_PRINTF3(_L("AddFactor pass: channel %i others %x "),aChannelControl,addFactor);
1015 passFlag=passFlag^0x8000;
1016 const TReal KIgnore=0.00000001;//0.3;
1017 const TReal KGross=1.51;
1018 const TReal KMultiplyErrorBrightness=200.0;
1022 TReal totErrAlpha=0;
1024 TReal zeroErrAlpha=0;
1026 TInt countColours=0;
1027 const TInt stepFactor=aStepSize; //1, 3, 5, 15, 17; //This has a ^3 effect on speed
1028 TIgnoreSpecialCases ignoreSpecialCases(aInSrcPreMul,aInDestPreMul,aOutDestPreMul);
1029 //bkgrdMask is background mask/alpha input value
1031 for (TInt bkgrdMask=0;bkgrdMask<256;bkgrdMask+=stepFactor)
1034 iInterface->BeginDraw();
1035 iInterface->DrawColour64KPixel(270+bkgrdMask/screenSize.iHeight,bkgrdMask%screenSize.iHeight, TRgb(addFactor|passFlag));
1036 TInt maxChannels=256;
1039 maxChannels=bkgrdMask+1;
1041 TInt clippedother=((addFactor-((bkgrdMask*0x010101)&otherMask))>>8)&otherMask;
1042 //clippedother is now 0x00FF00FF or 0x00000000 (or 0x00FF0000 or 0x000000FF)
1043 clippedother=(addFactor&(clippedother^otherMask))|(((bkgrdMask*0x010101)&clippedother));
1044 //bkgrdChannel is background channel input value. In PM it is 0...bkgrdMask. In NP it is 0...255
1045 for (TInt bkgrdChannel=0,colour=(bkgrdMask<<24)|clippedother,stepChannel=stepFactor*channelMul;bkgrdChannel<maxChannels;bkgrdChannel+=stepFactor,colour+=stepChannel)
1047 TInt failsPerPass=10;
1049 if (logLine>=screenSize.iHeight)
1053 //srcMask is the source mask/alpha
1054 for (TInt srcMask=0;srcMask<256;srcMask+=stepFactor) //0 and 255 are special cases, but need testing anyway!
1056 TInt maxChannels=256; //nested
1059 maxChannels=srcMask+1; //In PM-PM source colour passes through unchanged, so skip the tests
1061 bmd->WriteRgbMulti(0,0,maxChannels,1,TRgb(colour,bkgrdMask),CGraphicsContext::EDrawModeWriteAlpha);
1062 TInt clippedother=((addFactor-((srcMask*0x010101)&otherMask))>>8)&otherMask;
1063 //clippedother is now 0x00FF00FF or 0x00000000 (or 0x00FF0000 or 0x000000FF)
1064 clippedother=(addFactor&(clippedother^otherMask))|(((srcMask*0x010101)&clippedother));
1066 //srcChannel1 is the source channel input value. In PM it is 0...srcMask. In NP it is 0...255
1067 for (TInt srcChannel1=0,C=(srcMask<<24)+clippedother;srcChannel1<maxChannels;srcChannel1++,C+=channelMul)
1069 srcLine[srcChannel1]=C;
1071 bmd->WriteLine(0,0,maxChannels,srcLine,CGraphicsContext::EDrawModePEN);
1078 //source multiplier factor for alpha that can then be used to optimise non-multiplied input calculations.
1079 TReal srcMultiplier=srcMask/255.0;
1080 //destination/background multiplier factor for alpha that can then be used to optimise non-multiplied input calculations.
1081 TReal destMultiplier=(bkgrdMask/255.0)*(1.0-srcMultiplier);
1082 //alphaPixelValue is the alpha pixel value as generated from the library code under test
1083 TUint alphaPixelValue=bmd->ReadPixel(0,0).Alpha();
1084 //alphaDiff is the difference in alpha between pixel and float calcuation, i.e. the error. This can be less than 1 level of brightness, i.e. insignificant.
1085 TReal alphaDiff=0.0;
1086 //pre-mul mode does not effect the alpha calculation
1087 //alphaOutputValue is a floating-point calculation of the alpha output value using 255.0 as the scaling factor.
1088 TReal alphaOutputValue=(srcMultiplier+destMultiplier)*255.0;
1089 alphaDiff=alphaOutputValue-alphaPixelValue;
1090 zeroErrAlpha+=alphaDiff;
1091 if (alphaDiff>KIgnore || alphaDiff<-KIgnore)
1095 if (alphaDiff>KGross)
1097 if (--failsPerPass>0)
1098 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,-1,alphaOutputValue,alphaPixelValue,alphaDiff,_L("Big Alpha error: expected %f, got %f"),ETrue);
1099 errAGross+=(alphaDiff-KIgnore)*KMultiplyErrorBrightness;
1103 errAPos+=(alphaDiff-KIgnore)*KMultiplyErrorBrightness;
1105 totErrAlpha+=alphaDiff;
1109 if(alphaDiff<-KGross)
1111 if (--failsPerPass>0)
1112 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,-1,alphaOutputValue,alphaPixelValue,alphaDiff,_L("Big Alpha error: expected %f, got %f"),ETrue);
1113 errAGross-=(alphaDiff+KIgnore)*KMultiplyErrorBrightness;
1117 errANeg-=(alphaDiff+KIgnore)*KMultiplyErrorBrightness;
1119 totErrAlpha-=alphaDiff;
1122 TInt errA= STATIC_CAST(TInt,(errAPos-errANeg));
1124 countColours+=maxChannels;
1125 //The other channel values should not change while the tested channel is modulated...
1126 //So I grab it's value for the zero case to compare.
1127 TUint otherChannels0=bmd->ReadPixel(0,0).Color16MA()&(otherMask|0xff000000);
1129 //srcChannel is the source channel input value. In PM it is 0...srcMask. In NP it is 0...255
1130 for (TInt srcChannel=0;srcChannel<maxChannels;srcChannel++)
1132 //channelOutputValue is a floating-point calculation of the channel output value using 255.0 as the scaling factor.
1133 TReal channelOutputValue;
1136 channelOutputValue=srcChannel;
1140 channelOutputValue=srcChannel*srcMultiplier;
1145 channelOutputValue+=bkgrdChannel*(1.0-srcMultiplier);
1149 channelOutputValue+=bkgrdChannel*destMultiplier;
1152 if (!aOutDestPreMul)
1154 if ((srcMultiplier+destMultiplier)!=0)
1156 channelOutputValue=channelOutputValue/(srcMultiplier+destMultiplier);
1159 TUint readPixel=bmd->ReadPixel(srcChannel,0).Color16MA();
1160 //channelPixelValue is the channel pixel value as generated from the library code under test
1161 TUint channelPixelValue=(readPixel&channelMask)/channelMul;
1164 if (channelPixelValue>alphaPixelValue)
1166 if (!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel))
1168 if (--failsPerPass>0)
1170 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,srcChannel,alphaPixelValue,channelOutputValue,channelPixelValue,_L("Output multiplied colour exceeds alpha %f: expected %f got %f"),!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel));
1174 errGross+=10; //output value out of range - bright red spot!
1177 TUint otherChannels=readPixel&(otherMask|0xff000000);
1178 if (otherChannels!=otherChannels0)
1179 { //Other channels should all be constant here!
1180 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,srcChannel,otherChannels0,otherChannels,0,_L("Output for other channels changed when modulating test channel only - Inter-channel leakage? srcChannel=0 value = %f, this value = %f"),ETrue);
1182 //channelDiff is the difference in channel between pixel and float calcuation, i.e. the error. This can be less than 1 level of brightness, i.e. insignificant.
1183 TReal channelDiff=channelOutputValue-channelPixelValue;
1184 zeroErrCol+=channelDiff;
1186 if (channelDiff>KIgnore || channelDiff<-KIgnore)
1189 if (channelDiff>KGross)
1191 if (!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel))
1193 if (--failsPerPass>0)
1195 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,srcChannel,channelOutputValue,channelPixelValue,channelDiff,_L("Big Colour error: expected %f, got %f"),!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel));
1198 errGross+=channelDiff-KIgnore;
1202 errPos+=channelDiff-KIgnore;
1204 totErrCol+=channelDiff;
1208 if (channelDiff<-KGross)
1210 if (!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel))
1212 if (--failsPerPass>0)
1214 LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,srcChannel,channelOutputValue,channelPixelValue,channelDiff,_L("Big Colour error: expected %f, got %f"),!ignoreSpecialCases(bkgrdMask,bkgrdChannel,srcMask,srcChannel));
1217 errGross-=channelDiff+KIgnore;
1221 errNeg-=channelDiff+KIgnore;
1224 totErrCol-=channelDiff;
1228 TReal err=errPos-errNeg;
1229 errGross+=errAGross;
1230 if (errA>errAMax256)
1232 //LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,-1,errA,0,0,_L("Row alpha error level increase, now: %f"),EFalse);
1235 errPos=Min(TReal(255),(errPos*KMultiplyErrorBrightness/TReal(maxChannels)));
1236 errNeg=Min(TReal(255),(errNeg*KMultiplyErrorBrightness/TReal(maxChannels)));
1237 TReal err256=Min(TReal(255),err*KMultiplyErrorBrightness/TReal(maxChannels));
1240 //LogColourEvent(bkgrdMask,bkgrdChannel,srcMask,-1,err256,err,0,_L("Row colour error level increase, per call now: %f value for row: %f"),EFalse);
1244 errAPos=Min(TReal(255),(errAPos));
1245 errANeg=Min(TReal(255),(errANeg));
1249 errGross=TReal(255);
1253 errGross*=TReal(20);
1255 TRect pix(TPoint(),TSize(1,1));
1256 if (screenSize.iWidth>260)
1258 iInterface->DrawColour64KPixel(srcMask,logLine, TRgb(STATIC_CAST(TInt,errGross),STATIC_CAST(TInt,errNeg),STATIC_CAST(TInt,errPos)));
1260 if (screenSize.iWidth>360)
1262 iInterface->DrawColour64KPixel(srcMask+300,logLine, TRgb(STATIC_CAST(TInt,errGross),STATIC_CAST(TInt,errNeg),STATIC_CAST(TInt,errPos)));
1267 { //note that this count may be out by 1...
1268 INFO_PRINTF2(_L("Additional %i errors not reported in this pass."),-failsPerPass);
1272 iInterface->EndDraw(iRequestStatus);
1275 if (ignoreSpecialCases.IgnoreCount() && ignoreSpecialCases.IgnoreCount()<ignoreSpecialCases.ExpectedIgnoreCount(aStepSize))
1277 TEST(ignoreSpecialCases.IgnoreCount()<ignoreSpecialCases.ExpectedIgnoreCount(aStepSize));
1278 INFO_PRINTF3(_L("There were less ignored special-case errors than exepected (but more than zero): Expected: 0 or %i, got %i"),
1279 ignoreSpecialCases.ExpectedIgnoreCount(aStepSize),ignoreSpecialCases.IgnoreCount()
1282 INFO_PRINTF4(_L("Highest error rows (normalised @%f per row): Alpha: %f, Colour: %f "),KMultiplyErrorBrightness,errMax,errAMax256);
1283 INFO_PRINTF4(_L("Alpha: Samples: %i, total abs= %f, total signed=%f (should be 0)"),countAlphas,totErrAlpha,zeroErrAlpha);
1284 INFO_PRINTF4(_L("Colour: Samples: %i, total abs= %f, total signed=%f (should be 0)"),countColours,totErrCol,zeroErrCol);
1286 CleanupStack::PopAndDestroy(bmd);
1294 void CTDirectScreenBitmap::RunTestCaseL(TInt aCurTestCase)
1296 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(KUnknownSYMTestCaseIDName);
1297 switch(aCurTestCase)
1300 INFO_PRINTF1(_L("INC0594703 : TestRefreshingWindowsL"));
1301 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-TestRefreshingWindowsL-0001"));
1302 TestRefreshingWindowsL();
1305 INFO_PRINTF1(_L("Test Continuous Refreshing Frames"));
1306 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-TestRefreshingWindowsL-0001"));
1307 TestContinuousRefreshingL();
1310 INFO_PRINTF1(_L("Exhaustive merge test"));
1311 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-ExhaustiveTestMergeL-0001"));
1312 ExhaustiveTestMergeL(EFalse,EFalse,ETrue,5,0);
1313 ((CTDirectScreenBitmapStep*)iStep)->RecordTestResultL();
1314 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-ExhaustiveTestMergeL-0001"));
1315 ExhaustiveTestMergeL(EFalse,EFalse,ETrue,5,1);
1316 ((CTDirectScreenBitmapStep*)iStep)->RecordTestResultL();
1317 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-ExhaustiveTestMergeL-0001"));
1318 ExhaustiveTestMergeL(EFalse,EFalse,ETrue,5,2);
1319 ((CTDirectScreenBitmapStep*)iStep)->RecordTestResultL();
1322 INFO_PRINTF1(_L("Test refreshing time"));
1323 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(_L(" GRAPHICS-CTDirectScreenBitmap-TestRefreshingWindowsL-0001"));
1324 TestRefreshingTimeL();
1327 ((CTDirectScreenBitmapStep*)iStep)->SetTestStepID(KNotATestSYMTestCaseIDName);
1328 ((CTDirectScreenBitmapStep*)iStep)->CloseTMSGraphicsStep();
1332 ((CTDirectScreenBitmapStep*)iStep)->RecordTestResultL();
1336 __CONSTRUCT_STEP__(DirectScreenBitmap)
1338 void CTDirectScreenBitmapStep::TestSetupL()
1341 User::LeaveIfError(HAL::Get(HALData::EDisplayColors, temp));//force HAL memory allocation