egl/egltest/src/egltest_image_negative.cpp
changeset 36 01a6848ebfd7
parent 0 5d03bc08d59c
equal deleted inserted replaced
0:5d03bc08d59c 36:01a6848ebfd7
    74 
    74 
    75 	// Create display object
    75 	// Create display object
    76 	GetDisplayL();
    76 	GetDisplayL();
    77 	CreateEglSessionL();
    77 	CreateEglSessionL();
    78 	iEglSess->InitializeL();
    78 	iEglSess->InitializeL();
    79 	iEglSess->OpenSgDriverL();	
    79 	iEglSess->OpenSgDriverL();
    80 	
    80 
    81 	INFO_PRINTF1(_L("Creating one EGLImage from a NULL RSgImage"));
    81 	INFO_PRINTF1(_L("Creating one EGLImage from a NULL RSgImage"));
    82 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, NULL, KEglImageAttribsPreservedTrue);
    82 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, NULL, KEglImageAttribsPreservedTrue);
    83 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
    83 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
    84 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
    84 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
    85 	
    85 
    86 	INFO_PRINTF1(_L("Creating one EGLImage from a not fully constructed RSgImage"));
    86 	INFO_PRINTF1(_L("Creating one EGLImage from a not fully constructed RSgImage"));
    87 	RSgImage sgImage;
    87 	RSgImage sgImage;
    88 	CleanupClosePushL(sgImage);
    88 	CleanupClosePushL(sgImage);
    89 	imageKHR = iEglSess->eglCreateImageKhrL(iDisplay,EGL_NO_CONTEXT,EGL_NATIVE_PIXMAP_KHR,&sgImage,KEglImageAttribsPreservedTrue);
    89 	imageKHR = iEglSess->eglCreateImageKhrL(iDisplay,EGL_NO_CONTEXT,EGL_NATIVE_PIXMAP_KHR,&sgImage,KEglImageAttribsPreservedTrue);
    90 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
    90 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
   239 
   239 
   240 	// Create a reference bitmap which we use to init the SgImage (we use index=8)
   240 	// Create a reference bitmap which we use to init the SgImage (we use index=8)
   241 	TDisplayMode bitmapMode = EglTestConversion::PixelFormatToDisplayMode(iSourceFormat);
   241 	TDisplayMode bitmapMode = EglTestConversion::PixelFormatToDisplayMode(iSourceFormat);
   242 	CFbsBitmap* bitmap = iEglSess->CreateReferenceBitmapL(bitmapMode, KPixmapSize, 8);
   242 	CFbsBitmap* bitmap = iEglSess->CreateReferenceBitmapL(bitmapMode, KPixmapSize, 8);
   243 	CleanupStack::PushL(bitmap);
   243 	CleanupStack::PushL(bitmap);
   244 	
   244 
   245 	// Create RSgImage's attributes.
   245 	// Create RSgImage's attributes.
   246 	TSgImageInfoTest imageInfo;
   246 	TSgImageInfoTest imageInfo;
   247 	imageInfo.iSizeInPixels = KPixmapSize;
   247 	imageInfo.iSizeInPixels = KPixmapSize;
   248 	imageInfo.iPixelFormat = iSourceFormat;
   248 	imageInfo.iPixelFormat = iSourceFormat;
   249 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   249 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   252 	imageInfo.iUsage = ESgUsageDirectGdiSource;
   252 	imageInfo.iUsage = ESgUsageDirectGdiSource;
   253 	imageInfo.iShareable = EFalse;
   253 	imageInfo.iShareable = EFalse;
   254 	imageInfo.iCpuAccess = ESgCpuAccessNone;
   254 	imageInfo.iCpuAccess = ESgCpuAccessNone;
   255 	imageInfo.iScreenId = KSgScreenIdMain;
   255 	imageInfo.iScreenId = KSgScreenIdMain;
   256 	imageInfo.iUserAttributes = NULL;
   256 	imageInfo.iUserAttributes = NULL;
   257 	imageInfo.iUserAttributeCount = 0;	
   257 	imageInfo.iUserAttributeCount = 0;
   258 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   258 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   259 
   259 
   260 	RSgImage sgImage;
   260 	RSgImage sgImage;
   261 	CleanupClosePushL(sgImage);
   261 	CleanupClosePushL(sgImage);
   262 	ASSERT_EQUALS(sgImage.Create(imageInfo, bitmap->DataAddress(), bitmap->DataStride()), KErrNone);
   262 	ASSERT_EQUALS(sgImage.Create(imageInfo, bitmap->DataAddress(), bitmap->DataStride()), KErrNone);
   263 
   263 
   264 	//First Subtest: creation of an EGLImageKhr with wrong Usage will fail
   264 	//First Subtest: Attempted creation of an EGLImageKhr from an RSgImage with the wrong Usage should fail
   265 	INFO_PRINTF1(_L("Trying to create an EGLImage from a RSgImage that doesn't have correct iUsage, ESgUsageBitOpenVgImage|ESgUsageOpenGlesTexture2D|ESgUsageOpenGles2Texture2D"));
   265 	INFO_PRINTF1(_L("Attempt creation of an EGLImage from a RSgImage with incorrect iUsage ESgUsageBitOpenGlesSurface"));
       
   266 	INFO_PRINTF1(_L("Correct iUsage needs to have at least one of ESgUsageBitOpenVgImage, ESgUsageOpenGlesTexture2D or ESgUsageOpenGles2Texture2D bits set"));
       
   267 
   266 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage, KEglImageAttribsPreservedTrue);
   268 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage, KEglImageAttribsPreservedTrue);
   267 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
   269 	ASSERT_EGL_TRUE(imageKHR == EGL_NO_IMAGE_KHR);
   268 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
   270 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
   269     CleanupStack::PopAndDestroy(&sgImage);
   271     CleanupStack::PopAndDestroy(&sgImage);
   270 	
   272 
   271 	if(iEglSess->IsOpenGLES2Supported())
   273 	if(iEglSess->IsOpenGLES2Supported())
   272 	    {
   274 	    {
   273 	    TSgImageInfoTest imageInfo2;
   275 	    TSgImageInfoTest imageInfo2;
   274 		imageInfo2.iSizeInPixels = KPixmapSize;
   276 		imageInfo2.iSizeInPixels = KPixmapSize;
   275 		imageInfo2.iPixelFormat = iSourceFormat;
   277 		imageInfo2.iPixelFormat = iSourceFormat;
   276 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   278 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   277 		imageInfo2.iUsage = ESgUsageBitOpenGles2Texture2D;
   279 		imageInfo2.iUsage = ESgUsageBitOpenGles2Texture2D;
   278 #else
   280 #else
   279 		imageInfo2.iUsage = ESgUsageOpenGlesTexture2D;
   281 		imageInfo2.iUsage = ESgUsageOpenGlesTexture2D;
   280 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   282 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   281 	
   283 
   282 	    // Create a SgImage
   284 	    // Create a SgImage
   283 		RSgImage sgImage2;
   285 		RSgImage sgImage2;
   284 		CleanupClosePushL(sgImage2);
   286 		CleanupClosePushL(sgImage2);
   285 		ASSERT_EQUALS(sgImage2.Create(imageInfo2, bitmap->DataAddress(), bitmap->DataStride()), KErrNone);
   287 		ASSERT_EQUALS(sgImage2.Create(imageInfo2, bitmap->DataAddress(), bitmap->DataStride()), KErrNone);
   286 
   288 
   287 	    // Create a EGLImage from the RSgImage
   289 	    // The creation of an EGLImage from a RSgImage with correct usage (ESgUsageBitOpenGles2Texture2D or ESgUsageOpenGlesTexture2D) should pass
   288 		EGLImageKHR imageKHR2 = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage2, KEglImageAttribsPreservedTrue);
   290 		EGLImageKHR imageKHR2 = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage2, KEglImageAttribsPreservedTrue);
   289 		ASSERT_EGL_TRUE(imageKHR2 == EGL_NO_IMAGE_KHR);
   291 		ASSERT_EGL_TRUE(imageKHR2 != EGL_NO_IMAGE_KHR);
   290 
   292 
   291 	    //Create an OffScreen Pixmap, we need it to make a Context current
   293 	    //Create an OffScreen Pixmap, we need it to make a Context current
   292 	    imageInfo2.iSizeInPixels = KPixmapSize;
   294 	    imageInfo2.iSizeInPixels = KPixmapSize;
   293 	    imageInfo2.iPixelFormat = iSourceFormat;
   295 	    imageInfo2.iPixelFormat = iSourceFormat;
   294 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   296 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   303 	    VGImage vgImageTarget = iEglSess->vgCreateImageTargetKHR((VGeglImageKHR)imageKHR2);
   305 	    VGImage vgImageTarget = iEglSess->vgCreateImageTargetKHR((VGeglImageKHR)imageKHR2);
   304 	    ASSERT_VG_TRUE(vgImageTarget == VG_INVALID_HANDLE);
   306 	    ASSERT_VG_TRUE(vgImageTarget == VG_INVALID_HANDLE);
   305 	    ASSERT_TRUE(vgGetError()==VG_UNSUPPORTED_IMAGE_FORMAT_ERROR);
   307 	    ASSERT_TRUE(vgGetError()==VG_UNSUPPORTED_IMAGE_FORMAT_ERROR);
   306 
   308 
   307         CleanupStack::PopAndDestroy(&sgImage2);
   309         CleanupStack::PopAndDestroy(&sgImage2);
   308         ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR2));		
   310         ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR2));
   309 	    }
   311 	    }
   310 	
   312 
   311 	//cleanup
   313 	//cleanup
   312 	CleanupStack::PopAndDestroy(bitmap);
   314 	CleanupStack::PopAndDestroy(bitmap);
   313 	CleanAll();
   315 	CleanAll();
   314 	
   316 
   315 	RecordTestResultL();
   317 	RecordTestResultL();
   316 	CloseTMSGraphicsStep();
   318 	CloseTMSGraphicsStep();
   317 	return TestStepResult();
   319 	return TestStepResult();
   318 	}
   320 	}
   319 
   321 
   371 	GetDisplayL();
   373 	GetDisplayL();
   372 	CreateEglSessionL();
   374 	CreateEglSessionL();
   373 	iEglSess->InitializeL();
   375 	iEglSess->InitializeL();
   374 	iEglSess->OpenSgDriverL();
   376 	iEglSess->OpenSgDriverL();
   375 
   377 
   376 	INFO_PRINTF1(_L("Creating one RSgImage"));	
   378 	INFO_PRINTF1(_L("Creating one RSgImage"));
   377 	TSgImageInfoOpenVgImage imageInfo = TSgImageInfoOpenVgImage(iSourceFormat, KPixmapSize);
   379 	TSgImageInfoOpenVgImage imageInfo = TSgImageInfoOpenVgImage(iSourceFormat, KPixmapSize);
   378 #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   380 #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   379 	imageInfo.iCpuAccess = ESgCpuAccessReadWrite;
   381 	imageInfo.iCpuAccess = ESgCpuAccessReadWrite;
   380 #endif	
   382 #endif
   381 	RSgImage sgImage;
   383 	RSgImage sgImage;
   382 	CleanupClosePushL(sgImage);
   384 	CleanupClosePushL(sgImage);
   383 	ASSERT_EQUALS(sgImage.Create(imageInfo, NULL, NULL), KErrNone);
   385 	ASSERT_EQUALS(sgImage.Create(imageInfo, NULL, NULL), KErrNone);
   384 
   386 
   385 	INFO_PRINTF1(_L("Creating one EGLImage from it"));
   387 	INFO_PRINTF1(_L("Creating one EGLImage from it"));
   386 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage, KEglImageAttribsPreservedTrue);
   388 	EGLImageKHR imageKHR = iEglSess->eglCreateImageKhrL(iDisplay, EGL_NO_CONTEXT, EGL_NATIVE_PIXMAP_KHR, &sgImage, KEglImageAttribsPreservedTrue);
   387 	ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR);
   389 	ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR);
   388 	
   390 
   389 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with EGL_NO_DISPLAY"));
   391 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with EGL_NO_DISPLAY"));
   390 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(EGL_NO_DISPLAY, imageKHR));		
   392 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(EGL_NO_DISPLAY, imageKHR));
   391 	ASSERT_EGL_ERROR(EGL_BAD_DISPLAY);
   393 	ASSERT_EGL_ERROR(EGL_BAD_DISPLAY);
   392 
   394 
   393 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with a random number (but not 1) as Display"));
   395 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with a random number (but not 1) as Display"));
   394 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(7, imageKHR));		
   396 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(7, imageKHR));
   395 	ASSERT_EGL_ERROR(EGL_BAD_DISPLAY);
   397 	ASSERT_EGL_ERROR(EGL_BAD_DISPLAY);
   396 
   398 
   397 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with valid EGLImage handle (so, that should succeed)"));
   399 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with valid EGLImage handle (so, that should succeed)"));
   398 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));		
   400 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));
   399 
   401 
   400 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with invalid handle"));
   402 	INFO_PRINTF1(_L("Calling eglDestroyImageKHR with invalid handle"));
   401 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(iDisplay, imageKHR));		
   403 	ASSERT_EGL_TRUE(!iEglSess->DestroyEGLImage(iDisplay, imageKHR));
   402 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
   404 	ASSERT_EGL_ERROR(EGL_BAD_PARAMETER);
   403 	
   405 
   404 	//cleanup
   406 	//cleanup
   405     CleanupStack::PopAndDestroy(&sgImage);	
   407     CleanupStack::PopAndDestroy(&sgImage);
   406 	CleanAll();
   408 	CleanAll();
   407 	
   409 
   408 	RecordTestResultL();
   410 	RecordTestResultL();
   409 	CloseTMSGraphicsStep();
   411 	CloseTMSGraphicsStep();
   410 	return TestStepResult();
   412 	return TestStepResult();
   411 	}
   413 	}
   412 
   414 
   462 	GetDisplayL();
   464 	GetDisplayL();
   463 	CreateEglSessionL();
   465 	CreateEglSessionL();
   464 	iEglSess->InitializeL();
   466 	iEglSess->InitializeL();
   465 	iEglSess->OpenSgDriverL();
   467 	iEglSess->OpenSgDriverL();
   466 
   468 
   467 	INFO_PRINTF1(_L("Creating one RSgImage"));	
   469 	INFO_PRINTF1(_L("Creating one RSgImage"));
   468 	TSgImageInfoOpenVgImage imageInfo = TSgImageInfoOpenVgImage(iSourceFormat, KPixmapSize);
   470 	TSgImageInfoOpenVgImage imageInfo = TSgImageInfoOpenVgImage(iSourceFormat, KPixmapSize);
   469 #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   471 #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   470 	imageInfo.iCpuAccess = ESgCpuAccessReadWrite;
   472 	imageInfo.iCpuAccess = ESgCpuAccessReadWrite;
   471 #endif	
   473 #endif
   472 	RSgImage sgImage;
   474 	RSgImage sgImage;
   473 	CleanupClosePushL(sgImage);
   475 	CleanupClosePushL(sgImage);
   474 	ASSERT_EQUALS(sgImage.Create(imageInfo, NULL, NULL), KErrNone);
   476 	ASSERT_EQUALS(sgImage.Create(imageInfo, NULL, NULL), KErrNone);
   475 
   477 
   476 	INFO_PRINTF1(_L("Creating one EGLImage from it"));
   478 	INFO_PRINTF1(_L("Creating one EGLImage from it"));
   481 	TUidPixelFormat pixelFormat = EglTestConversion::VgFormatToSgPixelFormat(iSurfaceFormat);
   483 	TUidPixelFormat pixelFormat = EglTestConversion::VgFormatToSgPixelFormat(iSurfaceFormat);
   482 	TSgImageInfoOpenVgTarget imageInfo2 = TSgImageInfoOpenVgTarget(pixelFormat, KPixmapSize);
   484 	TSgImageInfoOpenVgTarget imageInfo2 = TSgImageInfoOpenVgTarget(pixelFormat, KPixmapSize);
   483 	iEglSess->CreatePixmapSurfaceAndMakeCurrentAndMatchL(imageInfo2, CTestEglSession::EResourceCloseSgImageEarly);
   485 	iEglSess->CreatePixmapSurfaceAndMakeCurrentAndMatchL(imageInfo2, CTestEglSession::EResourceCloseSgImageEarly);
   484 
   486 
   485 	INFO_PRINTF1(_L("Destroying the EGLImage but retain the handle value"));
   487 	INFO_PRINTF1(_L("Destroying the EGLImage but retain the handle value"));
   486 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));		
   488 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));
   487 
   489 
   488 	INFO_PRINTF1(_L("Attemptimg to create a VGImage from an invalid handle"));
   490 	INFO_PRINTF1(_L("Attemptimg to create a VGImage from an invalid handle"));
   489 	VGImage vgImage = iEglSess->vgCreateImageTargetKHR((VGeglImageKHR)imageKHR);	
   491 	VGImage vgImage = iEglSess->vgCreateImageTargetKHR((VGeglImageKHR)imageKHR);
   490 	ASSERT_VG_TRUE(vgImage == VG_INVALID_HANDLE);
   492 	ASSERT_VG_TRUE(vgImage == VG_INVALID_HANDLE);
   491 	ASSERT_TRUE(vgGetError()==VG_ILLEGAL_ARGUMENT_ERROR);
   493 	ASSERT_TRUE(vgGetError()==VG_ILLEGAL_ARGUMENT_ERROR);
   492 
   494 
   493 	vgDestroyImage(vgImage);
   495 	vgDestroyImage(vgImage);
   494 	ASSERT_TRUE(vgGetError()==VG_BAD_HANDLE_ERROR);
   496 	ASSERT_TRUE(vgGetError()==VG_BAD_HANDLE_ERROR);
   495 
   497 
   496 	//cleanup
   498 	//cleanup
   497     CleanupStack::PopAndDestroy(&sgImage);	
   499     CleanupStack::PopAndDestroy(&sgImage);
   498 	CleanAll();
   500 	CleanAll();
   499 	
   501 
   500 	RecordTestResultL();
   502 	RecordTestResultL();
   501 	CloseTMSGraphicsStep();
   503 	CloseTMSGraphicsStep();
   502 	return TestStepResult();
   504 	return TestStepResult();
   503 	}
   505 	}
   504 
   506 
   566 
   568 
   567 	// Create a reference bitmap which we use to init the SgImage (we use index=8)
   569 	// Create a reference bitmap which we use to init the SgImage (we use index=8)
   568 	TDisplayMode bitmapMode = EglTestConversion::PixelFormatToDisplayMode(iSourceFormat);
   570 	TDisplayMode bitmapMode = EglTestConversion::PixelFormatToDisplayMode(iSourceFormat);
   569 	CFbsBitmap* bitmap = iEglSess->CreateReferenceBitmapL(bitmapMode, KPixmapSize, 8);
   571 	CFbsBitmap* bitmap = iEglSess->CreateReferenceBitmapL(bitmapMode, KPixmapSize, 8);
   570 	CleanupStack::PushL(bitmap);
   572 	CleanupStack::PushL(bitmap);
   571 	
   573 
   572 	INFO_PRINTF1(_L("Creating one RSgImage"));	
   574 	INFO_PRINTF1(_L("Creating one RSgImage"));
   573 	TSgImageInfoTest imageInfo;
   575 	TSgImageInfoTest imageInfo;
   574 	imageInfo.iSizeInPixels = KPixmapSize;
   576 	imageInfo.iSizeInPixels = KPixmapSize;
   575 	imageInfo.iPixelFormat = iSourceFormat;
   577 	imageInfo.iPixelFormat = iSourceFormat;
   576 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   578 #ifdef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
   577 	imageInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface;
   579 	imageInfo.iUsage = ESgUsageBitOpenVgImage | ESgUsageBitOpenVgSurface;
   587 	ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR);
   589 	ASSERT_EGL_TRUE(imageKHR != EGL_NO_IMAGE_KHR);
   588 
   590 
   589 	INFO_PRINTF1(_L("Calling eglBindAPI(EGL_OPENVG_API)"));
   591 	INFO_PRINTF1(_L("Calling eglBindAPI(EGL_OPENVG_API)"));
   590 	ASSERT_EGL_TRUE(eglBindAPI(EGL_OPENVG_API));
   592 	ASSERT_EGL_TRUE(eglBindAPI(EGL_OPENVG_API));
   591 
   593 
   592     EGLint numConfigsWithPre = 0;       
   594     EGLint numConfigsWithPre = 0;
   593     EGLConfig configWithPre;
   595     EGLConfig configWithPre;
   594     const EGLint KAttribImagePre[] = { EGL_MATCH_NATIVE_PIXMAP,  reinterpret_cast<EGLint>(&sgImage),
   596     const EGLint KAttribImagePre[] = { EGL_MATCH_NATIVE_PIXMAP,  reinterpret_cast<EGLint>(&sgImage),
   595                                        EGL_RENDERABLE_TYPE,      EGL_OPENVG_BIT,
   597                                        EGL_RENDERABLE_TYPE,      EGL_OPENVG_BIT,
   596                                        EGL_SURFACE_TYPE,         EGL_PIXMAP_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT,
   598                                        EGL_SURFACE_TYPE,         EGL_PIXMAP_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT,
   597                                        EGL_NONE };
   599                                        EGL_NONE };
   621 	eglWaitClient();
   623 	eglWaitClient();
   622 
   624 
   623 	//cleanup
   625 	//cleanup
   624 	vgDestroyImage(vgImage);
   626 	vgDestroyImage(vgImage);
   625 	ASSERT_TRUE(vgGetError()==VG_NO_ERROR);
   627 	ASSERT_TRUE(vgGetError()==VG_NO_ERROR);
   626 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));		
   628 	ASSERT_EGL_TRUE(iEglSess->DestroyEGLImage(iDisplay, imageKHR));
   627 	CleanupStack::PopAndDestroy(2, bitmap); // bitmap, sgImage
   629 	CleanupStack::PopAndDestroy(2, bitmap); // bitmap, sgImage
   628 	//This test doesn't check the drawing because the content of the image are undefined
   630 	//This test doesn't check the drawing because the content of the image are undefined
   629 	//since we are using the same buffer both as target and as source
   631 	//since we are using the same buffer both as target and as source
   630 	//The main purpose of this test is to ensure we don't get a panic
   632 	//The main purpose of this test is to ensure we don't get a panic
   631 	ASSERT_EGL_TRUE(eglDestroyContext(iDisplay, context));					//Closing eglContext
   633 	ASSERT_EGL_TRUE(eglDestroyContext(iDisplay, context));					//Closing eglContext