First public contribution.
1 // Copyright (c) 2010 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.
16 #include <test/extendtef.h>
18 #include "openwftest.h"
20 #define KCompositorVersion 0x01023456
21 #define KGrowCleanupStack 12
22 #define KMaxNotificationDelay 5000000 //5 seconds
23 #define KNotificationWarning 100000 //100 ms
25 _LIT(KTestSectionName, "TestInfo");
26 _LIT(KImageSectionName, "ImageInfo");
27 _LIT(KContiguousFlag, "ContiguousFlag");
28 _LIT(KTolerance, "Tolerance");
29 _LIT(KTestMode, "TestMode");
30 _LIT(KSaveImage, "SaveImage");
32 _LIT(KDefaultDir, "c:\\openwftest\\img\\");
33 _LIT(KCompositionPause, "CompositionPause");
34 _LIT(KManualPause, "ManualPause");
36 //Uncomment this and rebuild if you wish to test if fastpath is enabled using breakpoints
37 //#define BREAKPOINT_FASTPATH
40 * COpenwfTest implementation
42 COpenwfTest::COpenwfTest()
43 :iFastpathablePixelFormat(EUidPixelFormatXRGB_8888),
44 iNonFastpathablePixelFormat(EUidPixelFormatRGB_565),
48 iCacheAttrib(ECacheNotlisted),
49 iDeviceId(WFC_INVALID_HANDLE),
50 iSync(EGL_NO_SYNC_KHR),
51 iDevice(WFC_INVALID_HANDLE),
52 iContext(WFC_INVALID_HANDLE)
56 COpenwfTest::~COpenwfTest()
61 void COpenwfTest::SetupL()
63 iScheduler = new(ELeave) CActiveScheduler;
64 CActiveScheduler::Install(iScheduler);
68 iEGLDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
69 ASSERT_FALSE(iEGLDisplay == EGL_NO_DISPLAY);
70 ASSERT_FALSE(iEGLDisplay == EGL_BAD_ALLOC);
71 ASSERT_EQUALS(eglGetError(),EGL_SUCCESS);
72 eglInitialize(iEGLDisplay, NULL, NULL);
73 ASSERT_EQUALS(eglGetError(),EGL_SUCCESS);
75 WFCint filterList[] = { WFC_DEVICE_FILTER_SCREEN_NUMBER, WFC_DEFAULT_SCREEN_NUMBER, WFC_NONE};
76 ASSERT_TRUE(wfcEnumerateDevices(&iDeviceId, 1, filterList) == 1);
77 ASSERT_TRUE(iDeviceId != WFC_INVALID_HANDLE);
79 iDevice = wfcCreateDevice(iDeviceId, NULL);
80 ASSERT_TRUE(iDevice != WFC_INVALID_HANDLE);
81 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
82 iContext = wfcCreateOnScreenContext(iDevice, WFC_DEFAULT_SCREEN_NUMBER, NULL);
83 ASSERT_TRUE(iContext != WFC_INVALID_HANDLE);
84 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
86 iFastpathableHeight = wfcGetContextAttribi(iDevice, iContext, WFC_CONTEXT_TARGET_HEIGHT);
87 iFastpathableWidth = wfcGetContextAttribi(iDevice, iContext, WFC_CONTEXT_TARGET_WIDTH);
88 iStride = iFastpathableWidth * 4;
90 iFullScreenTRect = TRect(0,0,iFastpathableWidth,iFastpathableHeight);
91 iFullScreenRect[0] = 0;
92 iFullScreenRect[1] = 0;
93 iFullScreenRect[2] = iFullScreenTRect.Width();
94 iFullScreenRect[3] = iFullScreenTRect.Height();
96 iCenterTRect = TRect(iFastpathableWidth/4,iFastpathableHeight/4,
97 3*iFastpathableWidth/4,3*iFastpathableHeight/4);
98 iCenterRect[0] = iCenterTRect.iTl.iX;
99 iCenterRect[1] = iCenterTRect.iTl.iY;
100 iCenterRect[2] = iCenterTRect.Width();
101 iCenterRect[3] = iCenterTRect.Height();
103 iHalfSizeRect[0] = 0;
104 iHalfSizeRect[1] = 0;
105 iHalfSizeRect[2] = iFastpathableWidth/2;
106 iHalfSizeRect[3] = iFastpathableHeight/2;
108 iUtility = CSurfaceUtility::NewL();
110 if((iTestMode == EAutomatic) || iSaveImage)
112 // Need to initialise the on screen stream before composition
113 // to ensure the content is available later
114 iUtility->GetOnScreenStream(iDevice, iContext);
117 { // Create a directory to save images
118 iUtility->CreateImagePath(iImageDirectory);
120 iAllowManualPause = ETrue; //tests can stop it (eg dispXtimes tests)
122 EGLint attrib_list[1] = {EGL_NONE};
123 iSync = eglCreateSyncKHR(iEGLDisplay,EGL_SYNC_REUSABLE_KHR, attrib_list);
124 ASSERT_NOT_EQUALS(iSync,EGL_NO_SYNC_KHR);
125 ASSERT_EQUALS(eglGetError(),EGL_SUCCESS);
129 * test Suite furniture
131 void COpenwfTest::TearDownL()
133 // Nothing leaves in this function,
134 // but TearDownL() is needed for the CTestFixture (TEF) interface
138 void COpenwfTest::TearDown()
140 WFCErrorCode wfcError;
141 if (iDevice != WFC_INVALID_HANDLE)
143 wfcError = wfcGetError(iDevice);
144 if (wfcError != WFC_ERROR_NONE)
146 INFO_PRINTF2(_L("TearDown: There was a failure in the test. error=%d"),wfcError);
149 if (iOnScreenStream != WFC_INVALID_HANDLE)
151 (void)SymbianStreamReleaseReadBuffer(iOnScreenStream, iOnScreenBuffer); //ignore the error
152 iOnScreenStream = WFC_INVALID_HANDLE;
156 if (iContext != WFC_INVALID_HANDLE)
158 wfcDestroyContext(iDevice, iContext);
159 iContext = WFC_INVALID_HANDLE;
160 WFCErrorCode wfcError = wfcGetError(iDevice);
161 if (wfcError != WFC_ERROR_NONE)
163 INFO_PRINTF2(_L("TearDown: wfcDestroyContext error=%d"),wfcError);
166 if (iDevice != WFC_INVALID_HANDLE)
168 WFCErrorCode deviceError = wfcDestroyDevice(iDevice);
169 iDevice = WFC_INVALID_HANDLE;
170 if (deviceError != WFC_ERROR_NONE)
172 INFO_PRINTF2(_L("TearDown: wfcDestroyDevice error=%d"),deviceError);
175 if (iSync != EGL_NO_SYNC_KHR)
177 EGLBoolean eglSyncError = eglDestroySyncKHR(iEGLDisplay, iSync);
178 iSync = EGL_NO_SYNC_KHR;
179 if (eglSyncError != EGL_TRUE)
181 INFO_PRINTF2(_L("TearDown: eglSyncError line %d"),__LINE__);
184 if (iEGLDisplay != EGL_NO_DISPLAY)
186 EGLBoolean eglTerminateError = eglTerminate(iEGLDisplay);
187 iEGLDisplay = EGL_NO_DISPLAY;
188 if (eglTerminateError != EGL_TRUE)
190 INFO_PRINTF2(_L("TearDown: eglTerminateError line %d"),__LINE__);
198 * To be called at the beginning of tests
199 * aActivate default is ON
201 void COpenwfTest::SetupEmptySceneL(TBool aActivate)
203 #ifdef BREAKPOINT_FASTPATH
206 wfcSetContextAttribi(iDevice, iContext, WFC_CONTEXT_ROTATION, WFC_ROTATION_0);
207 wfcSetContextAttribi(iDevice, iContext, WFC_CONTEXT_BG_COLOR, 0xFFFFFFFF);
210 LOG(("OpenWFTest: Running in autonomous composition mode"));
211 wfcActivate(iDevice,iContext);
215 LOG(("OpenWFTest: Running in non autonomous composition mode"));
216 wfcDeactivate(iDevice,iContext);
218 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
219 wfcCommit(iDevice, iContext, WFC_TRUE); // Compose the scene
220 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
221 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
222 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
223 LOG(("OpenWFTest: Fastpath - setting up scene - fastpath now off"));
226 void COpenwfTest::ReadIniData()
229 TBool returnValue = iConfig.GetInt(KTestSectionName, KTestMode, iTestMode);
230 ASSERT_TRUE(returnValue);
234 if (iTestMode == EAutomatic)
236 returnValue = iConfig.GetBool(KTestSectionName, KSaveImage, iSaveImage);
239 // Get path for the images to be saved to
241 returnValue = iConfig.GetString(KTestSectionName, KDir, dir);
244 iImageDirectory.Set(dir);
248 iImageDirectory.Set(KDefaultDir);
251 // Composition pause in microseconds
252 TInt compositionPause;
253 returnValue = iConfig.GetInt(KTestSectionName, KCompositionPause, compositionPause);
254 ASSERT_TRUE(returnValue);
255 iCompositionPause = compositionPause;
257 // Manual pause in microseconds
259 if (iTestMode != EAutomatic)
262 returnValue = iConfig.GetInt(KTestSectionName, KManualPause, manualPause);
263 ASSERT_TRUE(returnValue);
264 iManualPause = manualPause;
268 TBool contiguousFlag;
269 returnValue = iConfig.GetBool(KImageSectionName, KContiguousFlag, contiguousFlag);
270 if (returnValue && contiguousFlag)
272 iContiguous = EContiguous;
277 returnValue = iConfig.GetInt(KImageSectionName, KTolerance, tolerance);
280 iTolerance = tolerance;
285 * Acquires the on screen stream and buffer number
286 * NOTE: this function should be paired with a ReleaseOnScreenStream call
287 * Returns ETrue on success
289 TBool COpenwfTest::AcquireOnScreenStream()
291 TInt error = KErrNone;
292 ASSERT_TRUE(iOnScreenStream == WFC_INVALID_HANDLE);
293 if(iTestMode == EAutomatic)
294 { //need to get the on screen stream
295 iOnScreenStream = iUtility->GetOnScreenStream(iDevice, iContext);
296 if(iOnScreenStream == WFC_INVALID_HANDLE)
298 INFO_PRINTF1(_L("Failed getting on screen stream"));
299 LOG(("OpenWFTest: *** Failed getting on screen stream"));
302 error = SymbianStreamAcquireReadBuffer(iOnScreenStream, &iOnScreenBuffer);
303 if (error != KErrNone)
305 LOG(("OpenWFTest: *** Unable to acquire read buffer. error = %d",error));
306 INFO_PRINTF2(_L("Unable to acquire read buffer. error = %d"),error);
308 return (error == KErrNone);
312 INFO_PRINTF1(_L("No need to get the on screen stream, probably manual checking mode"));
313 LOG(("OpenWFTest: *** No need to get the on screen stream, probably manual checking mode"));
319 * Releases the on screen stream
321 void COpenwfTest::ReleaseOnScreenStream()
323 if (iOnScreenStream != WFC_INVALID_HANDLE)
325 (void)SymbianStreamReleaseReadBuffer(iOnScreenStream, iOnScreenBuffer); //ignore the error
326 iOnScreenStream = WFC_INVALID_HANDLE;
328 if(iTestMode != EAutomatic && iAllowManualPause)
330 INFO_PRINTF1(_L("Performing manual wait"));
331 LOG(("OpenWFTest: *** Performing manual wait"));
332 TRAP_IGNORE(WaitL(iManualPause));
334 if(iTestMode != EAutomatic && !iAllowManualPause)
336 INFO_PRINTF1(_L("Test not allowing a manual wait"));
337 LOG(("OpenWFTest: *** Test not allowing a manual wait"));
342 * Checks the rect of the on screen stream
343 * Returns ETrue on success
345 TBool COpenwfTest::CheckOnScreenStreamRect(TRect aRect, const TRgb& aExpectedColor, TInt aTolerance)
347 if(iTestMode == EAutomatic)
349 if (iOnScreenStream == WFC_INVALID_HANDLE)
351 LOG(("OpenWFTest: *** We don't have access to the on screen stream"));
352 INFO_PRINTF1(_L("We don't have access to the on screen stream"));
355 const TSurfaceId* surfaceId = NULL;
357 TInt error = SymbianStreamGetBufferId(iOnScreenStream,iOnScreenBuffer,&bufferIndex,&surfaceId);
358 if (error == KErrNone)
360 return CheckRect(*surfaceId,bufferIndex,aRect,aExpectedColor,aTolerance);
364 LOG(("OpenWFTest: *** Unable to get stream buffer id. error = %d",error));
365 INFO_PRINTF2(_L("Unable to get stream buffer id. error = %d"),error);
370 { //print out what we're hoping to see for manual testing
371 LOG(("OpenWFTest: For rect %d %d %d %d",aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY));
372 LOG(("OpenWFTest: The expected color is r=%d g=%d b=%d",aExpectedColor.Red(),aExpectedColor.Green(),
373 aExpectedColor.Blue()));
374 INFO_PRINTF5(_L("For rect %d %d %d %d"),aRect.iTl.iX,aRect.iTl.iY,aRect.iBr.iX,aRect.iBr.iY);
375 INFO_PRINTF4(_L("The expected color is r=%d g=%d b=%d"),aExpectedColor.Red(),aExpectedColor.Green(),
376 aExpectedColor.Blue());
382 * checks the color within the given rectangle of the given surface
383 * returns ETrue on success
385 TBool COpenwfTest::CheckRect(const TSurfaceId& aSurface, TInt aBuffer, TRect aRect,
386 const TRgb& aExpectedColor, TInt aTolerance)
388 INFO_PRINTF1(_L("Starting pixel checking"));
389 LOG(("OpenWFTest: *** Starting pixel checking"));
392 TBool success = iUtility->CheckRectColor(aSurface, aRect, aBuffer, aExpectedColor, aTolerance);
395 INFO_PRINTF1(_L("Finished pixel checking - pass"));
396 LOG(("OpenWFTest: *** Finished pixel checking - pass"));
400 INFO_PRINTF1(_L("Finished pixel checking - fail"));
401 LOG(("OpenWFTest: *** Finished pixel checking - fail"));
407 * If in automatic mode it will save a TGA image of the on screen stream.
408 * It will also print the name of the reference image.
409 * Returns ETrue on success
411 TBool COpenwfTest::CheckOnScreenReferenceImage()
413 TInt error = KErrNone;
414 //Create image file name
415 _LIT(KSeparator, "_");
416 _LIT(KTGAImgFormat, ".tga");
417 iImageAddress.Zero();
418 iImageAddress.Append(iTestName);
419 iImageAddress.Append(KSeparator);
420 iImageAddress.AppendNum(iImageCounter);
421 iImageAddress.Append(KTGAImgFormat);
423 LOGL((_L("Reference Image:%S"),&iImageAddress));
424 INFO_PRINTF2(_L("Reference Image:%S"),&iImageAddress);
426 iImageAddress.Insert(0,iImageDirectory);
429 if(iTestMode == EAutomatic && iSaveImage)
431 if (iOnScreenStream == WFC_INVALID_HANDLE)
433 LOG(("OpenWFTest: *** We don't have access to the on screen stream",error));
434 INFO_PRINTF1(_L("We don't have access to the on screen stream"));
437 const TSurfaceId* surfaceId = NULL;
439 error = SymbianStreamGetBufferId(iOnScreenStream,iOnScreenBuffer,&bufferIndex,&surfaceId);
440 if (error == KErrNone)
442 return SaveImage(*surfaceId,bufferIndex);
446 LOG(("OpenWFTest: *** Unable to get stream buffer id. error = %d",error));
447 INFO_PRINTF2(_L("Unable to get stream buffer id. error = %d"),error);
455 * helper function for saving images to files
456 * returns ETrue on success
458 TBool COpenwfTest::SaveImage(const TSurfaceId& aSurface, TInt aNumOfBuffer)
460 if(iTestMode == EAutomatic && iSaveImage)
462 INFO_PRINTF1(_L("Start to save image"));
463 LOG(("OpenWFTest: *** Start to save image"));
464 TBool success = EFalse;
465 TRAPD(error, success = iUtility->SaveResultImageTGAL(aSurface, aNumOfBuffer, iImageAddress));
466 if(error != KErrNone || !success)
468 INFO_PRINTF1(_L("Failed saving image"));
469 LOG(("OpenWFTest: *** Failed saving image"));
472 INFO_PRINTF1(_L("Saved image"));
473 LOG(("OpenWFTest: *** Saved image"));
479 * Basic wait function call. Return amount of other active objects that stopped the scheduler
481 TInt COpenwfTest::WaitL(TTimeIntervalMicroSeconds32 aDelay) //aDelay in microseconds
483 CActiveWaiter* waiter = NULL;
484 waiter = CActiveWaiter::NewL();
485 TInt counter = waiter->Wait(aDelay);
491 * aMaxDelay The maximum time we are willing to wait in microseconds
492 * aNotifications The amount of notifications we expect to complete, must be >0
493 * Returns ETrue on success
495 TBool COpenwfTest::WaitForNotifications(TTimeIntervalMicroSeconds32 aMaxDelay,TInt aNotificatons)
497 if (aNotificatons == 0)
498 { //use WaitL if no notifications are expected
503 before.UniversalTime();
504 TTimeIntervalMicroSeconds diff;
505 TInt counter = aNotificatons;
506 CActiveWaiter* waiter = NULL;
507 TRAP_IGNORE(waiter = CActiveWaiter::NewL());
510 INFO_PRINTF1(_L("Failed creating CActiveWaiter"));
511 LOG(("OpenWFTest: *** Failed creating CActiveWaiter"));
514 waiter->StartWait(aMaxDelay);
515 CActiveScheduler::Start();
518 after.UniversalTime();
519 diff = after.MicroSecondsFrom(before);
520 if (diff > KNotificationWarning)
522 INFO_PRINTF2(_L("note: Notification took a long time to complete: %ld microseconds"),diff.Int64());
523 LOG(("OpenWFTest: *** note: Notification took a long time to complete: %ld microseconds",diff.Int64()));
527 { //all expected notifications were completed
531 CActiveScheduler::Start();
533 INFO_PRINTF2(_L("Not all notifications completed, counter=%d"),counter);
534 LOG(("OpenWFTest: *** Not all notifications completed, counter=%d",counter));
536 //the notifications didn't complete in time
540 // Create a suite of all the tests
541 CTestSuite* COpenwfTest::CreateSuiteL(const TDesC& aName)
543 SUB_SUITE_OPT(COpenwfTest,NULL);
544 //positive fastpath tests
545 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0000L);
546 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0001L);
547 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0002L);
548 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0003L);
549 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0004L);
550 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0005L);
551 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0006L);
552 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0007L);
553 //fastpath with notification tests
554 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0010L);
555 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0011L);
556 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0012L);
557 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0013L);
558 //negative fastpath tests
559 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0020L);
560 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0021L);
561 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0022L);
562 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0023L);
563 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0024L);
564 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0025L);
565 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0026L);
566 ADD_THIS_TEST_STEP(GRAPHICS_OPENWFC_FASTPATH_0027L);
571 void TefUnitFailLeaveL()
573 User::Leave(KErrTEFUnitFail);
576 CActiveNotification* CActiveNotification::NewL(RSurfaceUpdateSession& aSurfaceUpdateSession,TBool aActivate)
578 CActiveNotification* self = new (ELeave) CActiveNotification;
579 CleanupStack::PushL(self);
580 self->ConstructL(aSurfaceUpdateSession);
581 CleanupStack::Pop(self);
589 void CActiveNotification::ConstructL(RSurfaceUpdateSession& aSurfaceUpdateSession)
591 CActiveScheduler::Add(this);
592 iSurfaceUpdateSession = aSurfaceUpdateSession;
595 CActiveNotification::CActiveNotification() : CActive(EPriorityNormal)
598 CActiveNotification::~CActiveNotification()
603 void CActiveNotification::DoCancel()
604 { //we need to cancel all notifications - this will impact other notifications in this sus session!
605 iSurfaceUpdateSession.CancelAllUpdateNotifications();
608 void CActiveNotification::RunL()
610 CActiveScheduler::Stop();
613 TInt CActiveNotification::RunError(TInt aError)
615 return aError; // exists so a break point can be placed on it.
618 void CActiveNotification::Activate()
623 CActiveWaiter* CActiveWaiter::NewL()
625 CActiveWaiter* self = new (ELeave) CActiveWaiter;
626 CleanupStack::PushL(self);
628 CleanupStack::Pop(self);
632 void CActiveWaiter::ConstructL()
634 User::LeaveIfError(iTimer.CreateLocal());
635 CActiveScheduler::Add(this);
638 CActiveWaiter::CActiveWaiter() : CActive(CActive::EPriorityStandard)
641 CActiveWaiter::~CActiveWaiter()
647 void CActiveWaiter::DoCancel()
652 void CActiveWaiter::RunL()
655 CActiveScheduler::Stop();
658 TInt CActiveWaiter::RunError(TInt aError)
660 return aError; // exists so a break point can be placed on it.
664 * Waits the set amount of time. Returns the amount of times the active scheduler
665 * was stopped (not including its own active scheduler stop)
667 TInt CActiveWaiter::Wait(TTimeIntervalMicroSeconds32 aDelay) //microseconds
671 iTimer.After(iStatus, aDelay);
673 CActiveScheduler::Start();
675 {//may be another object that stops the scheduler running in these tests.
677 CActiveScheduler::Start();
683 * Starts an AO with the given delay. Remember the RunL will stop the active scheduler.
685 void CActiveWaiter::StartWait(TTimeIntervalMicroSeconds32 aDelay) //microseconds
688 iTimer.After(iStatus, aDelay);
692 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0000
693 @SYMTestCaseDesc Positive testing - Fastpath one-element scene
695 @SYMPREQ PREQ417-54885
696 @SYMTestType Unit Test
697 @SYMTestPriority High
698 @SYMTestPurpose Check a scene meeting fastpath criteria can be fastpathed
700 All compositions are autonomous:
701 Compose an empty scene
702 Create a scene containing a screen sized element with no scaling, no alpha, no mask, no rotation
704 @SYMTestExpectedResults
705 The final scene should be fastpathed
707 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0000L()
709 iTestName = _L("FASTPATH_0000");
710 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
711 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
714 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
715 iFastpathablePixelFormat,
716 iStride, iContiguous, iMaxBuffers);
717 ASSERT_FALSE(surface.IsNull());
719 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
720 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
721 ASSERT_EQUALS(err,KErrNone);
722 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
723 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
725 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
726 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
728 #ifdef BREAKPOINT_FASTPATH
731 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
732 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
733 wfcCommit(iDevice, iContext, WFC_TRUE);
734 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
735 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
736 LOG(("OpenWFTest: Fastpath - Now ON"));
738 iUtility->FillSurfaceL(surface, 0, KGreen);
739 err = iUtility->SubmitUpdate(surface, 0, NULL);
740 ASSERT_EQUALS(err,KErrNone);
741 WaitL(iCompositionPause);
743 ASSERT_TRUE(AcquireOnScreenStream());
744 ASSERT_TRUE(CheckOnScreenReferenceImage());
745 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
746 ReleaseOnScreenStream();
748 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
749 wfcDestroySource(iDevice, fpSource);
753 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0001
754 @SYMTestCaseDesc Positive testing - Fastpath one-element scene
756 @SYMPREQ PREQ417-54885
757 @SYMTestType Unit Test
758 @SYMTestPriority High
759 @SYMTestPurpose Check a scene including a full screen element with global alpha at opaque level
762 All compositions are autonomous:
763 Compose an empty scene
764 Create a scene containing a screen sized element with 2 buffers
765 Enable WFC_TRANPARENCY_GLOBAL_ALPHA
766 Set WFC_ELEMENT_GLOBAL_ALPHA to be 255 (opaque)
768 @SYMTestExpectedResults
769 The final scene should be fastpathed
771 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0001L()
773 iTestName = _L("FASTPATH_0001");
774 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
775 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
778 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
779 iFastpathablePixelFormat,
780 iStride, iContiguous, iMaxBuffers);
781 ASSERT_FALSE(surface.IsNull());
783 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
784 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
785 ASSERT_EQUALS(err,KErrNone);
786 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
787 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
789 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
790 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
791 //set element global alpha
792 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA);
793 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, 1.0f);
795 #ifdef BREAKPOINT_FASTPATH
798 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
799 LOG(("OpenWFTest: Expecting FASTPATH after next commit - using element alpha"));
800 wfcCommit(iDevice, iContext, WFC_TRUE);
801 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
802 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
803 LOG(("OpenWFTest: Fastpath - now ON - using element alpha"));
805 iUtility->FillSurfaceL(surface, 0, KGreen);
806 err = iUtility->SubmitUpdate(surface, 0, NULL);
807 ASSERT_EQUALS(err,KErrNone);
808 WaitL(iCompositionPause);
810 ASSERT_TRUE(AcquireOnScreenStream());
811 ASSERT_TRUE(CheckOnScreenReferenceImage());
812 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
813 ReleaseOnScreenStream();
815 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
816 wfcDestroySource(iDevice, fpSource);
820 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0002
821 @SYMTestCaseDesc Positive testing - Fastpath one-element scene
823 @SYMPREQ PREQ417-54885
824 @SYMTestType Unit Test
825 @SYMTestPriority High
826 @SYMTestPurpose Check a scene including a full screen element with source alpha flagged but an
827 opaque data format can be fastpathed
829 All compositions are autonomous:
830 Compose an empty scene
831 Create a scene containing a screen sized element
832 Enable WFC_TRANSPARENCY_SOURCE, but the source format has no alpha value
834 @SYMTestExpectedResults
835 The final scene should be fastpathed
837 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0002L()
839 iTestName = _L("FASTPATH_0002");
840 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
841 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
844 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
845 EUidPixelFormatXRGB_8888,
846 iStride, iContiguous, iMaxBuffers);
847 ASSERT_FALSE(surface.IsNull());
849 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
850 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
851 ASSERT_EQUALS(err,KErrNone);
852 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
853 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
854 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
855 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
856 //set pixel alpha on XRGB element
857 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_SOURCE);
859 #ifdef BREAKPOINT_FASTPATH
862 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
863 LOG(("OpenWFTest: Expecting FASTPATH after next commit - using pixel alpha"));
864 wfcCommit(iDevice, iContext, WFC_TRUE);
865 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
866 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
867 LOG(("OpenWFTest: Fastpath - now ON - using pixel alpha"));
869 iUtility->FillSurfaceL(surface, 0, KGreen);
870 err = iUtility->SubmitUpdate(surface, 0, NULL);
871 ASSERT_EQUALS(err,KErrNone);
872 WaitL(iCompositionPause);
874 ASSERT_TRUE(AcquireOnScreenStream());
875 ASSERT_TRUE(CheckOnScreenReferenceImage());
876 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
877 ReleaseOnScreenStream();
879 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
880 wfcDestroySource(iDevice, fpSource);
884 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0003
885 @SYMTestCaseDesc Positive testing - Fastpath scene with a double buffered element
887 @SYMPREQ PREQ417-54885
888 @SYMTestType Unit Test
889 @SYMTestPriority High
890 @SYMTestPurpose Check if a scene is fastpathed using the second buffer
892 All compositions are autonomous:
893 Compose an empty scene
894 A) Create a scene containing an element with 2 buffers
895 Set the element screen size
896 Set destination and source rectangle to screen size
898 B) Send an update to buffer 1 with change of colour
899 Wait for notification
900 @SYMTestExpectedResults
901 The scene should be fastpathed for A and B
902 Screen colour should change after B
904 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0003L()
906 iTestName = _L("FASTPATH_0003");
907 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
908 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
911 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
912 iFastpathablePixelFormat,
913 iStride, iContiguous, iMaxBuffers);
914 ASSERT_FALSE(surface.IsNull());
916 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
917 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
918 ASSERT_EQUALS(err,KErrNone);
919 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
920 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
922 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
923 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
925 #ifdef BREAKPOINT_FASTPATH
928 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
929 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
930 wfcCommit(iDevice, iContext, WFC_TRUE);
931 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
932 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
933 LOG(("OpenWFTest: Fastpath - now ON"));
935 iUtility->FillSurfaceL(surface, 0, KGreen);
936 err = iUtility->SubmitUpdate(surface, 0, NULL);
937 ASSERT_EQUALS(err,KErrNone);
938 WaitL(iCompositionPause);
940 ASSERT_TRUE(AcquireOnScreenStream());
941 ASSERT_TRUE(CheckOnScreenReferenceImage());
942 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
943 ReleaseOnScreenStream();
945 //Fill surface is blue
946 iUtility->FillSurfaceL(surface, 1, KBlue);
947 //Do content update for surface buff1
948 CActiveNotification* buff1disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
949 CleanupStack::PushL(buff1disp);
950 TTimeStamp buff1time;
951 iUtility->NotifyWhenDisplayed(buff1disp->iStatus,buff1time);
953 LOG(("OpenWFTest: Fastpath - staying ON..."));
954 err = iUtility->SubmitUpdate(surface, 1, NULL);
955 ASSERT_EQUALS(err,KErrNone);
956 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,1)); //1 AO should have completed
958 //create ref image/check on screen content
959 ASSERT_TRUE(AcquireOnScreenStream());
960 ASSERT_TRUE(CheckOnScreenReferenceImage());
961 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KBlue,iTolerance));
962 ReleaseOnScreenStream();
964 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
965 wfcDestroySource(iDevice, fpSource);
966 CleanupStack::PopAndDestroy(buff1disp);
970 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0004
971 @SYMTestCaseDesc Positive testing - Fastpath two-element scene
973 @SYMPREQ PREQ417-54885
974 @SYMTestType Unit Test
975 @SYMTestPriority Medium
976 @SYMTestPurpose Check a scene including a full screen opaque element as the top layer can be
979 All compositions are autonomous:
980 Compose an empty scene
981 A) Create a scene containing a screen sized element with WFC_TRANSPARENCY_NONE enabled
983 B) Create a small rectangle behind the first element
986 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0004L()
988 iTestName = _L("FASTPATH_0004");
989 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
990 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
993 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
994 iFastpathablePixelFormat,
995 iStride, iContiguous, iMaxBuffers);
996 ASSERT_FALSE(surface.IsNull());
998 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
999 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
1000 ASSERT_EQUALS(err,KErrNone);
1001 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
1002 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
1003 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1004 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1006 TSurfaceId surfaceB = iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
1007 iFastpathablePixelFormat,
1008 iStride, iContiguous, iMaxBuffers);
1009 ASSERT_FALSE(surfaceB.IsNull());
1010 WFCSource sourceB = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceB), NULL);
1011 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1012 ASSERT_EQUALS(err,KErrNone);
1013 WFCElement elementB = wfcCreateElement(iDevice, iContext, NULL);
1014 wfcSetElementAttribi(iDevice, elementB, WFC_ELEMENT_SOURCE, sourceB);
1015 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
1016 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1018 #ifdef BREAKPOINT_FASTPATH
1021 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
1022 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1023 wfcCommit(iDevice, iContext, WFC_TRUE);
1024 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1025 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1026 LOG(("OpenWFTest: Fastpath - now ON"));
1028 iUtility->FillSurfaceL(surface, 0, KGreen);
1029 err = iUtility->SubmitUpdate(surface, 0, NULL);
1030 ASSERT_EQUALS(err,KErrNone);
1031 WaitL(iCompositionPause);
1033 ASSERT_TRUE(AcquireOnScreenStream());
1034 ASSERT_TRUE(CheckOnScreenReferenceImage());
1035 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
1036 ReleaseOnScreenStream();
1038 LOG(("OpenWFTest: Fastpath - staying ON..."));
1039 #ifdef BREAKPOINT_FASTPATH
1042 wfcInsertElement(iDevice, elementB, WFC_INVALID_HANDLE);
1043 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1044 wfcCommit(iDevice, iContext, WFC_TRUE);
1045 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1046 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1048 iUtility->FillSurfaceL(surfaceB, 0, KBlue);
1049 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1050 ASSERT_EQUALS(err,KErrNone);
1051 WaitL(iCompositionPause);
1053 ASSERT_TRUE(AcquireOnScreenStream());
1054 ASSERT_TRUE(CheckOnScreenReferenceImage());
1055 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
1056 ReleaseOnScreenStream();
1058 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
1059 wfcDestroySource(iDevice, fpSource);
1060 wfcDestroySource(iDevice, sourceB);
1064 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0005
1065 @SYMTestCaseDesc Positive testing - Fastpath two-element scene
1067 @SYMPREQ PREQ417-54885
1068 @SYMTestType Unit Test
1069 @SYMTestPriority Medium
1070 @SYMTestPurpose Check a scene including a full screen element with global alpha as the top layer
1073 All compositions are autonomous:
1074 Compose an empty scene
1075 A) Create a scene containing a screen sized element
1076 Enable WFC_TRANPARENCY_GLOBAL_ALPHA and set WFC_ELEMENT_GLOBAL_ALPHA to be 255 (opaque)
1078 B) Create a smaller element behind the first element
1080 @SYMTestExpectedResults
1081 Both compositions should trigger fastpathing.
1083 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0005L()
1085 iTestName = _L("FASTPATH_0005");
1086 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
1087 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
1090 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1091 iFastpathablePixelFormat,
1092 iStride, iContiguous, iMaxBuffers);
1093 ASSERT_FALSE(surface.IsNull());
1095 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
1096 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
1097 ASSERT_EQUALS(err,KErrNone);
1098 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
1099 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
1100 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1101 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1102 //set element global alpha
1103 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, 1.0f);
1104 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA);
1106 TSurfaceId surfaceB = iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
1107 iFastpathablePixelFormat,
1108 iStride, iContiguous, iMaxBuffers);
1109 ASSERT_FALSE(surfaceB.IsNull());
1110 WFCSource sourceB = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceB), NULL);
1111 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1112 ASSERT_EQUALS(err,KErrNone);
1113 WFCElement elementB = wfcCreateElement(iDevice, iContext, NULL);
1114 wfcSetElementAttribi(iDevice, elementB, WFC_ELEMENT_SOURCE, sourceB);
1115 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
1116 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1118 #ifdef BREAKPOINT_FASTPATH
1121 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
1122 LOG(("OpenWFTest: Expecting FASTPATH after next commit - using element global alpha"));
1123 wfcCommit(iDevice, iContext, WFC_TRUE);
1124 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1125 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1126 LOG(("OpenWFTest: Fastpath - now ON... - using element global alpha"));
1128 iUtility->FillSurfaceL(surface, 0, KGreen);
1129 ASSERT_EQUALS(iUtility->SubmitUpdate(surface, 0, NULL),KErrNone);
1130 WaitL(iCompositionPause);
1132 ASSERT_TRUE(AcquireOnScreenStream());
1133 ASSERT_TRUE(CheckOnScreenReferenceImage());
1134 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
1135 ReleaseOnScreenStream();
1138 #ifdef BREAKPOINT_FASTPATH
1141 wfcInsertElement(iDevice, elementB, WFC_INVALID_HANDLE);
1142 LOG(("OpenWFTest: Expecting FASTPATH after next commit - using element global alpha"));
1143 wfcCommit(iDevice, iContext, WFC_TRUE);
1144 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1145 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1147 iUtility->FillSurfaceL(surfaceB, 0, KBlue);
1148 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1149 ASSERT_EQUALS(err,KErrNone);
1150 WaitL(iCompositionPause);
1152 ASSERT_TRUE(AcquireOnScreenStream());
1153 ASSERT_TRUE(CheckOnScreenReferenceImage());
1154 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
1155 ReleaseOnScreenStream();
1157 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
1158 wfcDestroySource(iDevice, fpSource);
1159 wfcDestroySource(iDevice, sourceB);
1163 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0006
1164 @SYMTestCaseDesc Positive testing - Fastpath two-element scene
1166 @SYMPREQ PREQ417-54885
1167 @SYMTestType Unit Test
1168 @SYMTestPriority Low
1169 @SYMTestPurpose Check a scene including a full screen opaque element behind a transparent element
1172 All compositions are autonomous:
1173 Compose an empty scene
1174 A) Create a scene containing an element of any size
1175 Enable WFC_TRANPARENCY_GLOBAL_ALPHA and set WFC_ELEMENT_GLOBAL_ALPHA to 0 (transparent)
1177 B) Create another screen sized opaque element behind the frist
1179 @SYMTestExpectedResults
1180 The final scene should fastpath for B), not for A)
1181 (The current implementation does not support this fastpath behaviour. This test can be ignored at
1184 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0006L()
1186 iTestName = _L("FASTPATH_0006");
1187 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
1188 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
1191 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
1192 iFastpathablePixelFormat,
1193 iStride, iContiguous, iMaxBuffers);
1194 ASSERT_FALSE(surface.IsNull());
1196 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
1197 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
1198 ASSERT_EQUALS(err,KErrNone);
1199 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
1200 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
1201 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
1202 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1203 //set element global alpha fully transparent
1204 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, 0.0f);
1205 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA);
1207 TSurfaceId surfaceB = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1208 iFastpathablePixelFormat,
1209 iStride, iContiguous, iMaxBuffers);
1210 ASSERT_FALSE(surfaceB.IsNull());
1211 WFCSource sourceB = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceB), NULL);
1212 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1213 ASSERT_EQUALS(err,KErrNone);
1214 WFCElement elementB = wfcCreateElement(iDevice, iContext, NULL);
1215 wfcSetElementAttribi(iDevice, elementB, WFC_ELEMENT_SOURCE, sourceB);
1216 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1217 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1219 #ifdef BREAKPOINT_FASTPATH
1222 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
1223 LOG(("OpenWFTest: Expecting COMPOSITION after next commit -single fully transparent element using global alpha"));
1224 wfcCommit(iDevice, iContext, WFC_TRUE);
1225 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1226 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1227 LOG(("OpenWFTest: Fastpath - now ON - single fully transparent element using global alpha"));
1229 iUtility->FillSurfaceL(surface, 0, KGreen);
1230 err = iUtility->SubmitUpdate(surface, 0, NULL);
1231 ASSERT_EQUALS(err,KErrNone);
1232 WaitL(iCompositionPause);
1234 #ifdef BREAKPOINT_FASTPATH
1237 wfcInsertElement(iDevice, elementB, WFC_INVALID_HANDLE);
1238 LOG(("OpenWFTest: Expecting FASTPATH after next commit -fullscreen opaque element behind fully transparent element"));
1239 wfcCommit(iDevice, iContext, WFC_TRUE);
1240 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1241 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1242 LOG(("OpenWFTest: Fastpath - now ON - fullscreen opaque element behind transparent element"));
1244 iUtility->FillSurfaceL(surfaceB, 0, KBlue);
1245 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1246 ASSERT_EQUALS(err,KErrNone);
1247 WaitL(iCompositionPause);
1249 ASSERT_TRUE(AcquireOnScreenStream());
1250 ASSERT_TRUE(CheckOnScreenReferenceImage());
1251 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KBlue,iTolerance));
1252 ReleaseOnScreenStream();
1254 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
1255 wfcDestroySource(iDevice, fpSource);
1256 wfcDestroySource(iDevice, sourceB);
1260 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0007
1261 @SYMTestCaseDesc Positive testing - Fastpath one-element scene
1263 @SYMPREQ PREQ417-54885
1264 @SYMTestType Unit Test
1265 @SYMTestPriority High
1266 @SYMTestPurpose Check a scene including destination rectangle changes can trigger fastpath on and off
1268 All compositions are autonomous:
1269 Compose an empty scene
1270 Create a scene containing a screen sized element
1272 Set the destination rectangle smaller than screen size
1274 Set the destination rectangle back to screen size
1276 @SYMTestExpectedResults
1277 The scenes with the element of full screen destination rectangle should be fastpathed
1278 The scene with the element of smaller destination rectangle should not be fastpathed
1280 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0007L()
1282 iTestName = _L("FASTPATH_0007");
1283 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
1284 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
1287 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1288 iFastpathablePixelFormat,
1289 iStride, iContiguous, iMaxBuffers);
1290 ASSERT_FALSE(surface.IsNull());
1292 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
1293 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
1294 ASSERT_EQUALS(err,KErrNone);
1295 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
1296 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
1297 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1298 //NOT full screen destination
1299 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1301 #ifdef BREAKPOINT_FASTPATH
1304 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
1305 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
1306 wfcCommit(iDevice, iContext, WFC_TRUE);
1307 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1308 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1309 LOG(("OpenWFTest: Fastpath - still OFF"));
1311 iUtility->FillSurfaceL(surface, 0, KGreen);
1312 err = iUtility->SubmitUpdate(surface, 0, NULL);
1313 ASSERT_EQUALS(err,KErrNone);
1314 WaitL(iCompositionPause);
1316 ASSERT_TRUE(AcquireOnScreenStream());
1317 ASSERT_TRUE(CheckOnScreenReferenceImage());
1318 ASSERT_TRUE(CheckOnScreenStreamRect(iCenterTRect,KGreen,iTolerance));
1319 ReleaseOnScreenStream();
1321 //NOW set full screen
1322 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1324 #ifdef BREAKPOINT_FASTPATH
1327 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1328 wfcCommit(iDevice, iContext, WFC_TRUE);
1329 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1330 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1331 WaitL(iCompositionPause);
1333 ASSERT_TRUE(AcquireOnScreenStream());
1334 ASSERT_TRUE(CheckOnScreenReferenceImage());
1335 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
1336 ReleaseOnScreenStream();
1338 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
1339 wfcDestroySource(iDevice, fpSource);
1342 //NOTIFICATION TESTS
1343 void COpenwfTest::FastpathNotificationsTestL(TBool aAutonomous)
1345 SetupEmptySceneL(aAutonomous);
1347 //Create 3 elements A+C fastpathable, B centered
1348 TSurfaceId surfaceA = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1349 iFastpathablePixelFormat,
1350 iStride, iContiguous, iMaxBuffers);
1351 ASSERT_FALSE(surfaceA.IsNull());
1352 WFCSource sourceA = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceA), NULL);
1353 TInt err = iUtility->SubmitUpdate(surfaceA, 0, NULL);
1354 ASSERT_EQUALS(err,KErrNone);
1355 WFCElement elementA = wfcCreateElement(iDevice, iContext, NULL);
1356 wfcSetElementAttribi(iDevice, elementA, WFC_ELEMENT_SOURCE, sourceA);
1357 wfcSetElementAttribiv(iDevice, elementA, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1358 wfcSetElementAttribiv(iDevice, elementA, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1360 TSurfaceId surfaceB = iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
1361 iFastpathablePixelFormat,
1362 iStride, iContiguous, iMaxBuffers);
1363 ASSERT_FALSE(surfaceB.IsNull());
1364 WFCSource sourceB = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceB), NULL);
1365 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1366 ASSERT_EQUALS(err,KErrNone);
1367 WFCElement elementB = wfcCreateElement(iDevice, iContext, NULL);
1368 wfcSetElementAttribi(iDevice, elementB, WFC_ELEMENT_SOURCE, sourceB);
1369 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
1370 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1372 TSurfaceId surfaceC = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1373 iFastpathablePixelFormat,
1374 iStride, iContiguous, iMaxBuffers);
1375 ASSERT_FALSE(surfaceC.IsNull());
1376 WFCSource sourceC = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceC), NULL);
1377 err = iUtility->SubmitUpdate(surfaceC, 0, NULL);
1378 ASSERT_EQUALS(err,KErrNone);
1379 WFCElement elementC = wfcCreateElement(iDevice, iContext, NULL);
1380 wfcSetElementAttribi(iDevice, elementC, WFC_ELEMENT_SOURCE, sourceC);
1381 wfcSetElementAttribiv(iDevice, elementC, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1382 wfcSetElementAttribiv(iDevice, elementC, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1384 //**********STARTING ACTUAL TEST!**********
1385 //**********SURFACE A FASTPATHABLE**********
1387 wfcInsertElement(iDevice, elementA, WFC_INVALID_HANDLE);
1388 #ifdef BREAKPOINT_FASTPATH
1391 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1392 wfcCommit(iDevice, iContext, WFC_TRUE);
1393 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1394 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1395 LOG(("OpenWFTest: Fastpath - now ON"));
1397 iUtility->FillSurfaceL(surfaceA, 0, KRed);
1398 //Do content update Abuff0 idisp iavail
1399 CActiveNotification* surfAbuff0disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1400 CleanupStack::PushL(surfAbuff0disp);
1401 TTimeStamp surfAbuff0time;
1402 CActiveNotification* surfAbuff0avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1403 CleanupStack::PushL(surfAbuff0avail);
1404 //iUtility->NotifyWhenDisplayed(surfAbuff0disp,surfAbuff0time);
1405 iUtility->NotifyWhenDisplayed(surfAbuff0disp->iStatus,surfAbuff0time);
1406 iUtility->NotifyWhenAvailable(surfAbuff0avail->iStatus);
1407 err = iUtility->SubmitUpdate(surfaceA, 0, NULL);
1408 ASSERT_EQUALS(err,KErrNone);
1412 WaitL(iCompositionPause);
1413 //Check A buff0 iDisp doesnt complete
1414 ASSERT_EQUALS(surfAbuff0disp->iStatus.Int(),KRequestPending);
1415 //Check A buff0 iAvail doesnt complete
1416 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1417 wfcCompose(iDevice, iContext, WFC_TRUE);
1418 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1419 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1421 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,1));
1423 //Check A buff0 iDisp completes
1424 ASSERT_EQUALS(surfAbuff0disp->iStatus.Int(),KErrNone);
1425 //Check A buff0 iAvail doesnt complete
1426 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1428 ASSERT_TRUE(AcquireOnScreenStream());
1429 ASSERT_TRUE(CheckOnScreenReferenceImage());
1430 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KRed,iTolerance));
1431 ReleaseOnScreenStream();
1433 //Set A buffer1 Yellow
1434 iUtility->FillSurfaceL(surfaceA, 1, KYellow);
1436 //Check A buff0 iavail doesnt complete
1437 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1439 ASSERT_TRUE(AcquireOnScreenStream());
1440 ASSERT_TRUE(CheckOnScreenReferenceImage());
1441 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KRed,iTolerance));
1442 ReleaseOnScreenStream();
1444 //Do content update Abuff1 idisp iavail
1445 CActiveNotification* surfAbuff1disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1446 CleanupStack::PushL(surfAbuff1disp);
1447 TTimeStamp surfAbuff1time;
1448 CActiveNotification* surfAbuff1avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1449 CleanupStack::PushL(surfAbuff1avail);
1450 iUtility->NotifyWhenDisplayed(surfAbuff1disp->iStatus,surfAbuff1time);
1451 iUtility->NotifyWhenAvailable(surfAbuff1avail->iStatus);
1452 err = iUtility->SubmitUpdate(surfaceA, 1, NULL);
1453 ASSERT_EQUALS(err,KErrNone);
1457 WaitL(iCompositionPause);
1458 //Check A buff1 iDisp doesnt complete
1459 ASSERT_EQUALS(surfAbuff1disp->iStatus.Int(),KRequestPending);
1460 //Check A buff1 iAvail doesnt complete
1461 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1462 //Check A buff0 iAvail doesnt complete
1463 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1464 wfcCompose(iDevice, iContext, WFC_TRUE);
1465 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1466 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1468 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,2));
1470 //Check A buff1 idisp completes
1471 ASSERT_EQUALS(surfAbuff1disp->iStatus.Int(),KErrNone);
1472 //Check A buff0 iAvail completes
1473 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KErrNone);
1474 //Check A buff1 iAvail doesnt complete
1475 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1477 ASSERT_TRUE(AcquireOnScreenStream());
1478 ASSERT_TRUE(CheckOnScreenReferenceImage());
1479 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KYellow,iTolerance));
1480 ReleaseOnScreenStream();
1482 //**********SURFACE B NOT VISIBLE**********
1483 //Add surfaceB to scene behind surfaceA
1484 wfcInsertElement(iDevice, elementB, WFC_INVALID_HANDLE);
1485 #ifdef BREAKPOINT_FASTPATH
1488 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1489 wfcCommit(iDevice, iContext, WFC_TRUE);
1490 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1491 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1492 LOG(("OpenWFTest: Fastpath - still ON"));
1493 //Set B buffer0 green
1494 iUtility->FillSurfaceL(surfaceB, 0, KGreen);
1495 //Do content update idisp iavail
1496 CActiveNotification* surfBbuff0disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1497 CleanupStack::PushL(surfBbuff0disp);
1498 TTimeStamp surfBbuff0time;
1499 CActiveNotification* surfBbuff0avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1500 CleanupStack::PushL(surfBbuff0avail);
1501 iUtility->NotifyWhenDisplayed(surfBbuff0disp->iStatus,surfBbuff0time);
1502 iUtility->NotifyWhenAvailable(surfBbuff0avail->iStatus);
1503 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1504 ASSERT_EQUALS(err,KErrNone);
1508 WaitL(iCompositionPause);
1509 //Check B buff0 iAvail doesnt complete
1510 ASSERT_EQUALS(surfBbuff0avail->iStatus.Int(),KRequestPending);
1511 //Check B buff0 iDisp doesnt complete
1512 ASSERT_EQUALS(surfBbuff0disp->iStatus.Int(),KRequestPending);
1513 //Check A buff1 iAvail doesnt complete
1514 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1515 wfcCompose(iDevice, iContext, WFC_TRUE);
1516 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1517 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1519 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,1));
1521 //Check B buff0 idisp completes - could be no error or not visible
1522 ASSERT_TRUE((surfBbuff0disp->iStatus.Int()==KErrNotVisible)||(surfBbuff0disp->iStatus.Int()==KErrNone));
1523 //Check B buff0 iavail doesnt complete
1524 ASSERT_EQUALS(surfBbuff0avail->iStatus.Int(),KRequestPending);
1525 //Check A buff1 iavail doesnt complete
1526 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1528 //Set B buffer1 blue
1529 iUtility->FillSurfaceL(surfaceB, 1, KBlue);
1530 //Do content update idisp iavail
1531 CActiveNotification* surfBbuff1disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1532 CleanupStack::PushL(surfBbuff1disp);
1533 TTimeStamp surfBbuff1time;
1534 CActiveNotification* surfBbuff1avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1535 CleanupStack::PushL(surfBbuff1avail);
1536 iUtility->NotifyWhenDisplayed(surfBbuff1disp->iStatus,surfBbuff1time);
1537 iUtility->NotifyWhenAvailable(surfBbuff1avail->iStatus);
1538 err = iUtility->SubmitUpdate(surfaceB, 1, NULL);
1539 ASSERT_EQUALS(err,KErrNone);
1543 WaitL(iCompositionPause);
1544 //Check B buff1 iAvail doesnt complete
1545 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1546 //Check B buff1 iDisp doesnt complete
1547 ASSERT_EQUALS(surfBbuff1disp->iStatus.Int(),KRequestPending);
1548 //Check B buff0 iAvail doesnt complete
1549 ASSERT_EQUALS(surfBbuff0avail->iStatus.Int(),KRequestPending);
1550 //Check A buff1 iAvail doesnt complete
1551 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1552 wfcCompose(iDevice, iContext, WFC_TRUE);
1553 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1554 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1556 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,2));
1558 //Check B buff1 idisp completes - could be no error or not visible
1559 ASSERT_TRUE((surfBbuff1disp->iStatus.Int()==KErrNotVisible)||(surfBbuff1disp->iStatus.Int()==KErrNone));
1560 //Check B buff1 iavail doesnt complete
1561 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1562 //Check B buff0 iavail completes - could be no error or not visible
1563 ASSERT_TRUE((surfBbuff0avail->iStatus.Int()==KErrNotVisible)||(surfBbuff0avail->iStatus.Int()==KErrNone));
1564 //Check A buff1 iavail doesnt complete
1565 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1567 ASSERT_TRUE(AcquireOnScreenStream());
1568 ASSERT_TRUE(CheckOnScreenReferenceImage());
1569 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KYellow,iTolerance));
1570 ReleaseOnScreenStream();
1572 //**********SURFACE C ALSO FASTPATHABLE**********
1573 //Add C to scene in front of surfaceA
1574 wfcInsertElement(iDevice, elementC, elementA);
1575 #ifdef BREAKPOINT_FASTPATH
1578 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1579 wfcCommit(iDevice, iContext, WFC_TRUE);
1580 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1581 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1582 LOG(("OpenWFTest: Fastpath - still ON"));
1584 iUtility->FillSurfaceL(surfaceC, 0, KBrown);
1585 //Do content update Cbuff0 idisp iavail
1586 CActiveNotification* surfCbuff0disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1587 CleanupStack::PushL(surfCbuff0disp);
1588 TTimeStamp surfCbuff0time;
1589 CActiveNotification* surfCbuff0avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1590 CleanupStack::PushL(surfCbuff0avail);
1591 iUtility->NotifyWhenDisplayed(surfCbuff0disp->iStatus,surfCbuff0time);
1592 iUtility->NotifyWhenAvailable(surfCbuff0avail->iStatus);
1593 err = iUtility->SubmitUpdate(surfaceC, 0, NULL);
1594 ASSERT_EQUALS(err,KErrNone);
1598 WaitL(iCompositionPause);
1599 //Check C buff0 iAvail doesnt complete
1600 ASSERT_EQUALS(surfCbuff0avail->iStatus.Int(),KRequestPending);
1601 //Check C buff0 iDisp doesnt complete
1602 ASSERT_EQUALS(surfCbuff0disp->iStatus.Int(),KRequestPending);
1603 //Check B buff1 iAvail doesnt complete
1604 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1605 //Check A buff1 iAvail doesnt complete
1606 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1607 wfcCompose(iDevice, iContext, WFC_TRUE);
1608 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1609 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1611 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,1));
1613 //Check C buff0 idisp completes
1614 ASSERT_EQUALS(surfCbuff0disp->iStatus.Int(),KErrNone);
1615 //Check C buff0 iavail does not complete
1616 ASSERT_EQUALS(surfCbuff0avail->iStatus.Int(),KRequestPending);
1617 //Check B buff1 iavail doesnt complete
1618 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1619 //Check A buff1 iavail doesnt complete
1620 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1622 ASSERT_TRUE(AcquireOnScreenStream());
1623 ASSERT_TRUE(CheckOnScreenReferenceImage());
1624 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KBrown,iTolerance));
1625 ReleaseOnScreenStream();
1627 //Set C buffer1 grey
1628 iUtility->FillSurfaceL(surfaceC, 1, KGray);
1629 //Do content update Cbuff1 idisp iavail
1630 CActiveNotification* surfCbuff1disp = CActiveNotification::NewL(iUtility->Session(),ETrue);
1631 CleanupStack::PushL(surfCbuff1disp);
1632 TTimeStamp surfCbuff1time;
1633 CActiveNotification* surfCbuff1avail = CActiveNotification::NewL(iUtility->Session(),ETrue);
1634 CleanupStack::PushL(surfCbuff1avail);
1635 iUtility->NotifyWhenDisplayed(surfCbuff1disp->iStatus,surfCbuff1time);
1636 iUtility->NotifyWhenAvailable(surfCbuff1avail->iStatus);
1637 err = iUtility->SubmitUpdate(surfaceC, 1, NULL);
1638 ASSERT_EQUALS(err,KErrNone);
1642 WaitL(iCompositionPause);
1643 //Check C buff1 iAvail doesnt complete
1644 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1645 //Check C buff1 iDisp doesnt complete
1646 ASSERT_EQUALS(surfCbuff1disp->iStatus.Int(),KRequestPending);
1647 //Check C buff0 iAvail doesnt complete
1648 ASSERT_EQUALS(surfCbuff0avail->iStatus.Int(),KRequestPending);
1649 //Check B buff1 iAvail doesnt complete
1650 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1651 //Check A buff1 iAvail doesnt complete
1652 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1653 wfcCompose(iDevice, iContext, WFC_TRUE);
1654 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1655 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1657 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,2));
1659 //Check C buff1 idisp completes
1660 ASSERT_EQUALS(surfCbuff1disp->iStatus.Int(),KErrNone);
1661 //Check C buff1 iavail does not complete
1662 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1663 //Check C buff0 iavail completes
1664 ASSERT_EQUALS(surfCbuff0avail->iStatus.Int(),KErrNone);
1665 //Check B buff1 iavail doesnt complete
1666 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1667 //Check A buff1 iavail doesnt complete
1668 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1670 ASSERT_TRUE(AcquireOnScreenStream());
1671 ASSERT_TRUE(CheckOnScreenReferenceImage());
1672 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGray,iTolerance));
1673 ReleaseOnScreenStream();
1675 //**********SURFACE A BACK TO FRONT**********
1676 //Move A to the front
1677 wfcInsertElement(iDevice, elementA, elementC);
1678 #ifdef BREAKPOINT_FASTPATH
1681 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1682 wfcCommit(iDevice, iContext, WFC_TRUE);
1683 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1684 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1685 LOG(("OpenWFTest: Fastpath - still ON"));
1686 //Set A buffer0 magenta
1687 iUtility->FillSurfaceL(surfaceA, 0, KMagenta);
1688 //Do content update Abuff0 idisp iavail
1689 surfAbuff0disp->Activate();
1690 surfAbuff0avail->Activate();
1691 iUtility->NotifyWhenDisplayed(surfAbuff0disp->iStatus,surfAbuff0time);
1692 iUtility->NotifyWhenAvailable(surfAbuff0avail->iStatus);
1693 err = iUtility->SubmitUpdate(surfaceA, 0, NULL);
1694 ASSERT_EQUALS(err,KErrNone);
1698 WaitL(iCompositionPause);
1699 //Check A buff0 iAvail doesnt complete
1700 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1701 //Check A buff0 iDisp doesnt complete
1702 ASSERT_EQUALS(surfAbuff0disp->iStatus.Int(),KRequestPending);
1703 //Check C buff1 iAvail doesnt complete
1704 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1705 //Check B buff1 iAvail doesnt complete
1706 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1707 //Check A buff1 iAvail doesnt complete
1708 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KRequestPending);
1709 wfcCompose(iDevice, iContext, WFC_TRUE);
1710 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1711 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1713 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,2));
1715 //Check A buff0 idisp completes
1716 ASSERT_EQUALS(surfAbuff0disp->iStatus.Int(),KErrNone);
1717 //Check A buff0 iavail does not complete
1718 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1719 //Check A buff1 iavail does complete
1720 ASSERT_EQUALS(surfAbuff1avail->iStatus.Int(),KErrNone);
1721 //Check C buff1 iavail does not complete
1722 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1723 //Check B buff1 iavail doesnt complete
1724 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1726 ASSERT_TRUE(AcquireOnScreenStream());
1727 ASSERT_TRUE(CheckOnScreenReferenceImage());
1728 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KMagenta,iTolerance));
1729 ReleaseOnScreenStream();
1731 //**********SURFACE B TO FRONT - STOPS FASTPATH HAPPENING**********
1732 //Move B to the front
1733 wfcInsertElement(iDevice, elementB, elementA);
1734 #ifdef BREAKPOINT_FASTPATH
1737 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
1738 wfcCommit(iDevice, iContext, WFC_TRUE);
1739 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1740 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1741 LOG(("OpenWFTest: Fastpath - now OFF..."));
1742 //Set B buffer0 dark red
1743 iUtility->FillSurfaceL(surfaceB, 0, KDarkRed);
1744 //Do content update Abuff0 idisp iavail
1745 surfBbuff0disp->Activate();
1746 surfBbuff0avail->Activate();
1747 iUtility->NotifyWhenDisplayed(surfBbuff0disp->iStatus,surfBbuff0time);
1748 iUtility->NotifyWhenAvailable(surfBbuff0avail->iStatus);
1749 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1750 ASSERT_EQUALS(err,KErrNone);
1754 WaitL(iCompositionPause);
1755 //Check B buff0 iAvail doesnt complete
1756 ASSERT_EQUALS(surfBbuff0avail->iStatus.Int(),KRequestPending);
1757 //Check B buff0 iDisp doesnt complete
1758 ASSERT_EQUALS(surfBbuff0disp->iStatus.Int(),KRequestPending);
1759 //Check A buff0 iAvail doesnt complete
1760 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1761 //Check C buff1 iAvail doesnt complete
1762 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1763 //Check B buff1 iAvail doesnt complete
1764 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KRequestPending);
1765 wfcCompose(iDevice, iContext, WFC_TRUE);
1766 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1767 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1769 ASSERT_TRUE(WaitForNotifications(KMaxNotificationDelay,2));
1771 //Check B buff0 iAvail doesnt complete
1772 ASSERT_EQUALS(surfBbuff0avail->iStatus.Int(),KRequestPending);
1773 //Check B buff0 iDisp completes
1774 ASSERT_EQUALS(surfBbuff0disp->iStatus.Int(),KErrNone);
1775 //Check A buff0 iAvail doesnt complete
1776 ASSERT_EQUALS(surfAbuff0avail->iStatus.Int(),KRequestPending);
1777 //Check C buff1 iAvail doesnt complete
1778 ASSERT_EQUALS(surfCbuff1avail->iStatus.Int(),KRequestPending);
1779 //Check B buff1 iAvail completes
1780 ASSERT_EQUALS(surfBbuff1avail->iStatus.Int(),KErrNone);
1782 ASSERT_TRUE(AcquireOnScreenStream());
1783 ASSERT_TRUE(CheckOnScreenReferenceImage());
1784 //Check dark red center of screen
1785 ASSERT_TRUE(CheckOnScreenStreamRect(iCenterTRect,KDarkRed,iTolerance));
1786 //Check magenta around the borders
1787 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(0,0,iCenterTRect.iTl.iX,iCenterTRect.iTl.iY),KMagenta,iTolerance));
1788 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(iCenterTRect.iBr.iX+1,iCenterTRect.iBr.iY+1,
1789 iFastpathableWidth,iFastpathableHeight),KMagenta,iTolerance));
1790 ReleaseOnScreenStream();
1792 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
1794 wfcDestroySource(iDevice, sourceA);
1795 wfcDestroySource(iDevice, sourceB);
1796 wfcDestroySource(iDevice, sourceC);
1798 CleanupStack::PopAndDestroy(12,surfAbuff0disp);
1801 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0010
1802 @SYMTestCaseDesc Positive testing - Fastpath with notification checking for autonomous composition
1804 @SYMPREQ PREQ417-54885
1805 @SYMTestType Integration Test
1806 @SYMTestPriority High
1807 @SYMTestPurpose Check fastpath does not cause any problem to notifications
1809 Autonomous composition
1810 All elements created are double buffered and opaque:
1811 Compose an empty scene
1813 A) Create a scene containing a screen sized element A
1814 Fill buffer 0 of element A with red colour
1816 Do content update of buffer 0 for available (iAvailable) and display time (iDisplayed)
1817 Compose the scene, iDisplayed for buffer 0 should complete
1819 Fill buffer 1 of element A with yellow colour
1820 Do content update of buffer 1
1821 Compose the scene, iDisplayed for buffer 1 should complete
1822 Wait for iAvailable of buffer 0 to complete
1823 (iAvailable of buffer 1 will not complete until further content update)
1825 B) Add a new element B of smaller non fastpathable size behind element A
1826 Fill buffer 0 of element B with green colour
1828 Do content update of buffer 0 of element B
1829 Compose the scene, iDisplayed for buffer 0 of element B should not complete
1830 iAvailable for buffer 1 of element A should not complete
1832 Fill buffer 1 of element B with blue colour
1833 Do content update of buffer 1 of element B
1834 Wait for iDisplay to complete (possibly with KErrNotVisible)
1835 Wait for iAvailable for buffer 0 of element B to complete (possibly with KErrNotVisible)
1837 C) Add a new screen size element C in front of A and B
1838 Fill buffer 0 of element C to be brown
1839 Do content update of buffer 0 of element C
1840 Compose the scene, iDisplayed of buffer 0 of element C should complete
1841 iAvailable of buffer 1 of element B should not complete
1843 Fill buffer 1 of element C with grey colour
1844 Do content update of buffer 1 of element C
1845 Compose the scene, iDisplayed of buffer 1 of element C should complete
1846 Wait for iAvailable of buffer 0 of element C to complete
1848 D) Move element A to the front
1849 Fill buffer 0 of element A with magenta colour
1850 Do content update of buffer 0 of element A
1851 Compose the scene, iDisplayed for buffer 0 of element A should complete
1852 Wait for iAvailable of buffer 1 of element A to complete
1853 iAvailable of buffer 1 of element C should not complete
1855 E) Move element B to the front *NOW NOT FASTPATHING*
1856 Fill buffer 0 of element B with dark red colour
1857 Do content update of buffer 0 of element B
1858 Compose the scene, iDisplayed for buffer 0 of element B should complete
1859 Wait for iAvailable of buffer 1 of element B to complete
1860 iAvailable of buffer 1 of element C should not complete
1861 iAvailable of buffer 0 of element A should not complete
1863 @SYMTestExpectedResults
1864 All composition should trigger fastpath
1865 Request status checks iAvailable and iDisplayed should be set to KErrNone every time.
1866 Screen colour should change in the sequence of red, yellow, brown, grey, magenta
1868 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0010L()
1870 iTestName = _L("FASTPATH_0010");
1871 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
1872 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
1873 FastpathNotificationsTestL(ETrue);
1877 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0011
1878 @SYMTestCaseDesc Positive testing - Fastpath with notification checking for non-autonomous composition
1880 @SYMPREQ PREQ417-54885
1881 @SYMTestType Integration Test
1882 @SYMTestPriority High
1883 @SYMTestPurpose Check fastpath does not cause any problem to notifications
1885 A repeat of GRAPHICS-OPENWFC-FASTPATH-0010 but with non autonomous composition
1887 Where possible TRequestStatuses are additionally checked after submit updates and before
1888 explicit wfcCompose calls are made.
1890 @SYMTestExpectedResults
1891 Just commit should not trigger any changes to the scene or notifications to complete
1892 Just content updates should not trigger any changes to the scene or notifications to complete
1893 Only after Commit, Content update and Force compose should things happen.
1894 Request status checks iAvailable and iDisplayed should be completed.
1895 Screen colour should change in the sequence of red, yellow, green, blue, brown and grey
1897 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0011L()
1899 iTestName = _L("FASTPATH_0011");
1900 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
1901 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
1902 FastpathNotificationsTestL(EFalse);
1905 //NOTIFICATION TESTS
1906 void COpenwfTest::FastpathDispXNotificationsTestL(TBool aAutonomous)
1908 SetupEmptySceneL(aAutonomous);
1910 { //if we have manual pauses the test will complete early
1911 iAllowManualPause = EFalse;
1914 //Create 2 fastpathable elements
1915 TSurfaceId surfaceA = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
1916 iFastpathablePixelFormat,
1917 iStride, iContiguous, iMaxBuffers);
1919 ASSERT_FALSE(surfaceA.IsNull());
1920 WFCSource sourceA = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceA), NULL);
1921 TInt err = iUtility->SubmitUpdate(surfaceA, 0, NULL);
1922 ASSERT_EQUALS(err,KErrNone);
1923 WFCElement elementA = wfcCreateElement(iDevice, iContext, NULL);
1924 wfcSetElementAttribi(iDevice, elementA, WFC_ELEMENT_SOURCE, sourceA);
1925 wfcSetElementAttribiv(iDevice, elementA, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
1926 wfcSetElementAttribiv(iDevice, elementA, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
1928 TSurfaceId surfaceB = iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
1929 iFastpathablePixelFormat,
1930 iStride, iContiguous, iMaxBuffers);
1931 ASSERT_FALSE(surfaceB.IsNull());
1932 WFCSource sourceB = wfcCreateSourceFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceB), NULL);
1933 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1934 ASSERT_EQUALS(err,KErrNone);
1935 WFCElement elementB = wfcCreateElement(iDevice, iContext, NULL);
1936 wfcSetElementAttribi(iDevice, elementB, WFC_ELEMENT_SOURCE, sourceB);
1937 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
1938 wfcSetElementAttribiv(iDevice, elementB, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iCenterRect);
1940 //**********STARTING ACTUAL TEST!**********
1942 wfcInsertElement(iDevice, elementA, WFC_INVALID_HANDLE);
1943 #ifdef BREAKPOINT_FASTPATH
1946 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
1947 wfcCommit(iDevice, iContext, WFC_TRUE);
1948 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1949 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1950 LOG(("OpenWFTest: Fastpath - now ON"));
1952 iUtility->FillSurfaceL(surfaceA, 0, KRed);
1953 err = iUtility->SubmitUpdate(surfaceA, 0, NULL);
1954 ASSERT_EQUALS(err,KErrNone);
1957 wfcCompose(iDevice, iContext, WFC_TRUE);
1958 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1959 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1961 WaitL(iCompositionPause);
1963 ASSERT_TRUE(AcquireOnScreenStream());
1964 ASSERT_TRUE(CheckOnScreenReferenceImage());
1965 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KRed,iTolerance));
1966 ReleaseOnScreenStream();
1968 //Add surfaceB to scene infront of surfaceA
1969 wfcInsertElement(iDevice, elementB, elementA);
1970 #ifdef BREAKPOINT_FASTPATH
1973 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
1974 wfcCommit(iDevice, iContext, WFC_TRUE);
1975 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1976 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1977 LOG(("OpenWFTest: Fastpath - now OFF"));
1978 //Set B buffer0 green
1979 iUtility->FillSurfaceL(surfaceB, 0, KBlue);
1980 err = iUtility->SubmitUpdate(surfaceB, 0, NULL);
1981 ASSERT_EQUALS(err,KErrNone);
1984 wfcCompose(iDevice, iContext, WFC_TRUE);
1985 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
1986 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
1988 WaitL(iCompositionPause);
1990 ASSERT_TRUE(AcquireOnScreenStream());
1991 ASSERT_TRUE(CheckOnScreenReferenceImage());
1992 //Check blue center of screen
1993 ASSERT_TRUE(CheckOnScreenStreamRect(iCenterTRect,KBlue,iTolerance));
1994 //Check red around the borders
1995 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(0,0,iCenterTRect.iTl.iX,iCenterTRect.iTl.iY),KRed,iTolerance));
1996 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(iCenterTRect.iBr.iX+1,iCenterTRect.iBr.iY+1,
1997 iFastpathableWidth,iFastpathableHeight),KRed,iTolerance));
1998 ReleaseOnScreenStream();
2000 //Set A buffer1 yellow
2001 iUtility->FillSurfaceL(surfaceA, 1, KYellow);
2002 //Set B buffer1 KGreen
2003 iUtility->FillSurfaceL(surfaceB, 1, KGreen);
2005 //Do content updated surfaceA dispXtimes 10
2006 CActiveNotification* surfAbuff1dispX = CActiveNotification::NewL(iUtility->Session(),ETrue);
2007 CleanupStack::PushL(surfAbuff1dispX);
2008 iUtility->NotifyWhenDisplayedXTimes(10,surfAbuff1dispX->iStatus);
2009 err = iUtility->SubmitUpdate(surfaceA, 1, NULL);
2010 //Do content updated surfaceB dispXtimes 5
2011 CActiveNotification* surfBbuff1dispX = CActiveNotification::NewL(iUtility->Session(),ETrue);
2012 CleanupStack::PushL(surfBbuff1dispX);
2013 iUtility->NotifyWhenDisplayedXTimes(5,surfBbuff1dispX->iStatus);
2014 err = iUtility->SubmitUpdate(surfaceB, 1, NULL);
2018 for(TInt i=0;i<4;i++)
2020 wfcCompose(iDevice, iContext, WFC_TRUE);
2021 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2022 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2023 WaitL(iCompositionPause);
2024 //Check A has not completed yet
2025 ASSERT_EQUALS(surfAbuff1dispX->iStatus.Int(),KRequestPending);
2026 //Check B has not completed yet
2027 ASSERT_EQUALS(surfBbuff1dispX->iStatus.Int(),KRequestPending);
2029 wfcCompose(iDevice, iContext, WFC_TRUE);
2030 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2031 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2033 //surfBbuff1dispX should complete, and its RunL will stop the scheduler
2034 CActiveScheduler::Start();
2035 //Check B has completed
2036 ASSERT_EQUALS(surfBbuff1dispX->iStatus.Int(),KErrNone);
2037 //Check A has not completed yet
2038 ASSERT_EQUALS(surfAbuff1dispX->iStatus.Int(),KRequestPending);
2040 ASSERT_TRUE(AcquireOnScreenStream());
2041 ASSERT_TRUE(CheckOnScreenReferenceImage());
2042 //Check green center of screen
2043 ASSERT_TRUE(CheckOnScreenStreamRect(iCenterTRect,KGreen,iTolerance));
2044 //Check yellow around the borders
2045 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(0,0,iCenterTRect.iTl.iX,iCenterTRect.iTl.iY),KYellow,iTolerance));
2046 ASSERT_TRUE(CheckOnScreenStreamRect(TRect(iCenterTRect.iBr.iX+1,iCenterTRect.iBr.iY+1,
2047 iFastpathableWidth,iFastpathableHeight),KYellow,iTolerance));
2048 ReleaseOnScreenStream();
2050 //check it hasn't completed unexpectedly early while using on screen stream
2051 ASSERT_EQUALS(surfAbuff1dispX->iStatus.Int(),KRequestPending);
2053 //Remove surfaceB from the scene
2054 wfcRemoveElement(iDevice, elementB);
2055 #ifdef BREAKPOINT_FASTPATH
2058 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
2059 wfcCommit(iDevice, iContext, WFC_TRUE);
2062 for(TInt i=0;i<4;i++)
2064 wfcCompose(iDevice, iContext, WFC_TRUE);
2065 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2066 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2067 LOG(("OpenWFTest: Fastpath - now ON"));
2068 WaitL(iCompositionPause);
2069 //Check A has not completed yet
2070 ASSERT_EQUALS(surfAbuff1dispX->iStatus.Int(),KRequestPending);
2072 wfcCompose(iDevice, iContext, WFC_TRUE);
2074 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2075 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2077 //surfAbuff1dispX should complete, and its RunL will stop the scheduler
2078 CActiveScheduler::Start();
2079 ASSERT_EQUALS(surfAbuff1dispX->iStatus.Int(),KErrNone);
2081 ASSERT_TRUE(AcquireOnScreenStream());
2082 ASSERT_TRUE(CheckOnScreenReferenceImage());
2083 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KYellow,iTolerance));
2084 ReleaseOnScreenStream();
2086 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2088 wfcDestroySource(iDevice, sourceA);
2089 wfcDestroySource(iDevice, sourceB);
2091 CleanupStack::PopAndDestroy(2,surfAbuff1dispX);
2095 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0012
2096 @SYMTestCaseDesc Positive testing - Fastpath with notification checking DisplayXTime
2098 @SYMPREQ PREQ417-54885
2099 @SYMTestType Integration Test
2100 @SYMTestPriority High
2101 @SYMTestPurpose Check fastpath does not cause any problem to notifications
2103 All compositions are autonomous:
2104 Compose an empty scene
2105 A) Create a scene containing a screen sized opaque element A
2107 Make a content update for available (iAvailable) and display time (aDisplayed)
2108 Wait for the request status objects to complete
2110 B) Add a small element B in front of A
2112 Content update for both A and B, set display 10 times to A, set display 5 times to B
2113 Wait for the 5 times
2118 Wait for the 10 times
2119 @SYMTestExpectedResults
2120 Composition should fastpath in sections A and C
2121 Elements A's 10 times should not complete before element B's 5 times
2123 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0012L()
2125 iTestName = _L("FASTPATH_0012");
2126 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2127 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2128 FastpathDispXNotificationsTestL(ETrue);
2132 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0013
2133 @SYMTestCaseDesc Positive testing - Fastpath with notification checking DisplayXTime
2135 @SYMPREQ PREQ417-54885
2136 @SYMTestType Integration Test
2137 @SYMTestPriority High
2138 @SYMTestPurpose Check fastpath does not cause any problem to notifications
2140 Repeats GRAPHICS-OPENWFC-FASTPATH-0013 in non autonomous mode.
2141 This allows gives the added benefit of accurate counting of wfcCompose calls, checking the displayXtimes
2142 notifications only complete after the correct number of composes.
2143 @SYMTestExpectedResults
2144 Composition should fastpath in sections A and C
2145 Both should complete after their expect amount of compose calls with no errors
2147 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0013L()
2149 iTestName = _L("FASTPATH_0013");
2150 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2151 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2152 FastpathDispXNotificationsTestL(EFalse);
2159 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0020
2160 @SYMTestCaseDesc Negative testing - Fastpath one-element scene
2162 @SYMPREQ PREQ417-54885
2163 @SYMTestType Unit Test
2164 @SYMTestPriority High
2165 @SYMTestPurpose Check a scene including a full screen element with source alpha cannot be fastpathed
2167 All compositions are autonomous:
2168 Create a scene containing a screen sized element
2169 Enable WFC_TRANSPARENCY_SOURCE
2170 Set the value of WFC_ELEMENT_SOURCE between 0 and 255 (non-inclusive).
2172 @SYMTestExpectedResults
2173 The scene cannot be fastpathed.
2175 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0020L()
2177 iTestName = _L("FASTPATH_0020");
2178 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2179 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2182 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2183 EUidPixelFormatARGB_8888,
2184 iStride, iContiguous, iMaxBuffers);
2185 ASSERT_FALSE(surface.IsNull());
2187 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2188 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2189 ASSERT_EQUALS(err,KErrNone);
2190 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2191 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2193 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2194 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2195 //set per pixel alpha
2196 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_SOURCE);
2198 #ifdef BREAKPOINT_FASTPATH
2201 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2202 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using source alpha"));
2203 wfcCommit(iDevice, iContext, WFC_TRUE);
2204 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2205 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2207 for (TInt i=0;i<=256;i+=64)
2210 iUtility->FillSurfaceL(surface, 0, TRgb(0,255,0,i));
2211 err = iUtility->SubmitUpdate(surface, 0, NULL);
2212 ASSERT_EQUALS(err,KErrNone);
2213 WaitL(iCompositionPause);
2215 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2216 wfcDestroySource(iDevice, fpSource);
2220 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0021
2221 @SYMTestCaseDesc Negative testing - Fastpath one-element scene
2223 @SYMPREQ PREQ417-54885
2224 @SYMTestType Unit Test
2225 @SYMTestPriority High
2226 @SYMTestPurpose Check a scene including a full screen element with global alpha cannot be fastpathed
2228 All compositions are autonomous:
2229 Create a scene containing a screen sized element
2230 Enable WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA
2231 Set the value of WFC_ELEMENT_GLOBAL_ALPHA between 0 and 255 (non-inclusive)
2233 @SYMTestExpectedResults
2234 The scene cannot be fastpathed.
2236 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0021L()
2238 iTestName = _L("FASTPATH_0021");
2239 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2240 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2243 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2244 EUidPixelFormatXRGB_8888,
2245 iStride, iContiguous, iMaxBuffers);
2246 ASSERT_FALSE(surface.IsNull());
2248 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2249 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2250 ASSERT_EQUALS(err,KErrNone);
2251 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2252 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2254 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2255 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2256 //set element global alpha
2257 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA);
2258 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, 0.0f);
2260 #ifdef BREAKPOINT_FASTPATH
2263 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2264 iUtility->FillSurfaceL(surface, 0, KGreen);
2265 err = iUtility->SubmitUpdate(surface, 0, NULL);
2266 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using element global alpha not fully opaque"));
2267 wfcCommit(iDevice, iContext, WFC_TRUE);
2268 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2269 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2271 for (TInt i=0;i<=256;i+=64)
2274 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, (TReal32)i/255);
2277 #ifdef BREAKPOINT_FASTPATH
2283 LOG(("OpenWFTest: Expecting FASTPATH after next commit - using element global alpha fully opaque"));
2287 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using element global alpha not fully opaque"));
2289 wfcCommit(iDevice, iContext, WFC_TRUE);
2290 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2291 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2292 WaitL(iCompositionPause);
2294 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2295 wfcDestroySource(iDevice, fpSource);
2299 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0022
2300 @SYMTestCaseDesc Negative testing - Fastpath one-element scene
2302 @SYMPREQ PREQ417-54885
2303 @SYMTestType Unit Test
2304 @SYMTestPriority High
2305 @SYMTestPurpose Check a scene with RGB 565 format cannot be fastpathed
2307 Create a scene containing a screen sized element with an unsupported source format, such as 565
2309 @SYMTestExpectedResults
2310 The scene cannot be fastpathed.
2312 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0022L()
2314 iTestName = _L("FASTPATH_0022");
2315 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2316 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2319 //NON fastpathable pixel format
2320 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2321 iNonFastpathablePixelFormat,
2322 iStride, iContiguous, iMaxBuffers);
2323 ASSERT_FALSE(surface.IsNull());
2325 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2326 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2327 ASSERT_EQUALS(err,KErrNone);
2328 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2329 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2330 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2331 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2332 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2334 #ifdef BREAKPOINT_FASTPATH
2337 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using non fastpathable pixel format"));
2338 wfcCommit(iDevice, iContext, WFC_TRUE);
2339 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2340 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2342 iUtility->FillSurfaceL(surface, 0, KGreen);
2343 err = iUtility->SubmitUpdate(surface, 0, NULL);
2344 ASSERT_EQUALS(err,KErrNone);
2345 WaitL(iCompositionPause);
2347 ASSERT_TRUE(AcquireOnScreenStream());
2348 ASSERT_TRUE(CheckOnScreenReferenceImage());
2349 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
2350 ReleaseOnScreenStream();
2352 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2353 wfcDestroySource(iDevice, fpSource);
2357 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0023
2358 @SYMTestCaseDesc Negative testing - Fastpath one-element scene
2360 @SYMPREQ PREQ417-54885
2361 @SYMTestType Unit Test
2362 @SYMTestPriority High
2363 @SYMTestPurpose Check a scene with mask settings cannot be fastpathed
2365 All compositions are autonomous:
2366 Create a scene containing a screen sized element A
2367 Enable WFC_TRANSPARENCY_MASK
2368 Set a value to WFC_ELEMENT_MASK
2369 Create a mask element, set the size to be the same as element A's desitnation rectangle
2371 @SYMTestExpectedResults
2372 The scene cannot be fastpathed.
2374 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0023L()
2376 iTestName = _L("FASTPATH_0023");
2377 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2378 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2381 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2382 iFastpathablePixelFormat,
2383 iStride, iContiguous, iMaxBuffers);
2384 ASSERT_FALSE(surface.IsNull());
2386 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2387 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2388 ASSERT_EQUALS(err,KErrNone);
2389 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2390 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2391 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2392 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2394 TSurfaceId surfaceMask = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2395 iFastpathablePixelFormat,
2396 iStride, iContiguous, iMaxBuffers);
2397 ASSERT_FALSE(surfaceMask.IsNull());
2398 WFCMask mask = wfcCreateMaskFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceMask), NULL);
2399 err = iUtility->SubmitUpdate(surfaceMask, 0, NULL);
2400 ASSERT_EQUALS(err,KErrNone);
2402 //set the mask to fpElement
2403 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES, WFC_TRANSPARENCY_MASK);
2404 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_MASK, mask);
2405 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2407 #ifdef BREAKPOINT_FASTPATH
2410 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2411 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using a mask"));
2412 wfcCommit(iDevice, iContext, WFC_TRUE);
2413 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2414 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2415 LOG(("OpenWFTest:Fastpath - still off - using a mask"));
2417 iUtility->FillSurfaceL(surface, 0, KGreen);
2418 err = iUtility->SubmitUpdate(surface, 0, NULL);
2419 ASSERT_EQUALS(err,KErrNone);
2420 iUtility->FillSurfaceL(surfaceMask, 0, KBlack);
2421 err = iUtility->SubmitUpdate(surfaceMask, 0, NULL);
2422 ASSERT_EQUALS(err,KErrNone);
2423 WaitL(iCompositionPause);
2425 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2426 wfcDestroySource(iDevice, fpSource);
2430 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0024
2431 @SYMTestCaseDesc Negative testing - Fastpath one-element scene
2433 @SYMPREQ PREQ417-54885
2434 @SYMTestType Unit Test
2435 @SYMTestPriority High
2436 @SYMTestPurpose Check a scene with alpha and mask settings cannot be fastpathed
2438 All compositions are autonomous:
2439 Create a scene containing a screen sized element A
2440 Enable WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA
2441 Set the value of WFC_ELEMENT_GLOBAL_ALPHA to be 255
2442 Enable WFC_TRANSPARENCY_MASK
2443 Set a value to WFC_ELEMENT_MASK
2444 Create a mask element, set it the same size of element A's destination rectangle
2446 @SYMTestExpectedResults
2447 The scene cannot be fastpathed.
2449 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0024L()
2451 iTestName = _L("FASTPATH_0024");
2452 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2453 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2456 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2457 iFastpathablePixelFormat,
2458 iStride, iContiguous, iMaxBuffers);
2459 ASSERT_FALSE(surface.IsNull());
2461 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2462 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2463 ASSERT_EQUALS(err,KErrNone);
2464 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2465 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2466 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2467 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2469 TSurfaceId surfaceMask = iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2470 iFastpathablePixelFormat,
2471 iStride, iContiguous, iMaxBuffers);
2472 ASSERT_FALSE(surfaceMask.IsNull());
2473 WFCMask mask = wfcCreateMaskFromStream(iDevice, iContext, reinterpret_cast<WFCNativeStreamType>(&surfaceMask), NULL);
2474 err = iUtility->SubmitUpdate(surfaceMask, 0, NULL);
2475 ASSERT_EQUALS(err,KErrNone);
2477 //set the mask and global alpha for use with fpElement
2478 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_MASK, mask);
2479 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_TRANSPARENCY_TYPES,
2480 WFC_TRANSPARENCY_ELEMENT_GLOBAL_ALPHA|WFC_TRANSPARENCY_MASK);
2481 //set global alpha to fully opaque
2482 wfcSetElementAttribf(iDevice, fpElement, WFC_ELEMENT_GLOBAL_ALPHA, 1.0f);
2484 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2485 #ifdef BREAKPOINT_FASTPATH
2488 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using a mask and global alpha"));
2489 wfcCommit(iDevice, iContext, WFC_TRUE);
2490 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2491 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2492 LOG(("OpenWFTest: Fastpath - still off - using a mask and global alpha"));
2494 iUtility->FillSurfaceL(surface, 0, KGreen);
2495 err = iUtility->SubmitUpdate(surface, 0, NULL);
2496 ASSERT_EQUALS(err,KErrNone);
2497 iUtility->FillSurfaceL(surfaceMask, 0, KBlack);
2498 err = iUtility->SubmitUpdate(surfaceMask, 0, NULL);
2499 ASSERT_EQUALS(err,KErrNone);
2500 WaitL(iCompositionPause);
2502 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2503 wfcDestroySource(iDevice, fpSource);
2507 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0025
2508 @SYMTestCaseDesc Negative testing - Fastpath a scene with scaling element
2510 @SYMPREQ PREQ417-54885
2511 @SYMTestType Unit Test
2512 @SYMTestPriority High
2513 @SYMTestPurpose Check a scene with scaling cannot be fastpathed
2515 All compositions are autonomous:
2516 Create an element containing source size smaller than full screen destination size
2517 Add to scene and compose
2518 @SYMTestExpectedResults
2519 The scene cannot be fastpathed.
2521 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0025L()
2523 iTestName = _L("FASTPATH_0025");
2524 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2525 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2528 //create half screen size surface
2529 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth/2,iFastpathableHeight/2),
2530 iFastpathablePixelFormat,
2531 iStride, iContiguous, iMaxBuffers);
2532 ASSERT_FALSE(surface.IsNull());
2534 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2535 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2536 ASSERT_EQUALS(err,KErrNone);
2537 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2538 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2540 //note the source is only half the size of the screen
2541 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iHalfSizeRect);
2542 //set destination to fullscreen, causing it to stretch
2543 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2544 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2545 #ifdef BREAKPOINT_FASTPATH
2548 LOG(("OpenWFTest: Expecting COMPOSITION after next commit - using a mask and global alpha"));
2549 wfcCommit(iDevice, iContext, WFC_TRUE);
2550 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2551 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2552 LOG(("OpenWFTest: Fastpath - still off... - source not equal to destination"));
2554 iUtility->FillSurfaceL(surface, 0, KGreen);
2555 err = iUtility->SubmitUpdate(surface, 0, NULL);
2556 ASSERT_EQUALS(err,KErrNone);
2557 WaitL(iCompositionPause);
2559 ASSERT_TRUE(AcquireOnScreenStream());
2560 ASSERT_TRUE(CheckOnScreenReferenceImage());
2561 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KGreen,iTolerance));
2562 ReleaseOnScreenStream();
2564 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2565 wfcDestroySource(iDevice, fpSource);
2569 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0026
2570 @SYMTestCaseDesc Negative testing - Fastpath a scene with rotation
2572 @SYMPREQ PREQ417-54885
2573 @SYMTestType Unit Test
2574 @SYMTestPriority High
2575 @SYMTestPurpose Check a scene with rotation cannot be fastpathed
2577 All compositions are autonomous:
2578 Create a scene containing a screen size element
2580 Rotate the element with 90, 180 and 270 degrees
2582 @SYMTestExpectedResults
2583 The scene can be fastpathed only for the first scene commited composition.
2585 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0026L()
2587 iTestName = _L("FASTPATH_0026");
2588 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2589 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2592 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2593 iFastpathablePixelFormat,
2594 iStride, iContiguous, iMaxBuffers);
2595 ASSERT_FALSE(surface.IsNull());
2597 WFCSource fpSource = wfcCreateSourceFromStream(iDevice, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2598 TInt err = iUtility->SubmitUpdate(surface, 0, NULL);
2599 ASSERT_EQUALS(err,KErrNone);
2600 WFCElement fpElement = wfcCreateElement(iDevice, iContext, NULL);
2601 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2602 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE_RECTANGLE, 4, iFullScreenRect);
2603 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_DESTINATION_RECTANGLE, 4, iFullScreenRect);
2605 wfcInsertElement(iDevice, fpElement, WFC_INVALID_HANDLE);
2606 #ifdef BREAKPOINT_FASTPATH
2609 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
2610 wfcCommit(iDevice, iContext, WFC_TRUE);
2611 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2612 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2613 LOG(("OpenWFTest: Fastpath - now ON"));
2615 iUtility->FillSurfaceL(surface, 0, KGreen);
2616 err = iUtility->SubmitUpdate(surface, 0, NULL);
2617 ASSERT_EQUALS(err,KErrNone);
2618 WaitL(iCompositionPause);
2620 //Set 90 degree rotation
2621 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE_ROTATION, WFC_ROTATION_90);
2623 #ifdef BREAKPOINT_FASTPATH
2626 iUtility->FillSurfaceL(surface, 0, KBlue);
2627 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
2628 wfcCommit(iDevice, iContext, WFC_TRUE);
2629 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2630 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2631 LOG(("OpenWFTest: Fastpath - now OFF"));
2632 WaitL(iCompositionPause);
2634 ASSERT_TRUE(AcquireOnScreenStream());
2635 ASSERT_TRUE(CheckOnScreenReferenceImage());
2636 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KBlue,iTolerance));
2637 ReleaseOnScreenStream();
2640 //Set 180 degree rotation
2641 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE_ROTATION, WFC_ROTATION_180);
2643 #ifdef BREAKPOINT_FASTPATH
2646 iUtility->FillSurfaceL(surface, 0, KMagenta);
2647 LOG(("OpenWFTest: Expecting FASTPATH after next commit"));
2648 wfcCommit(iDevice, iContext, WFC_TRUE);
2649 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2650 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2651 LOG(("OpenWFTest: Fastpath - now OFF"));
2652 WaitL(iCompositionPause);
2654 ASSERT_TRUE(AcquireOnScreenStream());
2655 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KMagenta,iTolerance));
2656 ASSERT_TRUE(CheckOnScreenReferenceImage());
2657 ReleaseOnScreenStream();
2659 //Set 270 degree rotation
2660 wfcSetElementAttribi(iDevice, fpElement, WFC_ELEMENT_SOURCE_ROTATION, WFC_ROTATION_270);
2662 #ifdef BREAKPOINT_FASTPATH
2665 iUtility->FillSurfaceL(surface, 0, KBrown);
2666 LOG(("OpenWFTest: Expecting COMPOSITION after next commit"));
2667 wfcCommit(iDevice, iContext, WFC_TRUE);
2668 wfcFence(iDevice, iContext, iEGLDisplay, iSync);
2669 ASSERT_EQUALS(eglClientWaitSyncKHR(iEGLDisplay,iSync,0,(EGLTimeKHR)EGL_FOREVER_KHR),EGL_CONDITION_SATISFIED_KHR);
2670 LOG(("OpenWFTest: Fastpath - now OFF"));
2671 WaitL(iCompositionPause);
2673 ASSERT_TRUE(AcquireOnScreenStream());
2674 ASSERT_TRUE(CheckOnScreenStreamRect(iFullScreenTRect,KBrown,iTolerance));
2675 ASSERT_TRUE(CheckOnScreenReferenceImage());
2676 ReleaseOnScreenStream();
2678 ASSERT_EQUALS(wfcGetError(iDevice),WFC_ERROR_NONE);
2679 wfcDestroySource(iDevice, fpSource);
2683 @SYMTestCaseID GRAPHICS-OPENWFC-FASTPATH-0027
2684 @SYMTestCaseDesc Negative testing - Pass in bad parameter values
2686 @SYMPREQ PREQ417-54885
2687 @SYMTestType Unit Test
2688 @SYMTestPriority High
2689 @SYMTestPurpose Check invalid parameter values passed in OWF APIs
2691 Use invalid values to call OWF APIs
2692 @SYMTestExpectedResults
2693 Test should pass without panic.
2695 void COpenwfTest::GRAPHICS_OPENWFC_FASTPATH_0027L()
2697 iTestName = _L("FASTPATH_0027");
2698 INFO_PRINTF2(_L("GRAPHICS_OPENWFC_%SL()"),&iTestName);
2699 LOGL((_L("OpenWFTest: GRAPHICS_OPENWFC_%SL()"),&iTestName));
2702 WFCint filterList[] = { WFC_DEVICE_FILTER_SCREEN_NUMBER, WFC_DEFAULT_SCREEN_NUMBER, WFC_NONE};
2703 ASSERT_TRUE(wfcEnumerateDevices(&deviceId, 1, filterList) == 1);
2705 WFCint attribList = 1;
2706 WFCDevice device = wfcCreateDevice(deviceId, &attribList);
2707 WFCContext onScreenContext = wfcCreateOnScreenContext(NULL, WFC_DEFAULT_SCREEN_NUMBER, NULL);
2708 WFCContext offScreenContext = wfcCreateOffScreenContext(NULL, WFC_DEFAULT_SCREEN_NUMBER, NULL);
2710 WFCfloat value = 1.0;
2711 wfcGetContextAttribi(NULL, iContext, WFC_CONTEXT_TARGET_HEIGHT);
2712 wfcSetContextAttribi(NULL, iContext, WFC_CONTEXT_ROTATION, WFC_ROTATION_0);
2713 wfcGetContextAttribfv(NULL, iContext, WFC_CONTEXT_ROTATION, NULL, &value);
2714 wfcSetContextAttribfv(NULL, iContext, WFC_CONTEXT_ROTATION, NULL, &value);
2716 TSurfaceId surface=iUtility->CreateSurfaceL(TSize(iFastpathableWidth,iFastpathableHeight),
2717 iFastpathablePixelFormat,
2718 iStride, iContiguous, iMaxBuffers);
2719 ASSERT_FALSE(surface.IsNull());
2721 WFCSource fpSource = wfcCreateSourceFromStream(NULL, iContext,reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2722 wfcCreateMaskFromStream(NULL, iContext, reinterpret_cast<WFCNativeStreamType>(&surface), NULL);
2723 WFCElement fpElement = wfcCreateElement(NULL, iContext, NULL);
2724 wfcSetElementAttribi(NULL, fpElement, WFC_ELEMENT_SOURCE, fpSource);
2725 wfcSetElementAttribf(NULL, fpElement, WFC_ELEMENT_SOURCE, NULL);
2726 wfcSetElementAttribiv(NULL, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2727 wfcSetElementAttribfv(NULL, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2728 wfcSetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2729 wfcSetElementAttribfv(iDevice, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2731 wfcGetElementAttribi(NULL, fpElement, WFC_ELEMENT_SOURCE);
2732 wfcGetElementAttribf(NULL, fpElement, WFC_ELEMENT_SOURCE);
2733 wfcGetElementAttribiv(NULL, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2734 wfcGetElementAttribiv(iDevice, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2735 wfcGetElementAttribfv(NULL, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2736 wfcGetElementAttribfv(iDevice, fpElement, WFC_ELEMENT_SOURCE, NULL, NULL);
2738 wfcInsertElement(NULL, fpElement, NULL);
2739 wfcGetElementAbove(NULL, fpElement);
2740 wfcGetElementBelow(NULL, fpElement);
2742 WFCDeviceAttrib devAttrib = WFC_DEVICE_ID;
2743 wfcGetDeviceAttribi(NULL, devAttrib);
2745 wfcActivate(NULL, iContext);
2746 wfcActivate(iDevice, NULL);
2747 wfcDeactivate(NULL, iContext);
2748 wfcDeactivate(iDevice, NULL);
2749 wfcCompose(NULL, iContext, WFC_TRUE);
2750 wfcCompose(iDevice, NULL, WFC_TRUE);
2751 wfcCommit(NULL, iContext, WFC_TRUE);
2752 wfcCommit(iDevice, NULL, WFC_TRUE);
2753 wfcFence(NULL, iContext, iEGLDisplay, iSync);
2754 wfcFence(iDevice, NULL, iEGLDisplay, iSync);
2756 WFCMask mask = WFC_INVALID_HANDLE;
2757 wfcDestroyMask(NULL, mask);
2758 wfcRemoveElement(NULL, fpElement);
2759 wfcDestroyElement(NULL, fpElement);
2760 wfcDestroySource(NULL, fpSource);
2761 wfcDestroyContext(NULL, onScreenContext);