egl/egltest/src/egltestcommonsession.cpp
changeset 121 d72fc2aace31
parent 45 36b2e23a8629
child 178 89bd4cfee505
--- a/egl/egltest/src/egltestcommonsession.cpp	Tue Jun 22 15:21:29 2010 +0300
+++ b/egl/egltest/src/egltestcommonsession.cpp	Tue Jul 20 13:27:44 2010 +0300
@@ -779,7 +779,7 @@
 	return ETrue;
 	}
 
-EXPORT_C void CTestEglSession::CreateWindowSurfaceAndMakeCurrentL(EGLConfig aConfig, RWindow& aWindow, TBool aVgAlphaFormatPre, EGLenum aBindAPI, TInt aRenderVersionNumber)
+EXPORT_C void CTestEglSession::CreateWindowSurfaceAndMakeCurrentL(EGLConfig aConfig, RWindow& aWindow, TBool aVgAlphaFormatPre, EGLenum aBindAPI, TInt aRenderVersionNumber, EGLint* aAttribList)
 	{
 	ASSERT_EQUALS(iSurface, EGL_NO_SURFACE);
 	ASSERT_EQUALS(iContext, EGL_NO_CONTEXT);
@@ -787,12 +787,16 @@
 	ASSERT_EGL_TRUE(eglBindAPI(aBindAPI));
 
 	// Create a Window surface from the native image
-	const EGLint* windowAttribs = (aVgAlphaFormatPre && aBindAPI == EGL_OPENVG_API) ? KPixmapAttribsVgAlphaFormatPre : KPixmapAttribsNone;
+	const EGLint* windowAttribs = aAttribList;
+    if(!windowAttribs)
+        {
+        windowAttribs = (aVgAlphaFormatPre && aBindAPI == EGL_OPENVG_API) ? KPixmapAttribsVgAlphaFormatPre : KPixmapAttribsNone;
+        }
 	iSurface = eglCreateWindowSurface(iDisplay, aConfig, &aWindow, windowAttribs);
 	ASSERT_EGL_TRUE(iSurface != EGL_NO_SURFACE);
 
 	// Create a context for drawing to/reading from the pixmap surface and make it current
-	const EGLint KAttribsListCtxNone[] = { EGL_NONE };;
+	const EGLint KAttribsListCtxNone[] = { EGL_NONE };
 	const EGLint KAttribsListCtxGles2[] = { EGL_CONTEXT_CLIENT_VERSION, aRenderVersionNumber, EGL_NONE };
 	const EGLint* attrib_list_ctx = (aBindAPI == EGL_OPENGL_ES_API && aRenderVersionNumber == 2) ? KAttribsListCtxGles2 : KAttribsListCtxNone;
 	iContext = eglCreateContext(iDisplay, aConfig, EGL_NO_CONTEXT, attrib_list_ctx);
@@ -930,7 +934,7 @@
 		}
 
 	// Create a context for drawing to/reading from the pixmap surface and make it current
-	const EGLint KAttribsListCtxNone[] = { EGL_NONE };;
+	const EGLint KAttribsListCtxNone[] = { EGL_NONE };
 	const EGLint KAttribsListCtxGles2[] = { EGL_CONTEXT_CLIENT_VERSION, aRenderVersionNumber, EGL_NONE };
 	const EGLint* attrib_list_ctx = (aBindAPI == EGL_OPENGL_ES_API && aRenderVersionNumber == 2) ? KAttribsListCtxGles2 : KAttribsListCtxNone;
 	iContext = eglCreateContext(iDisplay, aConfig, EGL_NO_CONTEXT, attrib_list_ctx);
@@ -1049,7 +1053,7 @@
 	ASSERT_EGL_TRUE(iSurface != EGL_NO_SURFACE);
 
 	// Create a context for drawing to/reading from the pixmap surface and make it current
-	const EGLint KAttribsListCtxNone[] = { EGL_NONE };;
+	const EGLint KAttribsListCtxNone[] = { EGL_NONE };
 	const EGLint KAttribsListCtxGles2[] = { EGL_CONTEXT_CLIENT_VERSION, aRenderVersionNumber, EGL_NONE };
 	const EGLint* attrib_list_ctx = (aBindAPI == EGL_OPENGL_ES_API && aRenderVersionNumber == 2) ? KAttribsListCtxGles2 : KAttribsListCtxNone;
 	iContext = eglCreateContext(iDisplay, config, EGL_NO_CONTEXT, attrib_list_ctx);
@@ -1080,7 +1084,7 @@
 	ASSERT_EGL_TRUE(iSurface != EGL_NO_SURFACE);
 
 	// Create a context for drawing to/reading from the pixmap surface and make it current
-	const EGLint KAttribsListCtxNone[] = { EGL_NONE };;
+	const EGLint KAttribsListCtxNone[] = { EGL_NONE };
 	const EGLint KAttribsListCtxGles2[] = { EGL_CONTEXT_CLIENT_VERSION, aRenderVersionNumber, EGL_NONE };
 	const EGLint* attrib_list_ctx = (aBindAPI == EGL_OPENGL_ES_API && aRenderVersionNumber == 2) ? KAttribsListCtxGles2 : KAttribsListCtxNone;
 	iContext = eglCreateContext(iDisplay, aConfig, EGL_NO_CONTEXT, attrib_list_ctx);
@@ -1716,7 +1720,7 @@
 			return EFalse;
 			}
 		}
-    if(aExtension & KEGL_NOK__private__signal_sync)
+    if(aExtension & KEGL_NOK__private__signal_sync || extensionName.Compare(KEglNokPrivateSignalSync)==0)
         {
         TBool bFoundExtensionEGL_NOK__private__signal_sync = FindExtensionStringL(EIsEGL,KEglNokPrivateSignalSync);
         if (!bFoundExtensionEGL_NOK__private__signal_sync)
@@ -1725,7 +1729,7 @@
             return EFalse;
             }
         }
-    if(aExtension & KEGL_NOKIA_swap_buffers)
+    if(aExtension & KEGL_NOKIA_swap_buffers || extensionName.Compare(KEglNokiaSwapBuffers)==0)
         {
         TBool bFoundExtensionEGL_NOKIA_swap_buffer = FindExtensionStringL(EIsEGL,KEglNokiaSwapBuffers);
         if (!bFoundExtensionEGL_NOKIA_swap_buffer)
@@ -1735,7 +1739,7 @@
             }
         }
 #ifndef SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
-    if(aExtension & KEGL_SYMBIAN_image_preserved)
+    if(aExtension & KEGL_SYMBIAN_image_preserved || extensionName.Compare(KEglSymbianImagePreserved)
         {
         TBool bFoundExtensionEGL_SYMBIAN_image_preserved = FindExtensionStringL(EIsEGL,KEglSymbianImagePreserved);
         if (!bFoundExtensionEGL_SYMBIAN_image_preserved)
@@ -1745,7 +1749,24 @@
             }
         }
 #endif //SYMBIAN_GRAPHICS_EGL_SGIMAGELITE
-
+    if(aExtension & KEGL_NOK_image_endpoint || extensionName.Compare(KEglNokiaImageEndpoint)==0)
+        {
+        TBool bFoundExtensionEGL_NOK_image_endpoint = FindExtensionStringL(EIsEGL,KEglNokiaImageEndpoint);
+        if (!bFoundExtensionEGL_NOK_image_endpoint)
+            {
+            // The extension is not supported
+            return EFalse;
+            }
+        }
+    if(aExtension & KEGL_NOK_surface_scaling || extensionName.Compare(KEglNokiaSurfaceScaling)==0)
+        {
+        TBool bFoundExtensionEGL_NOK_surface_scaling = FindExtensionStringL(EIsEGL,KEglNokiaSurfaceScaling);
+        if (!bFoundExtensionEGL_NOK_surface_scaling)
+            {
+            // The extension is not supported
+            return EFalse;
+            }
+        }
 	return ETrue;
 	}
 
@@ -1840,7 +1861,6 @@
 	TBitmapUtil bmpUtil(bitmap);
 	bmpUtil.Begin(TPoint(0,0));
 	for (TInt colIndex = 0; colIndex < width; ++colIndex)
-
 		{
 		bmpUtil.SetPos(TPoint(colIndex, 0));
 		for (TInt rowIndex =0; rowIndex < height; ++rowIndex)