EGL_MERGE EGL_MERGE
authorjose.thachil <jose.thachil@cell-telecom.com>
Tue, 02 Nov 2010 08:37:41 +0000
branchEGL_MERGE
changeset 212 a8e55d78eb52
parent 191 6356de74619b
child 216 b87045f2f5d7
EGL_MERGE
openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/eglosnativewindowtype.h
openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/riEGLOS.cpp
--- a/openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/eglosnativewindowtype.h	Fri Sep 24 16:58:15 2010 +0100
+++ b/openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/eglosnativewindowtype.h	Tue Nov 02 08:37:41 2010 +0000
@@ -20,7 +20,26 @@
 #ifndef EGLOSNATVIEWINDOWTYPE_H
 #define EGLOSNATVIEWINDOWTYPE_H
 
-struct TNativeWindowType
+class REglWindowBase
+	{
+public:
+	TBool IsWindow()
+		{
+		if(*(TInt32*)iOffset == 0xFFFFFFFF)
+			{
+			return EFalse;
+			}
+		}
+protected:
+	REglWindowBase():iOffsetVal(0xFFFFFFFF)
+		{
+		iOffset= &iOffsetVal;
+		}
+	TInt32 iOffsetVal;
+	void* iOffset;
+	};
+
+struct TNativeWindowType:public REglWindowBase
 	{
 public:
 	TNativeWindowType() :
--- a/openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/riEGLOS.cpp	Fri Sep 24 16:58:15 2010 +0100
+++ b/openvg/openvgrefimplementation/sfopenvg/sfopenvg/symbian/riEGLOS.cpp	Tue Nov 02 08:37:41 2010 +0000
@@ -86,7 +86,7 @@
 
 struct OSWindowContext
 {
-	TNativeWindowType   iNativeWindowType;
+	TNativeWindowType*  iNativeWindowType;
 };
 
 void* OSCreateWindowContext(EGLNativeWindowType window)
@@ -100,10 +100,21 @@
 	{
 		return NULL;
 	}
-	RDrawableWindow* drawableWindow = (RDrawableWindow*)window;
-	ctx->iNativeWindowType.iSize.iHeight = drawableWindow->Size().iHeight;
-	ctx->iNativeWindowType.iSize.iWidth = drawableWindow->Size().iWidth;
-    return ctx;
+	
+	REglWindowBase* winbase = (REglWindowBase*)window;
+	if(winbase->IsWindow() == EFalse)
+		{
+		ctx->iNativeWindowType = (TNativeWindowType*)window;
+		}
+	else
+		{
+		RDrawableWindow* drawableWindow = (RDrawableWindow*)window;
+		ctx->iNativeWindowType = new TNativeWindowType;
+		ctx->iNativeWindowType->iSize.iHeight = drawableWindow->Size().iHeight;
+		ctx->iNativeWindowType->iSize.iWidth = drawableWindow->Size().iWidth;
+		}
+	
+return ctx;
 }
 
 void OSDestroyWindowContext(void* context)
@@ -130,8 +141,8 @@
     OSWindowContext* ctx = (OSWindowContext*)context;
     if(ctx)
     {
-    	width=ctx->iNativeWindowType.iSize.iWidth;
-		height=ctx->iNativeWindowType.iSize.iHeight; 
+	   	width=ctx->iNativeWindowType->iSize.iWidth;
+		height=ctx->iNativeWindowType->iSize.iHeight; 
     }
     else
     {
@@ -152,15 +163,15 @@
 {
     OSWindowContext* ctx = (OSWindowContext*)context;
     //blit if either of iBitmap or iMaskBitmap exist
-    if(ctx && ctx->iNativeWindowType.iBitmap)
+    if(ctx && ctx->iNativeWindowType->iBitmap)
     {
         TUint w = drawable->getWidth();
         TUint h = drawable->getHeight();
         
         //these should be same as bitmap
-        if(ctx->iNativeWindowType.iBitmap)
+        if(ctx->iNativeWindowType->iBitmap)
         	{
-        	CFbsBitmap* bitmap = ctx->iNativeWindowType.iBitmap;        	
+        	CFbsBitmap* bitmap = ctx->iNativeWindowType->iBitmap;        	
         	ReadPixelsToCFbsBitmap(*bitmap, w, h);        	
         	}
     }