egl/egltest/src/egltest_image_multiprocess.cpp
changeset 103 2717213c588a
parent 36 01a6848ebfd7
child 116 171fae344dd4
equal deleted inserted replaced
98:bf7481649c98 103:2717213c588a
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   516         TSgDrawableId sgImageId;
   516         TSgDrawableId sgImageId;
   517         messageQueue.ReceiveBlocking(sgImageId);
   517         messageQueue.ReceiveBlocking(sgImageId);
   518         ASSERT_EQUALS(rSgImageLocal.Open(sgImageId), KErrNone);
   518         ASSERT_EQUALS(rSgImageLocal.Open(sgImageId), KErrNone);
   519         }
   519         }
   520 
   520 
   521 	INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
   521 	// Wait for both processes to reach this point
       
   522     Rendezvous(aIdx);
       
   523     
       
   524     INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
   522 	CleanupClosePushL(rSgImageLocal);
   525 	CleanupClosePushL(rSgImageLocal);
   523 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
   526 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
   524 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
   527 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
   525 	CleanupStack::PopAndDestroy(&rSgImageLocal); 	//transferring ownership of the buffer to the EGLImage
   528 	CleanupStack::PopAndDestroy(&rSgImageLocal); 	//transferring ownership of the buffer to the EGLImage
   526 
   529 
   692         INFO_PRINTF2(_L("Process %d: Receiving SgImage ID from other process..."), aIdx);
   695         INFO_PRINTF2(_L("Process %d: Receiving SgImage ID from other process..."), aIdx);
   693         TSgDrawableId sgImageId;
   696         TSgDrawableId sgImageId;
   694         messageQueue.ReceiveBlocking(sgImageId);
   697         messageQueue.ReceiveBlocking(sgImageId);
   695         ASSERT_EQUALS(rSgImageLocal.Open(sgImageId),KErrNone);
   698         ASSERT_EQUALS(rSgImageLocal.Open(sgImageId),KErrNone);
   696         }
   699         }
       
   700 
       
   701 	// Wait for both processes to reach this point
       
   702     Rendezvous(aIdx);
   697 
   703 
   698 	INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
   704 	INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
   699 	CleanupClosePushL(rSgImageLocal);
   705 	CleanupClosePushL(rSgImageLocal);
   700 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
   706 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
   701 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
   707 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
  2104         TSgDrawableId sgImageId;
  2110         TSgDrawableId sgImageId;
  2105         messageQueueSgId.ReceiveBlocking(sgImageId);
  2111         messageQueueSgId.ReceiveBlocking(sgImageId);
  2106     	ASSERT_EQUALS(rSgImageLocal.Open(sgImageId),KErrNone);
  2112     	ASSERT_EQUALS(rSgImageLocal.Open(sgImageId),KErrNone);
  2107         }
  2113         }
  2108 
  2114 
       
  2115 	// Wait for both processes to reach this point
       
  2116     Rendezvous(aIdx);
       
  2117     
  2109     INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
  2118     INFO_PRINTF2(_L("Process %d, Creating an EGLImage from the shared RSgImage"),aIdx);
  2110 	CleanupClosePushL(rSgImageLocal);
  2119 	CleanupClosePushL(rSgImageLocal);
  2111 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
  2120 	EGLImageKHR eglImageLocal = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &rSgImageLocal, KEglImageAttribsPreservedTrue);
  2112 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
  2121 	ASSERT_EGL_TRUE(eglImageLocal != EGL_NO_IMAGE_KHR);
  2113 	CleanupStack::PopAndDestroy(&rSgImageLocal); 	//transferring ownership of the buffer to the EGLImage
  2122 	CleanupStack::PopAndDestroy(&rSgImageLocal); 	//transferring ownership of the buffer to the EGLImage