egl/egltest/src/egltest_general.cpp
branchRCL_3
changeset 18 5e30ef2e26cb
parent 0 5d03bc08d59c
equal deleted inserted replaced
11:fed1595b188e 18:5e30ef2e26cb
   105 	if (ptrEglClientApis.Find(_L8("OpenVG")) >= 0)
   105 	if (ptrEglClientApis.Find(_L8("OpenVG")) >= 0)
   106 		{
   106 		{
   107 		INFO_PRINTF1(_L("Dumping OpenVG strings"));
   107 		INFO_PRINTF1(_L("Dumping OpenVG strings"));
   108 
   108 
   109 		// OpenVG needs a current VG context before it will allow the call to vgGetString
   109 		// OpenVG needs a current VG context before it will allow the call to vgGetString
   110 		TUidPixelFormat pixelFormat = EglTestConversion::VgFormatToSgPixelFormat(KDefaultSurfaceFormat);
   110         EGLConfig currentConfig = eglSess->GetConfigExactMatchL(EPBufferAttribsColor64K);
   111 		TSgImageInfoOpenVgTarget imageInfo = TSgImageInfoOpenVgTarget(pixelFormat, KPixmapSize);
   111         eglSess->CreatePbufferSurfaceAndMakeCurrentL(currentConfig, KPixmapSize, EGL_OPENVG_API);
   112 		eglSess->CreatePixmapSurfaceAndMakeCurrentAndMatchL(imageInfo,CTestEglSession::EResourceCloseSgImageEarly, EGL_OPENVG_API);
       
   113 
   112 
   114 		TPtrC8 ptrVgVendor((const TText8 *)vgGetString(VG_VENDOR));
   113 		TPtrC8 ptrVgVendor((const TText8 *)vgGetString(VG_VENDOR));
   115 		DumpString(_L("VG_VENDOR"), ptrVgVendor);
   114 		DumpString(_L("VG_VENDOR"), ptrVgVendor);
   116 
   115 
   117 		TPtrC8 ptrVgRenderer((const TText8 *)vgGetString(VG_RENDERER));
   116 		TPtrC8 ptrVgRenderer((const TText8 *)vgGetString(VG_RENDERER));
   131 	if (ptrEglClientApis.Find(_L8("OpenGL_ES")) >= 0)
   130 	if (ptrEglClientApis.Find(_L8("OpenGL_ES")) >= 0)
   132 		{
   131 		{
   133 		INFO_PRINTF1(_L("Dumping OpenGLES strings"));
   132 		INFO_PRINTF1(_L("Dumping OpenGLES strings"));
   134 
   133 
   135 		// OpenGLES needs a current GLES context before it will allow the call to glGetString
   134 		// OpenGLES needs a current GLES context before it will allow the call to glGetString
   136 		TUidPixelFormat pixelFormat = EglTestConversion::VgFormatToSgPixelFormat(KDefaultSurfaceFormat);
   135         EGLConfig currentConfig = eglSess->GetConfigExactMatchL(EPBufferAttribsColor64K);
   137 		TSgImageInfoOpenVgTarget imageInfo = TSgImageInfoOpenVgTarget(pixelFormat, KPixmapSize);
   136         eglSess->CreatePbufferSurfaceAndMakeCurrentL(currentConfig, KPixmapSize, EGL_OPENGL_ES_API);
   138 		eglSess->CreatePixmapSurfaceAndMakeCurrentAndMatchL(imageInfo,CTestEglSession::EResourceCloseSgImageEarly, EGL_OPENGL_ES_API);
       
   139 
   137 
   140 		TPtrC8 ptrGlesVendor((const TText8 *)glGetString(GL_VENDOR));
   138 		TPtrC8 ptrGlesVendor((const TText8 *)glGetString(GL_VENDOR));
   141 		DumpString(_L("GL_VENDOR"), ptrGlesVendor);
   139 		DumpString(_L("GL_VENDOR"), ptrGlesVendor);
   142 
   140 
   143 		TPtrC8 ptrGlesRenderer((const TText8 *)glGetString(GL_RENDERER));
   141 		TPtrC8 ptrGlesRenderer((const TText8 *)glGetString(GL_RENDERER));
   199 	{
   197 	{
   200 	SetTestStepID(_L("GRAPHICS-EGL-0010"));
   198 	SetTestStepID(_L("GRAPHICS-EGL-0010"));
   201 	INFO_PRINTF1(_L("CEglTest_QueryString_Extensions::doTestStepL"));
   199 	INFO_PRINTF1(_L("CEglTest_QueryString_Extensions::doTestStepL"));
   202 
   200 
   203 	TInt numExtensions=0;
   201 	TInt numExtensions=0;
   204 	if (!GetIntFromConfig(KSectionQueryExtensions, KKeyCountExtensionsEGL, numExtensions))
   202 	if (!GetIntFromConfig(ConfigSection(), KKeyCountExtensionsEGL, numExtensions))
   205 		{
   203 		{
   206 		ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &KKeyCountExtensionsEGL);
   204 		ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &KKeyCountExtensionsEGL);
   207 		User::Leave(KErrArgument);
   205 		User::Leave(KErrArgument);
   208 		}
   206 		}
   209 	INFO_PRINTF2(_L("Looking for %d EGL extensions"), numExtensions);
   207 	INFO_PRINTF2(_L("Looking for %d EGL extensions"), numExtensions);
   211 	TBuf16<128> bufExtensionNameValue16;
   209 	TBuf16<128> bufExtensionNameValue16;
   212 	TPtrC16 ptrExtensionNameValue16(bufExtensionNameValue16);
   210 	TPtrC16 ptrExtensionNameValue16(bufExtensionNameValue16);
   213 	for(TInt i=0; i<numExtensions; i++)
   211 	for(TInt i=0; i<numExtensions; i++)
   214 		{
   212 		{
   215 		bufExtensionNameKey.Format(KKeyExtensionEGLX, i);
   213 		bufExtensionNameKey.Format(KKeyExtensionEGLX, i);
   216 		if (!GetStringFromConfig(KSectionQueryExtensions, bufExtensionNameKey, ptrExtensionNameValue16))
   214 		if (!GetStringFromConfig(ConfigSection(), bufExtensionNameKey, ptrExtensionNameValue16))
   217 			{
   215 			{
   218 			ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &bufExtensionNameKey);
   216 			ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &bufExtensionNameKey);
   219 			User::Leave(KErrArgument);
   217 			User::Leave(KErrArgument);
   220 			}
   218 			}
   221 		INFO_PRINTF2(_L("Checking for extension \"%S\""), &ptrExtensionNameValue16);
   219 		INFO_PRINTF2(_L("Checking for extension \"%S\""), &ptrExtensionNameValue16);
   222 		TEST(CheckForExtensionL(0, ptrExtensionNameValue16));
   220 		TEST(CheckForExtensionL(0, ptrExtensionNameValue16));
   223 		}
   221 		}
   224 
   222 
   225 	numExtensions=0;
   223 	numExtensions=0;
   226 	if (!GetIntFromConfig(KSectionQueryExtensions, KKeyCountExtensionsVG, numExtensions))
   224 	if (!GetIntFromConfig(ConfigSection(), KKeyCountExtensionsVG, numExtensions))
   227 		{
   225 		{
   228 		ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &KKeyCountExtensionsVG);
   226 		ERR_PRINTF2(_L("Cannot find key '%S' in INI file"), &KKeyCountExtensionsVG);
   229 		User::Leave(KErrArgument);
   227 		User::Leave(KErrArgument);
   230 		}
   228 		}
   231 	INFO_PRINTF2(_L("Looking for %d VG extensions"), numExtensions);
   229 	INFO_PRINTF2(_L("Looking for %d VG extensions"), numExtensions);